From a7e074e8b9eb8a040d9cd490e29cd158d66014c5 Mon Sep 17 00:00:00 2001 From: GekkeMano Date: Sun, 15 Jun 2025 01:21:59 +0200 Subject: [PATCH 1/2] Fixed and updated to 1.21.4 --- build.gradle | 7 ++---- gradle.properties | 8 +++---- gradle/wrapper/gradle-wrapper.properties | 4 ++-- .../org/icetank/AutoAnvilRenameModule.java | 24 ++++++------------- src/main/resources/rusherhack-plugin.json | 6 +++-- 5 files changed, 19 insertions(+), 30 deletions(-) diff --git a/build.gradle b/build.gradle index 4c05a69..15edd50 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { } //rusherhack api - rusherhackApi "org.rusherhack:rusherhack-api:1.20.1-SNAPSHOT" + rusherhackApi "org.rusherhack:rusherhack-api:1.21.4-SNAPSHOT" } loom { @@ -60,16 +60,13 @@ loom { } } -def targetJavaVersion = 17 +def targetJavaVersion = project.java_version tasks.withType(JavaCompile).configureEach { // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" - if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - it.options.release = targetJavaVersion - } } java { diff --git a/gradle.properties b/gradle.properties index 27573b9..fec5ec1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,20 +4,20 @@ org.gradle.jvmargs=-Xmx1G plugin_name = auto-anvil # plugin version -plugin_version = 1.0.0 +plugin_version = 1.1.0 maven_group = org.icetank # use java 17 for minecraft versions 1.20.4 and older # use java 21 for minecraft versions 1.20.5 and newer -java_version = 17 +java_version = 21 # minecraft version to compile with # other supported versions of the game can be added in rusherhack-plugin.json -minecraft_version = 1.20.1 +minecraft_version = 1.21.4 # parchment mappings -minecraft_version_range = 1.20-1.21.1 +minecraft_version_range = 1.21.1-1.21.4 # fabric loader version fabric_loader_version = 0.16.10 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..b12ed4d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ +#Sun Jun 15 01:20:21 CEST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip -networkTimeout=10000 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/org/icetank/AutoAnvilRenameModule.java b/src/main/java/org/icetank/AutoAnvilRenameModule.java index 8f29b15..0d676d9 100644 --- a/src/main/java/org/icetank/AutoAnvilRenameModule.java +++ b/src/main/java/org/icetank/AutoAnvilRenameModule.java @@ -10,13 +10,9 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.ShulkerBoxBlock; -import org.rusherhack.client.api.RusherHackAPI; import org.rusherhack.client.api.events.client.EventUpdate; -import org.rusherhack.client.api.events.render.EventRender2D; import org.rusherhack.client.api.feature.module.ModuleCategory; import org.rusherhack.client.api.feature.module.ToggleableModule; -import org.rusherhack.client.api.render.IRenderer2D; -import org.rusherhack.client.api.render.font.IFontRenderer; import org.rusherhack.client.api.utils.ChatUtils; import org.rusherhack.client.api.utils.InventoryUtils; import org.rusherhack.core.event.subscribe.Subscribe; @@ -24,8 +20,6 @@ import org.rusherhack.core.setting.NumberSetting; import org.rusherhack.core.setting.StringSetting; -import java.awt.*; - public class AutoAnvilRenameModule extends ToggleableModule { private final StringSetting renameText = new StringSetting("RenameText", "Sponsored by RusherHack Plugins"); private final BooleanSetting selectiveMode = new BooleanSetting("Selective", false); @@ -62,14 +56,10 @@ private void onUpdate(EventUpdate event) { } @Override - public void onEnable() { - - } + public void onEnable() {} @Override - public void onDisable() { - - } + public void onDisable() {} void tick() { if (mc.player == null || mc.level == null || mc.gameMode == null) return; @@ -89,19 +79,19 @@ void tick() { int cost = ((AnvilMenu) mc.player.containerMenu).getCost(); // Check if name matches the renameText option with an edge case for empty name values which remove the name. - if (outputItemName.equals(renameText.getValue()) || (renameText.getValue().equals("") && !itemStackOutput.hasCustomHoverName())) { + if (outputItemName.equals(renameText.getValue()) || (renameText.getValue().isEmpty() && !itemStackOutput.getHoverName().toString().isEmpty())) { // Automatically use XP bottles until the rename can be afforded if ((playerLevels < cost && !mc.player.isCreative()) && autoXP.getValue()) { if (!mc.player.isHolding(Items.EXPERIENCE_BOTTLE)) { int bottleSlot = InventoryUtils.findItemHotbar(Items.EXPERIENCE_BOTTLE); - if (bottleSlot != -1 && bottleSlot > 0 && bottleSlot < 9) { + if (bottleSlot > 0 && bottleSlot < 9) { mc.player.getInventory().selected = bottleSlot; } } if (mc.player.isHolding(Items.EXPERIENCE_BOTTLE)) { - mc.player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 1)); + mc.player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 1, 0, 0)); } } @@ -127,9 +117,9 @@ void tick() { String itemName = removeBrackets(itemStack.getDisplayName().getString()); String itemId = getItemId(itemStack.getItem()); - if (itemId.equals("")) continue; + if (itemId.isEmpty()) continue; if (selectiveMode.getValue() && !selectiveId.getValue().equals(itemId)) continue; - if (onlyRenamed.getValue() && !itemStack.hasCustomHoverName()) continue; + if (onlyRenamed.getValue() && !itemStackOutput.getHoverName().toString().isEmpty()) continue; if (onlyShulkers.getValue() && !isShulker(itemStack) && !selectiveMode.getValue()) continue; if (itemStack.isEmpty()) continue; if (itemName.equals(renameText.getValue())) continue; diff --git a/src/main/resources/rusherhack-plugin.json b/src/main/resources/rusherhack-plugin.json index 5d4587a..1a7dbc7 100644 --- a/src/main/resources/rusherhack-plugin.json +++ b/src/main/resources/rusherhack-plugin.json @@ -5,13 +5,15 @@ "Description": "", "Authors": [ "icetank", - "_90_" + "_90_", + "musheck" ], "Minecraft-Versions": [ "1.20.1", "1.20.2", "1.20.3", "1.20.4", - "1.21.1" + "1.21.1", + "1.21.4" ] } \ No newline at end of file From 733840c3e569dc43faa963dbf2eab2afedd6a92a Mon Sep 17 00:00:00 2001 From: GekkeMano Date: Sun, 15 Jun 2025 21:19:50 +0200 Subject: [PATCH 2/2] Fixed AutoXP throwing at feet --- src/main/java/org/icetank/AutoAnvilRenameModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/icetank/AutoAnvilRenameModule.java b/src/main/java/org/icetank/AutoAnvilRenameModule.java index 0d676d9..7cad8ec 100644 --- a/src/main/java/org/icetank/AutoAnvilRenameModule.java +++ b/src/main/java/org/icetank/AutoAnvilRenameModule.java @@ -91,7 +91,7 @@ void tick() { } if (mc.player.isHolding(Items.EXPERIENCE_BOTTLE)) { - mc.player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 1, 0, 0)); + mc.player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 1, 0, 90)); } }