diff --git a/.bugs b/.bugs index cabfab4c..3b24454e 100644 --- a/.bugs +++ b/.bugs @@ -37,7 +37,7 @@ patched 210318 client basic patched 211561 client basic patched 215531 client basic patched 217716 client basic -patched 231097 client basic +patched 231097 client gameplay patched 237493 client basic patched 242809 client basic patched 259512 client basic @@ -67,7 +67,7 @@ patched 123605 server basic patched 129909 server basic patched 132878 server basic patched 134110 server basic -patched 136249 server basic +patched 136249 server gameplay patched 139041 server basic patched 147659 server basic patched 155509 server basic diff --git a/src/client/java/dev/isxander/debugify/client/DebugifyClient.java b/src/client/java/dev/isxander/debugify/client/DebugifyClient.java index cb8f2c41..a377da6e 100644 --- a/src/client/java/dev/isxander/debugify/client/DebugifyClient.java +++ b/src/client/java/dev/isxander/debugify/client/DebugifyClient.java @@ -1,6 +1,10 @@ package dev.isxander.debugify.client; +import dev.isxander.debugify.Debugify; +import dev.isxander.debugify.client.utils.ClientUtils; + public class DebugifyClient { public static void onInitializeClient() { + Debugify.inMultiplayerWorld = ClientUtils::isInMultiplayerWorld; } } diff --git a/src/client/java/dev/isxander/debugify/client/helpers/mc251068/LastWorldDeleted.java b/src/client/java/dev/isxander/debugify/client/helpers/mc251068/LastWorldDeleted.java new file mode 100644 index 00000000..6b23db3a --- /dev/null +++ b/src/client/java/dev/isxander/debugify/client/helpers/mc251068/LastWorldDeleted.java @@ -0,0 +1,15 @@ +package dev.isxander.debugify.client.helpers.mc251068; + +public class LastWorldDeleted { + private static boolean marked = false; + + public static void mark() { + marked = true; + } + + public static boolean consume() { + boolean wasMarked = marked; + marked = false; + return wasMarked; + } +} diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldListEntryMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldListEntryMixin.java new file mode 100644 index 00000000..0a6f9d76 --- /dev/null +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldListEntryMixin.java @@ -0,0 +1,27 @@ +package dev.isxander.debugify.client.mixins.basic.mc251068; + +import dev.isxander.debugify.client.helpers.mc251068.LastWorldDeleted; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.client.gui.screens.worldselection.WorldSelectionList; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@BugFix(id = "MC-251068", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "If you delete your only world, then you are no longer automatically thrown into the menu of creating a new world") +@Mixin(WorldSelectionList.WorldListEntry.class) +public abstract class WorldListEntryMixin { + @Shadow + @Final + private WorldSelectionList list; + + @Inject(method = "doDeleteWorld", at = @At("TAIL")) + private void markLastWorldDeleted(CallbackInfo ci) { + if (this.list.children().size() <= 1) { + LastWorldDeleted.mark(); + } + } +} diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java index 9f571fb7..7b615998 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java @@ -1,13 +1,13 @@ package dev.isxander.debugify.client.mixins.basic.mc251068; import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import dev.isxander.debugify.client.helpers.mc251068.LastWorldDeleted; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.ObjectSelectionList; -import net.minecraft.client.gui.screens.ConfirmScreen; -import net.minecraft.client.gui.screens.ProgressScreen; import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen; import net.minecraft.client.gui.screens.worldselection.WorldSelectionList; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -17,6 +17,9 @@ @BugFix(id = "MC-251068", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "If you delete your only world, then you are no longer automatically thrown into the menu of creating a new world") @Mixin(WorldSelectionList.class) public abstract class WorldSelectionListMixin extends ObjectSelectionList { + @Shadow + @Final + WorldSelectionList.EntryType entryType; public WorldSelectionListMixin(Minecraft minecraft, int i, int j, int k, int l) { super(minecraft, i, j, k, l); @@ -24,6 +27,10 @@ public WorldSelectionListMixin(Minecraft minecraft, int i, int j, int k, int l) @WrapWithCondition(method = "returnToScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")) private boolean dontShowEmptyWorldList(Minecraft instance, Screen screen) { - return (this.minecraft.screen instanceof ProgressScreen || this.minecraft.screen instanceof ConfirmScreen); + if (!LastWorldDeleted.consume() || this.entryType != WorldSelectionList.EntryType.SINGLEPLAYER) + return true; + + CreateWorldScreen.openFresh(this.minecraft, () -> this.minecraft.setScreen(null)); + return false; } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc231097/LocalPlayerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/gameplay/mc231097/LocalPlayerMixin.java similarity index 73% rename from src/client/java/dev/isxander/debugify/client/mixins/basic/mc231097/LocalPlayerMixin.java rename to src/client/java/dev/isxander/debugify/client/mixins/gameplay/mc231097/LocalPlayerMixin.java index ba2a4ce4..1db8ef11 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc231097/LocalPlayerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/gameplay/mc231097/LocalPlayerMixin.java @@ -1,5 +1,6 @@ -package dev.isxander.debugify.client.mixins.basic.mc231097; +package dev.isxander.debugify.client.mixins.gameplay.mc231097; +import dev.isxander.debugify.Debugify; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.Minecraft; @@ -11,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -@BugFix(id = "MC-231097", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "Holding the \"Use\" button continues to slow down the player even after the used item has been dropped") +@BugFix(id = "MC-231097", category = FixCategory.GAMEPLAY, env = BugFix.Env.CLIENT, description = "Holding the \"Use\" button continues to slow down the player even after the used item has been dropped") @Mixin(LocalPlayer.class) public abstract class LocalPlayerMixin { @Shadow @Final protected Minecraft minecraft; @@ -20,7 +21,7 @@ public abstract class LocalPlayerMixin { @Inject(method = "drop", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Inventory;removeFromSelected(Z)Lnet/minecraft/world/item/ItemStack;", shift = At.Shift.AFTER)) private void onDropItem(boolean entireStack, CallbackInfoReturnable cir) { - if (isUsingItem()) { + if (isUsingItem() && Debugify.isGameplayFixesEnabled()) { minecraft.gameMode.releaseUsingItem((LocalPlayer) (Object) this); } } diff --git a/src/client/resources/debugify.client.mixins.json b/src/client/resources/debugify.client.mixins.json index 303dc7ff..0d855659 100644 --- a/src/client/resources/debugify.client.mixins.json +++ b/src/client/resources/debugify.client.mixins.json @@ -32,13 +32,14 @@ "basic.mc217716.GameRendererMixin", "basic.mc22882.AbstractContainerScreenMixin", "basic.mc22882.MinecraftMixin", - "basic.mc231097.LocalPlayerMixin", + "gameplay.mc231097.LocalPlayerMixin", "basic.mc237493.OptionsMixin", "basic.mc237493.TelemetryEventInstanceMixin", "basic.mc237493.TelemetryEventWidgetMixin", "basic.mc237493.TelemetryInfoScreenMixin", "basic.mc242809.DirectJoinServerScreenMixin", "basic.mc242809.ManageServerScreenMixin", + "basic.mc251068.WorldListEntryMixin", "basic.mc251068.WorldSelectionListMixin", "basic.mc263865.KeyboardHandlerMixin", "basic.mc267376.GameRendererMixin", diff --git a/src/main/java/dev/isxander/debugify/Debugify.java b/src/main/java/dev/isxander/debugify/Debugify.java index b3f8dd1e..f1bb19ff 100644 --- a/src/main/java/dev/isxander/debugify/Debugify.java +++ b/src/main/java/dev/isxander/debugify/Debugify.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; +import java.util.function.BooleanSupplier; public class Debugify { public static final Logger LOGGER = LoggerFactory.getLogger("Debugify"); @@ -41,7 +42,9 @@ public static BugFix.Env getEnv() { return FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT ? BugFix.Env.CLIENT : BugFix.Env.SERVER; } + public static BooleanSupplier inMultiplayerWorld = () -> false; + public static boolean isGameplayFixesEnabled() { - return Debugify.CONFIG.gameplayFixesInMultiplayer; + return !inMultiplayerWorld.getAsBoolean() || Debugify.CONFIG.gameplayFixesInMultiplayer; } } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc136249/LivingEntityMixin.java b/src/main/java/dev/isxander/debugify/mixins/gameplay/mc136249/LivingEntityMixin.java similarity index 74% rename from src/main/java/dev/isxander/debugify/mixins/basic/mc136249/LivingEntityMixin.java rename to src/main/java/dev/isxander/debugify/mixins/gameplay/mc136249/LivingEntityMixin.java index 649d65c5..96fd8d5b 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc136249/LivingEntityMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/gameplay/mc136249/LivingEntityMixin.java @@ -1,8 +1,9 @@ -package dev.isxander.debugify.mixins.basic.mc136249; +package dev.isxander.debugify.mixins.gameplay.mc136249; import com.llamalad7.mixinextras.expression.Definition; import com.llamalad7.mixinextras.expression.Expression; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import dev.isxander.debugify.Debugify; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.world.entity.LivingEntity; @@ -10,7 +11,7 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -@BugFix(id = "MC-136249", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Wearing boots enchanted with depth strider decreases the strength of the riptide enchantment") +@BugFix(id = "MC-136249", category = FixCategory.GAMEPLAY, env = BugFix.Env.SERVER, description = "Wearing boots enchanted with depth strider decreases the strength of the riptide enchantment") @Mixin(LivingEntity.class) public abstract class LivingEntityMixin{ @Shadow @@ -21,6 +22,6 @@ public abstract class LivingEntityMixin{ @Expression("this.getAttributeValue(WATER_MOVEMENT_EFFICIENCY)") @ModifyExpressionValue(method = "travelInFluid", at = @At("MIXINEXTRAS:EXPRESSION")) private double checkRiptide(double original) { - return this.isAutoSpinAttack() ? 0 : original; + return this.isAutoSpinAttack() && Debugify.isGameplayFixesEnabled() ? 0 : original; } } diff --git a/src/main/resources/assets/debugify/lang/en_us.json b/src/main/resources/assets/debugify/lang/en_us.json index c3f1065c..d8dff782 100644 --- a/src/main/resources/assets/debugify/lang/en_us.json +++ b/src/main/resources/assets/debugify/lang/en_us.json @@ -53,6 +53,8 @@ "debugify.fix_explanation.mc-176559": "Does not consider item durability when comparing a change in item when checking if block breaking should reset.", "debugify.fix_explanation.mc-197260": "Overrides the light level passed to the armour stand renderer with a maximum of: the block below the armor stand, bottom of the armor stand, top of the armor stand and the block above of the armor stand.", "debugify.fix_explanation.mc-237493": "Adds an option in the telemetry menu to completely disable telemetry. Telemetry is disabled by overriding all outgoing telemetry events to be an empty telemetry event, which is not sent.", + "debugify.fix_explanation.mc-231097": "When dropping an item, the client will send a \"release using item\" packet, if the player is currently using an item.", + "debugify.fix_effect.mc-231097": "This can cause very strict anti-cheats, such as Anti-Gaming-Chair, to flag \"invalid packet order\", which may result in a ban.", "debugify.fix_explanation.mc-2025": "Due to floating point inaccuracies, sometimes the hitbox of entities end up being slightly smaller than desired. Then, if this happens before the entities are pushed against each-other, they will intersect with the wall. Then, when the AABB is recalculated on chunk load, they will be determined as inside the wall, where they are then pushed. This fix simply writes an 'AABB' tag to entity NBT data with double-precision hitbox sizes which then get loaded back in.", "debugify.fix_effect.mc-2025": "This fix means loading Debugify for the first time will not fix the issue until the chunks are saved and loaded with Debugify.", @@ -72,6 +74,7 @@ "debugify.fix_explanation.mc-132878": "Spawns breaking particles when armour stands are hurt.", "debugify.fix_explanation.mc-134110": "Correctly rotates double chests when a structure that is mirrored is placed.", "debugify.fix_explanation.mc-135971": "Overrides CTRL+Q behaviour in crafting slot to repeatedly CTRL+Q until there are no items left in the crafting slot.", + "debugify.fix_explanation.mc-136249": "Ignores the water movement efficiency attribute (granted by depth strider) while the player is riptide spin attacking.", "debugify.fix_explanation.mc-155509": "Checks if the pufferfish is alive before attempting to sting the player.", "debugify.fix_explanation.mc-159283": "Casts 32-bit integers to 64-bit equivalents to prevent integer overflow at high X and Z values.", "debugify.fix_effect.mc-159283": "Affects world generation.", diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index 294cc80c..1c2ccf6f 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -23,7 +23,7 @@ "basic.mc132878.ArmorStandMixin", "basic.mc133218.ServerPlayerMixin", "basic.mc134110.ChestBlockMixin", - "basic.mc136249.LivingEntityMixin", + "gameplay.mc136249.LivingEntityMixin", "basic.mc139041.FishingRodItemMixin", "basic.mc147659.CatSpawnerMixin", "basic.mc153010.FoxMixin",