feat: include basic logging

This commit is contained in:
Erica Marigold 2024-05-20 20:09:06 +05:30
parent 813717068b
commit 2b625e49bc
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
2 changed files with 6 additions and 2 deletions

View file

@ -20,11 +20,13 @@ public class ElytraLock implements ClientModInitializer {
@Override @Override
public void onInitializeClient() { public void onInitializeClient() {
LOGGER.info("Elytra lock initializing!");
lockKeybind = KeyBindingHelper.registerKeyBinding( lockKeybind = KeyBindingHelper.registerKeyBinding(
new KeyBinding("key.elytralock.lock", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_J, "category.elytralock")); 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() { public static boolean isLocked() {

View file

@ -27,6 +27,8 @@ public class ClientPlayerInteractionManagerMixin {
private void skipElytra(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> info, @Local MutableObject<ActionResult> mutableObject) { private void skipElytra(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> info, @Local MutableObject<ActionResult> mutableObject) {
ItemStack itemStack = player.getStackInHand(hand); ItemStack itemStack = player.getStackInHand(hand);
if (itemStack.isOf(Items.ELYTRA) && ElytraLock.isLocked()) { if (itemStack.isOf(Items.ELYTRA) && ElytraLock.isLocked()) {
ElytraLock.LOGGER.info("Skipping sending PlayerInteractItemC2SPacket for locked elytra");
mutableObject.setValue(ActionResult.FAIL); mutableObject.setValue(ActionResult.FAIL);
info.setReturnValue((ActionResult) mutableObject.getValue()); info.setReturnValue((ActionResult) mutableObject.getValue());
} }