Release 2.6.3
This commit is contained in:
@@ -3,25 +3,32 @@ package com.replaymod.replay.mixin.entity_tracking;
|
|||||||
import com.replaymod.replay.ext.EntityExt;
|
import com.replaymod.replay.ext.EntityExt;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
@Mixin(Entity.class)
|
@Mixin(Entity.class)
|
||||||
public abstract class Mixin_EntityExt implements EntityExt {
|
public abstract class Mixin_EntityExt implements EntityExt {
|
||||||
|
|
||||||
@Unique
|
@Shadow
|
||||||
private float trackedYaw;
|
public float yaw;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public float pitch;
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
private float trackedPitch;
|
private float trackedYaw = Float.NaN;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private float trackedPitch = Float.NaN;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float replaymod$getTrackedYaw() {
|
public float replaymod$getTrackedYaw() {
|
||||||
return this.trackedYaw;
|
return !Float.isNaN(this.trackedYaw) ? this.trackedYaw : this.yaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float replaymod$getTrackedPitch() {
|
public float replaymod$getTrackedPitch() {
|
||||||
return this.trackedPitch;
|
return !Float.isNaN(this.trackedPitch) ? this.trackedPitch : this.pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -85,23 +85,23 @@ public class Mixin_FixPartialUpdates {
|
|||||||
@Unique
|
@Unique
|
||||||
private Entity entity;
|
private Entity entity;
|
||||||
|
|
||||||
@ModifyVariable(method = "onEntityUpdate", at = @At(value = "INVOKE", target = ENTITY_UPDATE), ordinal = 0)
|
@ModifyVariable(method = { "onEntityUpdate", "onEntityPosition" }, at = @At(value = "INVOKE", target = ENTITY_UPDATE), ordinal = 0)
|
||||||
private Entity captureEntity(Entity entity) {
|
private Entity captureEntity(Entity entity) {
|
||||||
return this.entity = entity;
|
return this.entity = entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "onEntityUpdate", at = @At("RETURN"))
|
@Inject(method = { "onEntityUpdate", "onEntityPosition" }, at = @At("RETURN"))
|
||||||
private void resetEntityField(CallbackInfo ci) {
|
private void resetEntityField(CallbackInfo ci) {
|
||||||
this.entity = null;
|
this.entity = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyArg(method = "onEntityUpdate", at = @At(value = "INVOKE", target = ENTITY_UPDATE), index = 3)
|
@ModifyArg(method = { "onEntityUpdate", "onEntityPosition" }, at = @At(value = "INVOKE", target = ENTITY_UPDATE), index = 3)
|
||||||
private float captureTrackedYaw(float value) {
|
private float captureTrackedYaw(float value) {
|
||||||
((EntityExt) this.entity).replaymod$setTrackedYaw(value);
|
((EntityExt) this.entity).replaymod$setTrackedYaw(value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyArg(method = "onEntityUpdate", at = @At(value = "INVOKE", target = ENTITY_UPDATE), index = 4)
|
@ModifyArg(method = { "onEntityUpdate", "onEntityPosition" }, at = @At(value = "INVOKE", target = ENTITY_UPDATE), index = 4)
|
||||||
private float captureTrackedPitch(float value) {
|
private float captureTrackedPitch(float value) {
|
||||||
((EntityExt) this.entity).replaymod$setTrackedPitch(value);
|
((EntityExt) this.entity).replaymod$setTrackedPitch(value);
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.6.2
|
2.6.3
|
||||||
|
|||||||
Reference in New Issue
Block a user