From 2b625e49bcc13e8ab495f6d1e93654d0508ceddf Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 20 May 2024 20:09:06 +0530 Subject: [PATCH] feat: include basic logging --- src/main/java/xyz/devcomp/elytralock/ElytraLock.java | 6 ++++-- .../mixin/ClientPlayerInteractionManagerMixin.java | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/devcomp/elytralock/ElytraLock.java b/src/main/java/xyz/devcomp/elytralock/ElytraLock.java index 054951d..03f16c4 100644 --- a/src/main/java/xyz/devcomp/elytralock/ElytraLock.java +++ b/src/main/java/xyz/devcomp/elytralock/ElytraLock.java @@ -20,11 +20,13 @@ public class ElytraLock implements ClientModInitializer { @Override public void onInitializeClient() { + LOGGER.info("Elytra lock initializing!"); + lockKeybind = KeyBindingHelper.registerKeyBinding( new KeyBinding("key.elytralock.lock", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_J, "category.elytralock")); - client = MinecraftClient.getInstance(); + LOGGER.info("Registered keybind for elytra lock"); - LOGGER.info("Elytra lock initializing!"); + client = MinecraftClient.getInstance(); } public static boolean isLocked() { diff --git a/src/main/java/xyz/devcomp/elytralock/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/xyz/devcomp/elytralock/mixin/ClientPlayerInteractionManagerMixin.java index 80ef6f3..7ac0844 100644 --- a/src/main/java/xyz/devcomp/elytralock/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/xyz/devcomp/elytralock/mixin/ClientPlayerInteractionManagerMixin.java @@ -27,6 +27,8 @@ public class ClientPlayerInteractionManagerMixin { private void skipElytra(PlayerEntity player, Hand hand, CallbackInfoReturnable info, @Local MutableObject mutableObject) { ItemStack itemStack = player.getStackInHand(hand); if (itemStack.isOf(Items.ELYTRA) && ElytraLock.isLocked()) { + ElytraLock.LOGGER.info("Skipping sending PlayerInteractItemC2SPacket for locked elytra"); + mutableObject.setValue(ActionResult.FAIL); info.setReturnValue((ActionResult) mutableObject.getValue()); }