fix records list and add btns

This commit is contained in:
MeexReay 2024-04-22 00:25:43 +03:00
parent b6589b3629
commit 38dad10048
24 changed files with 758 additions and 286 deletions

View file

@ -9,9 +9,9 @@ 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.Main;
import themixray.repeating.mod.event.RecordBlockBreakEvent;
import themixray.repeating.mod.event.RecordBlockInteractEvent;
import themixray.repeating.mod.TickTask;
@Mixin(ClientPlayerEntity.class)
@ -20,14 +20,14 @@ public abstract class MovementMixin {
@Inject(at = @At(value = "HEAD"), method = "init")
private void init(CallbackInfo ci) {
PlayerBlockBreakEvents.AFTER.register((world, player, pos, blockState, blockEntity) -> {
if (RepeatingMod.me.is_recording)
RepeatingMod.me.recordTick(new RecordBlockBreakEvent(pos));
if (Main.me.is_recording)
Main.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 RecordBlockInteractEvent(hand,hitResult));
if (Main.me.is_recording)
Main.me.recordTick(new RecordBlockInteractEvent(hand,hitResult));
return ActionResult.PASS;
});
}