diff --git a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java index 9fbf63f7..739ae922 100644 --- a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java +++ b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java @@ -326,6 +326,11 @@ public class FixesConfig { @Config.RequiresMcRestart public static boolean fixWrongBlockPlacementDistanceCheck; + @Config.Comment("Fix inventory sync lag: prevents client to check recipes on empty slots. Particularly fixes lag when trying to eat food when full.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean fixInventorySyncLag; + /* ====== Minecraft fixes end ===== */ // bukkit fixes diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java index e2faca39..c87282fd 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java @@ -206,6 +206,9 @@ public enum Mixins { "fml.MixinNetworkDispatcher", "minecraft.NetworkManagerAccessor") .setApplyIf(() -> FixesConfig.fixBogusIntegratedServerNPEs).addTargetedMod(TargetedMod.VANILLA)), + FIX_LAG_ON_INVENTORY_SYNC(new Builder("Fix inventory sync lag").setPhase(Phase.EARLY) + .addMixinClasses("minecraft.MixinInventoryCrafting").setSide(Side.BOTH) + .setApplyIf(() -> FixesConfig.fixInventorySyncLag).addTargetedMod(TargetedMod.VANILLA)), FIX_LOGIN_DIMENSION_ID_OVERFLOW( new Builder("Fix dimension id overflowing when a player first logins on a server").setPhase(Phase.EARLY)