diff --git a/README.md b/README.md index 5015732f..f6235ae3 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ All changes are toggleable via config files. * **Locale:** Prevents various crashes with Turkish locale * **Max Health:** Corrects maximum player health on joining by setting the last saved health value * **Minecart AI:** Fixes non-player entities being able to control minecarts -* **Mining Glitch:** Avoids the need for multiple mining attempts by sending additional movement packets +* **Mining Glitch:** Prevents ghost blocks by sending additional movement packets * **Model Gap:** Fixes transparent gaps in all 3D models of blocks and items * **Mount Desync:** Fixes mounts and boats sometimes disappearing after dismounting * **Packet Size:** Increases the packet size limit to account for large packets in modded environments diff --git a/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPacketsMixin.java b/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPacketsMixin.java index 0e534f3c..146905ef 100644 --- a/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPacketsMixin.java +++ b/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPacketsMixin.java @@ -18,9 +18,9 @@ public class UTPlayerPacketsMixin @ModifyConstant(method = "processPlayer", constant = @Constant(intValue = 5, ordinal = 0)) private int utModifyMaxPlayerMovementPacketsPerTick(int maxPackets) { - if (!UTConfigBugfixes.BLOCKS.utMiningGlitchToggle) return maxPackets; + if (!UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchToggle) return maxPackets; if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTPlayerPacketsMixin ::: Process player"); - if (maxPackets == 5) return 10; + if (maxPackets == 5) return UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchPackets; else return maxPackets; } } \ No newline at end of file diff --git a/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPositionMixin.java b/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPositionMixin.java index db4feecd..c0b980fb 100644 --- a/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPositionMixin.java +++ b/src/main/java/mod/acgaming/universaltweaks/bugfixes/blocks/miningglitch/mixin/UTPlayerPositionMixin.java @@ -30,7 +30,7 @@ public class UTPlayerPositionMixin @Inject(slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getTutorial()Lnet/minecraft/client/tutorial/Tutorial;", ordinal = 1), to = @At(value = "INVOKE", target = "Lnet/minecraft/block/state/IBlockState;getMaterial()Lnet/minecraft/block/material/Material;", ordinal = 0)), method = "clickBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/NetHandlerPlayClient;sendPacket(Lnet/minecraft/network/Packet;)V", ordinal = 0)) private void utUpdatePlayerPositionBeforeDigging(BlockPos loc, EnumFacing face, CallbackInfoReturnable ci) { - if (!UTConfigBugfixes.BLOCKS.utMiningGlitchToggle) return; + if (!UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchToggle) return; if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTPlayerPositionMixin ::: Update player position"); ((IEntityPlayerSP) this.mc.player).updateWalkingPlayer(); } diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigBugfixes.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigBugfixes.java index 9a890925..b3a404a0 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigBugfixes.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigBugfixes.java @@ -37,6 +37,10 @@ public static class BlocksCategory @Config.Name("Block Overlay") public final BlockOverlayCategory BLOCK_OVERLAY = new BlockOverlayCategory(); + @Config.LangKey("cfg.universaltweaks.tweaks.blocks.miningglitch") + @Config.Name("Mining Glitch") + public final MiningGlitchCategory MINING_GLITCH = new MiningGlitchCategory(); + @Config.RequiresMcRestart @Config.Name("Banner Bounding Box") @Config.Comment @@ -80,11 +84,6 @@ public static class BlocksCategory @Config.Comment("Disables climbing movement when flying") public boolean utLadderFlyingToggle = true; - @Config.RequiresMcRestart - @Config.Name("Mining Glitch") - @Config.Comment("Avoids the need for multiple mining attempts by sending additional movement packets") - public boolean utMiningGlitchToggle = true; - @Config.RequiresMcRestart @Config.Name("Piston Progress") @Config.Comment("Properly saves the last state of pistons to tags") @@ -123,6 +122,22 @@ public static class BlockOverlayCategory }) public String[] utBlockOverlayWhitelist = new String[] {}; } + + public static class MiningGlitchCategory + { + @Config.RequiresMcRestart + @Config.Name("[1] Mining Glitch Toggle") + @Config.Comment("Prevents ghost blocks by sending additional movement packets") + public boolean utMiningGlitchToggle = true; + + @Config.Name("[2] Maximum Movement Packets") + @Config.Comment + ({ + "Defines the maximum number of movement packets that can be sent per tick", + "Vanilla default is 5" + }) + public int utMiningGlitchPackets = 10; + } } public static class EntitiesCategory diff --git a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java index 82a7f083..c7bd7de5 100644 --- a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java +++ b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java @@ -270,7 +270,7 @@ public boolean shouldMixinConfigQueue(String mixinConfig) case "mixins.bugfixes.blocks.blockoverlay.json": return UTConfigBugfixes.BLOCKS.BLOCK_OVERLAY.utBlockOverlayToggle; case "mixins.bugfixes.blocks.miningglitch.client.json": - return UTConfigBugfixes.BLOCKS.utMiningGlitchToggle; + return UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchToggle; case "mixins.bugfixes.entities.elytra.json": return UTConfigBugfixes.ENTITIES.utElytraDeploymentLandingToggle; case "mixins.bugfixes.entities.villagermantle.json": @@ -352,7 +352,7 @@ public boolean shouldMixinConfigQueue(String mixinConfig) case "mixins.bugfixes.blocks.ladderflying.json": return UTConfigBugfixes.BLOCKS.utLadderFlyingToggle; case "mixins.bugfixes.blocks.miningglitch.server.json": - return UTConfigBugfixes.BLOCKS.utMiningGlitchToggle; + return UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchToggle; case "mixins.bugfixes.blocks.piston.tile.json": return UTConfigBugfixes.BLOCKS.utPistonTileToggle; case "mixins.bugfixes.blocks.piston.retraction.json": diff --git a/src/main/java/mod/acgaming/universaltweaks/util/compat/UTObsoleteModsHandler.java b/src/main/java/mod/acgaming/universaltweaks/util/compat/UTObsoleteModsHandler.java index 40666cf0..5ff18c16 100644 --- a/src/main/java/mod/acgaming/universaltweaks/util/compat/UTObsoleteModsHandler.java +++ b/src/main/java/mod/acgaming/universaltweaks/util/compat/UTObsoleteModsHandler.java @@ -101,7 +101,7 @@ public static List obsoleteModsMessage() if (Loader.isModLoaded("pathundergates") && UTConfigTweaks.BLOCKS.utLenientPathsToggle) messages.add("Path Under Gates"); if (Loader.isModLoaded("pickupnotifier") && UTConfigTweaks.MISC.PICKUP_NOTIFICATION.utPickupNotificationToggle) messages.add("Pick Up Notifier"); if (Loader.isModLoaded("portaldupebegone") && UTConfigBugfixes.WORLD.utPortalTravelingDupeToggle) messages.add("PortalDupeBegone"); - if (Loader.isModLoaded("preventghost") && UTConfigBugfixes.BLOCKS.utMiningGlitchToggle) messages.add("Prevent Ghost Blocks"); + if (Loader.isModLoaded("preventghost") && UTConfigBugfixes.BLOCKS.MINING_GLITCH.utMiningGlitchToggle) messages.add("Prevent Ghost Blocks"); if (Loader.isModLoaded("quickleafdecay") && UTConfigTweaks.BLOCKS.utLeafDecayToggle) messages.add("Quick Leaf Decay"); if (Loader.isModLoaded("rallyhealth") && UTConfigTweaks.ENTITIES.RALLY_HEALTH.utRallyHealthToggle) messages.add("Rally Health"); if (Loader.isModLoaded("salwayseat") && UTConfigTweaks.ITEMS.utAlwaysEatToggle) messages.add("AlwaysEat"); diff --git a/src/main/resources/assets/universaltweaks/lang/en_us.lang b/src/main/resources/assets/universaltweaks/lang/en_us.lang index 65fcf684..52d68832 100644 --- a/src/main/resources/assets/universaltweaks/lang/en_us.lang +++ b/src/main/resources/assets/universaltweaks/lang/en_us.lang @@ -98,6 +98,7 @@ cfg.universaltweaks.tweaks.blocks.betterplacement=Better Placement cfg.universaltweaks.tweaks.blocks.blockdispenser=Block Dispenser cfg.universaltweaks.tweaks.blocks.breakablebedrock=Breakable Bedrock cfg.universaltweaks.tweaks.blocks.finitewater=Finite Water +cfg.universaltweaks.tweaks.blocks.miningglitch=Mining Glitch cfg.universaltweaks.tweaks.blocks.overhaulbeacon=Overhaul Beacon cfg.universaltweaks.tweaks.blocks.sapling=Sapling Behavior cfg.universaltweaks.tweaks.entities.attributes=Attributes