mirror of
https://github.com/CompeyDev/elytra-lock-fabric.git
synced 2024-12-12 12:50:42 +00:00
feat: include basic logging
This commit is contained in:
parent
813717068b
commit
2b625e49bc
2 changed files with 6 additions and 2 deletions
|
@ -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() {
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue