small refactoring

This commit is contained in:
MeexReay 2024-04-20 18:39:35 +03:00
parent 543f2a18cf
commit f3acb4df10
15 changed files with 531 additions and 558 deletions

View file

@ -9,11 +9,11 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import themixray.repeating.mod.events.RecordBlockBreakEvent;
import themixray.repeating.mod.events.RecordBlockInteractEvent;
import themixray.repeating.mod.RepeatingMod;
import themixray.repeating.mod.TickTask;
import java.util.ArrayList;
@Mixin(ClientPlayerEntity.class)
public abstract class MovementMixin {
@ -21,13 +21,13 @@ public abstract class MovementMixin {
private void init(CallbackInfo ci) {
PlayerBlockBreakEvents.AFTER.register((world, player, pos, blockState, blockEntity) -> {
if (RepeatingMod.me.is_recording)
RepeatingMod.me.recordTick(new RepeatingMod.RecordBlockBreakEvent(pos));
RepeatingMod.me.recordTick(new RecordBlockBreakEvent(pos));
});
UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
if (hitResult.getType().equals(HitResult.Type.BLOCK))
if (RepeatingMod.me.is_recording)
RepeatingMod.me.recordTick(new RepeatingMod.RecordBlockInteractEvent(hand,hitResult));
RepeatingMod.me.recordTick(new RecordBlockInteractEvent(hand,hitResult));
return ActionResult.PASS;
});
}