From 7300ae1879de4975742c0c091a22c621f5c709d1 Mon Sep 17 00:00:00 2001 From: Jacky Date: Fri, 1 Sep 2023 23:06:40 +0800 Subject: [PATCH] 3.4.1 Update --- build.gradle | 7 ------- gradle.properties | 4 ++-- .../jackyy/exchangers/handler/ClientEventsHandler.java | 1 + .../java/jackyy/exchangers/item/ItemExchangerBase.java | 6 ++++-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 4f96ace..accefb4 100644 --- a/build.gradle +++ b/build.gradle @@ -62,13 +62,6 @@ repositories { name = 'ModMaven' url = 'https://modmaven.dev' } - maven { - name = 'JEI Maven' - url = 'https://dvs1.progwml6.com/files/maven' - content { - includeGroup 'mezz.jei' - } - } maven { name = 'Curse Maven' url = 'https://www.cursemaven.com' diff --git a/gradle.properties b/gradle.properties index e03b2d0..dbe4ee3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,14 +7,14 @@ mod_name=Exchangers mc_version=1.19.4 mc_version_range=[1.19.4,1.20) -forge_version=45.1.14 +forge_version=45.1.17 forge_version_range=[45,) loader_version_range=[45,) mappings_channel=official mappings_version=1.19.4 -mod_version=3.4 +mod_version=3.4.1 mod_license=Jacky's Minecraft Mods License mod_authors=Jackyy, TurkeyDev mod_description=Block Exchangers. diff --git a/src/main/java/jackyy/exchangers/handler/ClientEventsHandler.java b/src/main/java/jackyy/exchangers/handler/ClientEventsHandler.java index 1e0daf8..83bd960 100644 --- a/src/main/java/jackyy/exchangers/handler/ClientEventsHandler.java +++ b/src/main/java/jackyy/exchangers/handler/ClientEventsHandler.java @@ -144,6 +144,7 @@ public void onKeyInput(InputEvent.Key event) { if (player != null) { ItemStack heldItem = player.getMainHandItem(); if (!heldItem.isEmpty() && heldItem.getItem() instanceof ItemExchangerBase) { + ExchangerHandler.setDefaultTagCompound(heldItem); if (Keys.OPEN_GUI_KEY.get().isDown()) { mc.setScreen(new ExchangersGuiScreen()); } else if (Keys.RANGE_SWITCH_KEY.get().isDown()) { diff --git a/src/main/java/jackyy/exchangers/item/ItemExchangerBase.java b/src/main/java/jackyy/exchangers/item/ItemExchangerBase.java index 3e10b8f..768fd09 100644 --- a/src/main/java/jackyy/exchangers/item/ItemExchangerBase.java +++ b/src/main/java/jackyy/exchangers/item/ItemExchangerBase.java @@ -59,10 +59,12 @@ public InteractionResult useOn(UseOnContext context) { BlockPos pos = context.getClickedPos(); Direction side = context.getClickedFace(); if (!world.isClientSide() && player != null) { + ItemStack mainHandStack = player.getMainHandItem(); + ExchangerHandler.setDefaultTagCompound(mainHandStack); if (player.isShiftKeyDown()) { - ExchangerHandler.selectBlock(player.getMainHandItem(), player, world, pos); + ExchangerHandler.selectBlock(mainHandStack, player, world, pos); } else { - ExchangerHandler.placeBlock(player.getMainHandItem(), player, world, pos, side, context); + ExchangerHandler.placeBlock(mainHandStack, player, world, pos, side, context); } } return InteractionResult.SUCCESS;