ms -> ticks
This commit is contained in:
parent
51b68dd48f
commit
7dfbbdc959
11 changed files with 245 additions and 77 deletions
|
@ -12,6 +12,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import themixray.repeating.mod.RepeatingMod;
|
||||
import themixray.repeating.mod.TickTask;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Mixin(ClientPlayerEntity.class)
|
||||
public abstract class MovementMixin {
|
||||
|
||||
|
@ -30,36 +32,13 @@ public abstract class MovementMixin {
|
|||
});
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "HEAD"), method = "tick")
|
||||
private void onTickHead(CallbackInfo ci) {
|
||||
for (TickTask t:TickTask.ticks)
|
||||
if (t.getAt() == TickTask.TickAt.HEAD)
|
||||
t.tick();
|
||||
@Inject(at = @At(value = "HEAD"), method = "tickMovement")
|
||||
private void onMoveHead(CallbackInfo ci) {
|
||||
TickTask.tickTasks(TickTask.TickAt.MOVEMENT_HEAD);
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "TAIL"), method = "tick")
|
||||
private void onTickTail(CallbackInfo ci) {
|
||||
for (TickTask t:TickTask.ticks)
|
||||
if (t.getAt() == TickTask.TickAt.TAIL)
|
||||
t.tick();
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "HEAD"), method = "tickMovement")
|
||||
private void onMove(CallbackInfo ci) {
|
||||
if (RepeatingMod.me.is_recording) {
|
||||
RepeatingMod.me.recordAllInput();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "HEAD"), method = "setSprinting", cancellable = true)
|
||||
private void onSprint(boolean sprinting,CallbackInfo ci) {
|
||||
if (RepeatingMod.me.is_replaying) {
|
||||
if (RepeatingMod.input_replay != null &&
|
||||
RepeatingMod.input_replay.sprinting != null &&
|
||||
RepeatingMod.input_replay.sprinting != sprinting) {
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
}
|
||||
private void onMoveTail(CallbackInfo ci) {
|
||||
TickTask.tickTasks(TickTask.TickAt.MOVEMENT_TAIL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue