From e52208cd9a8d709bd9c9f17bb1a1018190c4b880 Mon Sep 17 00:00:00 2001 From: 1024-byteeeee <2270484921@qq.com> Date: Tue, 14 Jul 2026 14:45:30 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B7=B2=E7=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run/options.txt | 13 +++-- .../BubbleColumnBlockMixin.java | 2 +- .../cobwebSlowDownDisabled/WebBlockMixin.java | 2 +- .../rule/fluidPushDisabled/PlayerMixin.java | 2 +- .../EntityMixin.java} | 45 +++++++++-------- .../HoneyBlockMixin.java | 50 ------------------- .../LivingEntityMixin.java | 2 +- .../jumpDelayDisabled/LivingEntityMixin.java | 8 +-- .../letFluidInteractLikeAir/EntityMixin.java | 14 +++--- .../LivingEntityMixin.java | 2 +- .../LocalPlayerMixin.java | 2 +- .../letFluidInteractLikeAir/PlayerMixin.java | 2 +- .../renderHandDisabled/GameRendererMixin.java | 2 +- .../EntityMixin.java | 45 +++++++++-------- .../SlimeBlockMixin.java | 6 +-- ...ulSandBlockMixin.java => EntityMixin.java} | 37 ++++++++++---- .../LocalPlayerMixin.java | 2 +- .../top/byteeeee/fuzz/utils/ClientUtil.java | 9 ++++ src/main/resources/fuzz.mixins.json | 15 +++--- .../LevelRendererAccessor.java | 5 +- .../SlimeBlockMixin.java | 4 +- 21 files changed, 127 insertions(+), 142 deletions(-) rename src/main/java/top/byteeeee/fuzz/mixin/rule/{slimeBlockBounceDisabled/LivingEntityMixin.java => honeyBlockSlowDownDisabled/EntityMixin.java} (55%) delete mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java rename versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java => src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java (55%) rename src/main/java/top/byteeeee/fuzz/mixin/rule/{slimeBlockBounceDisabled => slimeBlockSlowDownDisabled}/SlimeBlockMixin.java (84%) rename src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/{SoulSandBlockMixin.java => EntityMixin.java} (54%) rename versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/{slimeBlockBounceDisabled => slimeBlockSlowDownDisabled}/SlimeBlockMixin.java (91%) diff --git a/run/options.txt b/run/options.txt index 2be01bd..793e981 100644 --- a/run/options.txt +++ b/run/options.txt @@ -1,4 +1,4 @@ -version:4788 +version:4903 ao:true biomeBlendRadius:2 chunkSectionFadeInTime:0.75 @@ -13,6 +13,7 @@ fovEffectScale:1.0 darknessEffectScale:1.0 glintSpeed:0.5 glintStrength:0.75 +preferredGraphicsBackend:"default" graphicsPreset:"custom" prioritizeChunkUpdates:0 fullscreen:false @@ -49,7 +50,6 @@ invertYMouse:false realmsNotifications:true showSubtitles:false directionalAudio:false -touchscreen:false bobView:true toggleCrouch:false toggleSprint:false @@ -59,12 +59,12 @@ sprintWindow:7 darkMojangStudiosBackground:false hideLightningFlashes:false hideSplashTexts:false -mouseSensitivity:0.5 +mouseSensitivity:0.3287943808685447 damageTiltStrength:1.0 highContrast:false highContrastBlockOutline:false narratorHotkey:true -resourcePacks:["vanilla"] +resourcePacks:["vanilla","fuzz_mod:chest_optimization"] incompatibleResourcePacks:[] lastServer: lang:zh_cn @@ -98,6 +98,8 @@ joinedFirstServer:false syncChunkWrites:true showAutosaveIndicator:true allowServerListing:true +inGameNotification:false +sharePresence:"all" onlyShowSecureChat:false saveChatDrafts:false panoramaScrollSpeed:1.0 @@ -122,6 +124,7 @@ key_key.chat:key.keyboard.t key_key.playerlist:key.keyboard.tab key_key.pickItem:key.mouse.middle key_key.command:key.keyboard.slash +key_key.friends:key.keyboard.o key_key.socialInteractions:key.keyboard.p key_key.toggleGui:key.keyboard.f1 key_key.toggleSpectatorShaderEffects:key.keyboard.f4 @@ -170,7 +173,7 @@ key_key.debug.lightmapTexture:key.keyboard.4 key_快捷踢出假人:key.keyboard.unknown key_快捷扔出假人背包:key.keyboard.unknown key_清除坐标罗盘:key.keyboard.unknown -soundCategory_master:0.24668874 +soundCategory_master:1.0 soundCategory_music:0.0 soundCategory_record:1.0 soundCategory_weather:1.0 diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java index f2aff01..a5d62b1 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java @@ -44,7 +44,7 @@ public abstract class BubbleColumnBlockMixin { @WrapMethod(method = "entityInside") private void onEntityCollision(BlockState state, Level world, BlockPos pos, Entity entity, InsideBlockEffectApplier handler, boolean bl, Operation original) { - if (FuzzSettings.bubbleColumnInteractDisabled && entity.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.bubbleColumnInteractDisabled && ClientUtil.isSelf(entity)) { Noop.noop(); } else { original.call(state, world, pos, entity,handler,bl); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java index f68239c..f2e4bfa 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java @@ -44,7 +44,7 @@ public abstract class WebBlockMixin { ) ) private void slowDownDisabled(Entity entity, BlockState blockState, Vec3 speedMultiplier, Operation original) { - if (FuzzSettings.cobwebSlowDownDisabled && entity.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.cobwebSlowDownDisabled && ClientUtil.isSelf(entity)) { Noop.noop(); } else { original.call(entity, blockState, speedMultiplier); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java index d1ad612..ce71773 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java @@ -40,6 +40,6 @@ public abstract class PlayerMixin { @ModifyReturnValue(method = "isPushedByFluid", at = @At("RETURN")) public boolean isPushedByFluids(boolean original) { Player player = (Player) (Object) this; - return FuzzSettings.fluidPushDisabled && player.equals(ClientUtil.getCurrentPlayer()) ? false : original; + return FuzzSettings.fluidPushDisabled && ClientUtil.isSelf(player) ? false : original; } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java similarity index 55% rename from src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java rename to src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java index cc7986b..0649e98 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java @@ -18,40 +18,45 @@ * along with Fuzz. If not, see . */ -package top.byteeeee.fuzz.mixin.rule.slimeBlockBounceDisabled; +package top.byteeeee.fuzz.mixin.rule.honeyBlockSlowDownDisabled; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.world.level.block.Block; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import top.byteeeee.fuzz.FuzzSettings; import top.byteeeee.fuzz.utils.ClientUtil; +import top.byteeeee.fuzz.utils.EntityUtil; @Environment(EnvType.CLIENT) -@Mixin(LivingEntity.class) -public abstract class LivingEntityMixin { - @WrapOperation( - method = "travelInAir", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/world/level/block/Block;getFriction()F" - ) - ) - private float slimeSlipperinessDisabled(Block block, Operation original) { - LivingEntity entity = (LivingEntity) (Object) this; - if (FuzzSettings.slimeBlockSlowDownDisabled && entity.equals(ClientUtil.getCurrentPlayer()) && block.equals(Blocks.SLIME_BLOCK)) { - return Blocks.TNT.getFriction(); +@Mixin(Entity.class) +public abstract class EntityMixin { + @ModifyReturnValue(method = {"getBlockSpeedFactor", "getBlockJumpFactor"}, at = @At("RETURN")) + private float modifySpeedFactorValue(float original) { + if (!FuzzSettings.honeyBlockSlowDownDisabled) { + return original; + } + + Entity entity = (Entity) (Object) this; + + if (!ClientUtil.isSelf(entity)) { + return original; + } + + BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); + + if (blockState.is(Blocks.HONEY_BLOCK)) { + return 1.0F; } else { - return original.call(block); + return original; } } -} \ No newline at end of file +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java deleted file mode 100644 index 3f68ffc..0000000 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - -package top.byteeeee.fuzz.mixin.rule.honeyBlockSlowDownDisabled; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; - -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.HoneyBlock; - -import org.spongepowered.asm.mixin.Mixin; - -import top.byteeeee.fuzz.FuzzSettings; - -@Environment(EnvType.CLIENT) -@Mixin(HoneyBlock.class) -public abstract class HoneyBlockMixin extends Block { - public HoneyBlockMixin(Properties settings) { - super(settings); - } - - @Override - public float getSpeedFactor() { - return FuzzSettings.honeyBlockSlowDownDisabled ? Blocks.TNT.getSpeedFactor() : super.getSpeedFactor(); - } - - @Override - public float getJumpFactor() { - return FuzzSettings.honeyBlockSlowDownDisabled ? Blocks.TNT.getJumpFactor() : super.getJumpFactor(); - } -} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java index 78179f3..6210def 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java @@ -49,7 +49,7 @@ public abstract class LivingEntityMixin { ) private float iceSlipperinessDisabled(Block block, Operation original) { LivingEntity entity = (LivingEntity) (Object) this; - if (FuzzSettings.iceSlipperinessDisabled && entity.equals(ClientUtil.getCurrentPlayer()) && IceFamily.isIce(block)) { + if (FuzzSettings.iceSlipperinessDisabled && ClientUtil.isSelf(entity) && IceFamily.isIce(block)) { return Blocks.TNT.getFriction(); } else { return original.call(block); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java index 7f35912..99352f2 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java @@ -45,7 +45,7 @@ public abstract class LivingEntityMixin { private void removeJumpDelay1(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (entity.equals(ClientUtil.getCurrentPlayer())) { + if (ClientUtil.isSelf(entity)) { this.noJumpDelay = 0; } } @@ -55,7 +55,7 @@ private void removeJumpDelay1(CallbackInfo ci) { private void removeJumpDelay2(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (entity.equals(ClientUtil.getCurrentPlayer())) { + if (ClientUtil.isSelf(entity)) { this.noJumpDelay = 0; } } @@ -65,7 +65,7 @@ private void removeJumpDelay2(CallbackInfo ci) { private void removeJumpDelay3(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (entity.equals(ClientUtil.getCurrentPlayer())) { + if (ClientUtil.isSelf(entity)) { this.noJumpDelay = 0; } } @@ -75,7 +75,7 @@ private void removeJumpDelay3(CallbackInfo ci) { private void removeJumpDelay4(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (entity.equals(ClientUtil.getCurrentPlayer())) { + if (ClientUtil.isSelf(entity)) { this.noJumpDelay = 0; } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java index a44e36a..6f793eb 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java @@ -42,7 +42,7 @@ public abstract class EntityMixin { @ModifyReturnValue(method = "isInWater", at = @At("RETURN")) private boolean isInWater(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -52,7 +52,7 @@ private boolean isInWater(boolean original) { @ModifyReturnValue(method = "isInShallowWater", at = @At("RETURN")) private boolean isInShallowWater(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -62,7 +62,7 @@ private boolean isInShallowWater(boolean original) { @ModifyReturnValue(method = "isInLava", at = @At("RETURN")) private boolean isInLava(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -72,7 +72,7 @@ private boolean isInLava(boolean original) { @ModifyReturnValue(method = "updateFluidInteraction", at = @At("RETURN")) private boolean noUpdate(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -87,7 +87,7 @@ private boolean noUpdate(boolean original) { ) ) private boolean noPush(Entity entity, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { return false; } else { return original.call(entity); @@ -102,13 +102,13 @@ private boolean noPush(Entity entity, Operation original) { ) ) private boolean setSwimming(Entity entity, int index, boolean value) { - return !FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()); + return !FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity); } @ModifyReturnValue(method = "getFluidHeight", at = @At("RETURN")) private double getFluidHeight(double original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity)) { return 0.114514D; } else { return original; diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java index bc3abda..3cd83b3 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java @@ -46,7 +46,7 @@ public abstract class LivingEntityMixin { ) ) private boolean travel(LivingEntity entity, FluidState fluidState, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && entity.equals(ClientUtil.getCurrentPlayer()) && entity.isInLava()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && entity.isInLava()) { return false; } else { return original.call(entity,fluidState); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java index aaf1e99..4e1599f 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java @@ -49,7 +49,7 @@ public abstract class LocalPlayerMixin { @WrapMethod(method = "updateIsUnderwater") private boolean preventSwimmingWhileSprinting(Operation original) { LocalPlayer player = (LocalPlayer) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && player.equals(ClientUtil.getCurrentPlayer()) && !player.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(player) && !player.isOnFire()) { return false; } else { return original.call(); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java index 0aa8cf0..535fec4 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java @@ -45,7 +45,7 @@ public abstract class PlayerMixin { ) ) private boolean checkFallFlying(Player player, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && player.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(player)) { return false; } else { return original.call(player); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/renderHandDisabled/GameRendererMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/renderHandDisabled/GameRendererMixin.java index 9361271..6eac7cd 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/renderHandDisabled/GameRendererMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/renderHandDisabled/GameRendererMixin.java @@ -34,7 +34,7 @@ @Environment(EnvType.CLIENT) @Mixin(GameRenderer.class) -public class GameRendererMixin { +public abstract class GameRendererMixin { @Inject(method = "renderItemInHand", at = @At("HEAD"), cancellable = true) private void renderHandDisabled(CallbackInfo ci) { if (FuzzSettings.renderHandDisabled) { diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java similarity index 55% rename from versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java rename to src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java index cc7986b..67fd8b5 100644 --- a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java @@ -18,40 +18,45 @@ * along with Fuzz. If not, see . */ -package top.byteeeee.fuzz.mixin.rule.slimeBlockBounceDisabled; +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.world.level.block.Block; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import top.byteeeee.fuzz.FuzzSettings; import top.byteeeee.fuzz.utils.ClientUtil; +import top.byteeeee.fuzz.utils.EntityUtil; @Environment(EnvType.CLIENT) -@Mixin(LivingEntity.class) -public abstract class LivingEntityMixin { - @WrapOperation( - method = "travelInAir", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/world/level/block/Block;getFriction()F" - ) - ) - private float slimeSlipperinessDisabled(Block block, Operation original) { - LivingEntity entity = (LivingEntity) (Object) this; - if (FuzzSettings.slimeBlockSlowDownDisabled && entity.equals(ClientUtil.getCurrentPlayer()) && block.equals(Blocks.SLIME_BLOCK)) { - return Blocks.TNT.getFriction(); +@Mixin(Entity.class) +public abstract class EntityMixin { + @ModifyReturnValue(method = {"getBlockSpeedFactor", "getBlockJumpFactor"}, at = @At("RETURN")) + private float modifySpeedFactorValue(float original) { + if (!FuzzSettings.slimeBlockSlowDownDisabled) { + return original; + } + + Entity entity = (Entity) (Object) this; + + if (!ClientUtil.isSelf(entity)) { + return original; + } + + BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); + + if (blockState.is(Blocks.SLIME_BLOCK)) { + return 1.0F; } else { - return original.call(block); + return original; } } -} \ No newline at end of file +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java similarity index 84% rename from src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java rename to src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java index 7b5efbe..ee6b8d6 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java @@ -18,7 +18,7 @@ * along with Fuzz. If not, see . */ -package top.byteeeee.fuzz.mixin.rule.slimeBlockBounceDisabled; +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; @@ -28,17 +28,15 @@ import org.spongepowered.asm.mixin.Mixin; -import top.byteeeee.annotationtoolbox.annotation.GameVersion; import top.byteeeee.fuzz.FuzzSettings; import top.byteeeee.fuzz.helpers.Noop; import top.byteeeee.fuzz.utils.ClientUtil; -@GameVersion(version = "Minecraft < 26.2") @Mixin(SlimeBlock.class) public abstract class SlimeBlockMixin { @WrapMethod(method = "bounceUp") private void slimeBlockBounceDisabled(Entity entity, Operation original) { - if (FuzzSettings.slimeBlockSlowDownDisabled && entity.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isSelf(entity)) { Noop.noop(); } else { original.call(entity); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java similarity index 54% rename from src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java rename to src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java index cd0f0db..ddc72d4 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java @@ -20,25 +20,42 @@ package top.byteeeee.fuzz.mixin.rule.soulSandBlockSlowDownDisabled; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.world.level.block.Block; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.SoulSandBlock; +import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.utils.ClientUtil; +import top.byteeeee.fuzz.utils.EntityUtil; @Environment(EnvType.CLIENT) -@Mixin(SoulSandBlock.class) -public abstract class SoulSandBlockMixin extends Block { - public SoulSandBlockMixin(Properties settings) { - super(settings); - } +@Mixin(Entity.class) +public abstract class EntityMixin { + @ModifyReturnValue(method = "getBlockSpeedFactor", at = @At("RETURN")) + private float modifySpeedFactorValue(float original) { + if (!FuzzSettings.soulSandBlockSlowDownDisabled) { + return original; + } + + Entity entity = (Entity) (Object) this; + + if (!ClientUtil.isSelf(entity)) { + return original; + } + + BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); - @Override - public float getSpeedFactor() { - return FuzzSettings.soulSandBlockSlowDownDisabled ? Blocks.TNT.getSpeedFactor() : super.getSpeedFactor(); + if (blockState.is(Blocks.SOUL_SAND)) { + return 1.0F; + } else { + return original; + } } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java index b8d09ca..f2e4a33 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java @@ -71,7 +71,7 @@ private boolean shouldStopSprinting(boolean original) { ) ) private boolean noApplySlowDown(LocalPlayer player, Operation original) { - if (FuzzSettings.usingItemSlowDownDisabled && player.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.usingItemSlowDownDisabled && ClientUtil.isSelf(player)) { return false; } else { return original.call(player); diff --git a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java index 1e4a5de..818a7a6 100644 --- a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java +++ b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java @@ -26,6 +26,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; +import net.minecraft.world.entity.Entity; import top.byteeeee.fuzz.FuzzModClient; @Environment(EnvType.CLIENT) @@ -34,6 +35,14 @@ public static LocalPlayer getCurrentPlayer() { return FuzzModClient.minecraftClient.player; } + public static boolean isSelf(Entity entity) { + if (getCurrentPlayer() != null) { + return entity.getId() == getCurrentPlayer().getId(); + } else { + return false; + } + } + public static Minecraft getCurrentClient() { return FuzzModClient.minecraftClient; } diff --git a/src/main/resources/fuzz.mixins.json b/src/main/resources/fuzz.mixins.json index bb107ba..0862306 100644 --- a/src/main/resources/fuzz.mixins.json +++ b/src/main/resources/fuzz.mixins.json @@ -3,7 +3,9 @@ "minVersion": "0.8.5", "package": "top.byteeeee.fuzz.mixin", "compatibilityLevel": "/*JAVA_VERSION*/", - "mixins": [], + "mixins": [ + "rule.slimeBlockSlowDownDisabled.SlimeBlockMixin" + ], "client": [ "hooks.MinecraftMixin", "key.KeyMapping_CategoryMixin", @@ -16,6 +18,7 @@ "rule.chestOptimization.BlockEntityRenderDispatcherMixin", "rule.chestOptimization.ChestBlockMixin", "rule.chestOptimization.EnderChestBlockMixin", + "rule.chestOptimization.PackMixin", "rule.chestOptimization.PackRepositoryMixin", "rule.cobwebSlowDownDisabled.WebBlockMixin", "rule.commandAnimatedFreeze.chestBlockAnimationDisabled.ChestBlockEntityMixin", @@ -25,7 +28,7 @@ "rule.commandHighlightEntites.MinecraftMixin", "rule.fluidPushDisabled.PlayerMixin", "rule.fogColor.FogRendererMixin", - "rule.honeyBlockSlowDownDisabled.HoneyBlockMixin", + "rule.honeyBlockSlowDownDisabled.EntityMixin", "rule.hurtShakeDisabled.GameRendererMixin", "rule.iceSlipperinessDisabled.LivingEntityMixin", "rule.jumpDelayDisabled.LivingEntityMixin", @@ -37,15 +40,13 @@ "rule.pickFluidBucketItemInCreative.MinecraftMixin", "rule.renderHandDisabled.GameRendererMixin", "rule.skyColor.SkyRenderStateMixin", - "rule.slimeBlockBounceDisabled.LivingEntityMixin", - "rule.slimeBlockBounceDisabled.SlimeBlockMixin", + "rule.slimeBlockSlowDownDisabled.EntityMixin", "rule.sneakingSlowDownDisabled.LocalPlayerMixin", - "rule.soulSandBlockSlowDownDisabled.SoulSandBlockMixin", + "rule.soulSandBlockSlowDownDisabled.EntityMixin", "rule.usingItemSlowDownDisabled.LocalPlayerMixin", "rule.waterColor.WaterRendererMixin", "rule.waterFogColor.FogRendererMixin", - "translations.TranslatableTextMixin", - "rule.chestOptimization.PackMixin" + "translations.TranslatableTextMixin" ], "injectors": { "defaultRequire": 1 diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererAccessor.java b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererAccessor.java index 7dfcad1..a3b4e44 100644 --- a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererAccessor.java +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererAccessor.java @@ -23,11 +23,8 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.renderer.LevelRenderer; -import net.minecraft.client.multiplayer.ClientLevel; - import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; + import top.byteeeee.annotationtoolbox.annotation.GameVersion; import top.byteeeee.fuzz.utils.compat.DummyInterface; diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java similarity index 91% rename from versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java rename to versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java index e27a4b5..efe3f96 100644 --- a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java @@ -18,7 +18,7 @@ * along with Fuzz. If not, see . */ -package top.byteeeee.fuzz.mixin.rule.slimeBlockBounceDisabled; +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; @@ -39,7 +39,7 @@ public abstract class SlimeBlockMixin { @WrapMethod(method = "fallOn") private void slimeBlockBounceDisabled(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance, Operation original) { - if (FuzzSettings.slimeBlockSlowDownDisabled && entity.equals(ClientUtil.getCurrentPlayer())) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isSelf(entity)) { Noop.noop(); } else { original.call(level, state, pos, entity, fallDistance); From 5c03efdf3c4f6496a2e3b5e80d51babb01e62950 Mon Sep 17 00:00:00 2001 From: 1024_byteeeee <2270484921@qq.com> Date: Wed, 15 Jul 2026 18:51:09 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=88=E6=8E=A8=E9=80=81=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run/options.txt | 2 +- .../fuzz/mixin/hooks/LocalPlayerMixin.java | 33 ++++++++ .../BlockMixin.java | 62 ++++++++++++++ .../EntityMixin.java | 62 -------------- .../EntityMixin.java | 62 -------------- .../SlimeBlockMixin.java | 52 +++++------- .../BlockMixin.java | 82 +++++++++++++++++++ .../EntityMixin.java | 61 -------------- .../top/byteeeee/fuzz/utils/ClientUtil.java | 4 +- src/main/resources/fuzz.mixins.json | 8 +- .../SlimeBlockMixin.java | 48 ----------- 11 files changed, 206 insertions(+), 270 deletions(-) create mode 100644 src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java create mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java delete mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java delete mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java create mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java delete mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java delete mode 100644 versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java diff --git a/run/options.txt b/run/options.txt index 793e981..51d9c49 100644 --- a/run/options.txt +++ b/run/options.txt @@ -31,7 +31,7 @@ particles:0 reducedDebugInfo:false renderClouds:"false" cloudRange:128 -renderDistance:32 +renderDistance:2 simulationDistance:5 screenEffectScale:1.0 soundDevice:"" diff --git a/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java new file mode 100644 index 0000000..73342a7 --- /dev/null +++ b/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java @@ -0,0 +1,33 @@ +package top.byteeeee.fuzz.mixin.hooks; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.client.player.LocalPlayer; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import top.byteeeee.fuzz.utils.ClientUtil; + +@Environment(EnvType.CLIENT) +@Mixin(LocalPlayer.class) +public abstract class LocalPlayerMixin { + @Inject(method = "tick", at = @At("HEAD")) + private void onTickStart(CallbackInfo ci) { + LocalPlayer player = (LocalPlayer) (Object) this; + if (ClientUtil.isSelf(player)) { + ClientUtil.IS_LOCAL_PLAYER_TICKING.set(true); + } + } + + @Inject(method = "tick", at = @At("RETURN")) + private void onTickEnd(CallbackInfo ci) { + LocalPlayer player = (LocalPlayer) (Object) this; + if (ClientUtil.isSelf(player)) { + ClientUtil.IS_LOCAL_PLAYER_TICKING.remove(); + } + } +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java new file mode 100644 index 0000000..e62b2d9 --- /dev/null +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java @@ -0,0 +1,62 @@ +package top.byteeeee.fuzz.mixin.rule.honeyBlockSlowDownDisabled; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.HoneyBlock; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.utils.ClientUtil; + +@Environment(EnvType.CLIENT) +@Mixin(Block.class) +public abstract class BlockMixin { + @ModifyReturnValue(method = "getFriction", at = @At("RETURN")) + private float modifyFriction(float original){ + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.honeyBlockSlowDownDisabled && block instanceof HoneyBlock) { + return Blocks.TNT.getFriction(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getSpeedFactor", at = @At("RETURN")) + private float modifySpeedFactor(float original) { + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.honeyBlockSlowDownDisabled && block instanceof HoneyBlock) { + return Blocks.TNT.getSpeedFactor(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getJumpFactor", at = @At("RETURN")) + private float modifyJumpFactor(float original) { + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.honeyBlockSlowDownDisabled && block instanceof HoneyBlock) { + return Blocks.TNT.getJumpFactor(); + } else { + return original; + } + } +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java deleted file mode 100644 index 0649e98..0000000 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/EntityMixin.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - -package top.byteeeee.fuzz.mixin.rule.honeyBlockSlowDownDisabled; - -import com.llamalad7.mixinextras.injector.ModifyReturnValue; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; - -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -import top.byteeeee.fuzz.FuzzSettings; -import top.byteeeee.fuzz.utils.ClientUtil; -import top.byteeeee.fuzz.utils.EntityUtil; - -@Environment(EnvType.CLIENT) -@Mixin(Entity.class) -public abstract class EntityMixin { - @ModifyReturnValue(method = {"getBlockSpeedFactor", "getBlockJumpFactor"}, at = @At("RETURN")) - private float modifySpeedFactorValue(float original) { - if (!FuzzSettings.honeyBlockSlowDownDisabled) { - return original; - } - - Entity entity = (Entity) (Object) this; - - if (!ClientUtil.isSelf(entity)) { - return original; - } - - BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); - - if (blockState.is(Blocks.HONEY_BLOCK)) { - return 1.0F; - } else { - return original; - } - } -} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java deleted file mode 100644 index 67fd8b5..0000000 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - -package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; - -import com.llamalad7.mixinextras.injector.ModifyReturnValue; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; - -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -import top.byteeeee.fuzz.FuzzSettings; -import top.byteeeee.fuzz.utils.ClientUtil; -import top.byteeeee.fuzz.utils.EntityUtil; - -@Environment(EnvType.CLIENT) -@Mixin(Entity.class) -public abstract class EntityMixin { - @ModifyReturnValue(method = {"getBlockSpeedFactor", "getBlockJumpFactor"}, at = @At("RETURN")) - private float modifySpeedFactorValue(float original) { - if (!FuzzSettings.slimeBlockSlowDownDisabled) { - return original; - } - - Entity entity = (Entity) (Object) this; - - if (!ClientUtil.isSelf(entity)) { - return original; - } - - BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); - - if (blockState.is(Blocks.SLIME_BLOCK)) { - return 1.0F; - } else { - return original; - } - } -} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java index ee6b8d6..c2de0a7 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java @@ -1,45 +1,35 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; -import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; -import net.minecraft.world.level.block.SlimeBlock; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.client.player.LocalPlayer; +import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SlimeBlock; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import top.byteeeee.fuzz.FuzzSettings; -import top.byteeeee.fuzz.helpers.Noop; import top.byteeeee.fuzz.utils.ClientUtil; @Mixin(SlimeBlock.class) public abstract class SlimeBlockMixin { - @WrapMethod(method = "bounceUp") - private void slimeBlockBounceDisabled(Entity entity, Operation original) { - if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isSelf(entity)) { - Noop.noop(); - } else { - original.call(entity); - } + @Inject(method = "", at = @At("TAIL")) + private void aVoid(BlockBehaviour.Properties properties, CallbackInfo ci) { + properties.jumpFactor(Blocks.TNT.getJumpFactor()); + properties.speedFactor(Blocks.TNT.getSpeedFactor()); + properties.friction(Blocks.TNT.getFriction()); } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java new file mode 100644 index 0000000..dfd8f2b --- /dev/null +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java @@ -0,0 +1,82 @@ +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ + +package top.byteeeee.fuzz.mixin.rule.soulSandBlockSlowDownDisabled; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SoulSandBlock; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.utils.ClientUtil; + +@Environment(EnvType.CLIENT) +@Mixin(Block.class) +public abstract class BlockMixin { + @ModifyReturnValue(method = "getFriction", at = @At("RETURN")) + private float modifyFriction(float original){ + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.soulSandBlockSlowDownDisabled && block instanceof SoulSandBlock) { + return Blocks.TNT.getFriction(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getSpeedFactor", at = @At("RETURN")) + private float modifySpeedFactor(float original) { + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.soulSandBlockSlowDownDisabled && block instanceof SoulSandBlock) { + return Blocks.TNT.getSpeedFactor(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getJumpFactor", at = @At("RETURN")) + private float modifyJumpFactor(float original) { + if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.soulSandBlockSlowDownDisabled && block instanceof SoulSandBlock) { + return Blocks.TNT.getJumpFactor(); + } else { + return original; + } + } +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java deleted file mode 100644 index ddc72d4..0000000 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/EntityMixin.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - -package top.byteeeee.fuzz.mixin.rule.soulSandBlockSlowDownDisabled; - -import com.llamalad7.mixinextras.injector.ModifyReturnValue; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -import top.byteeeee.fuzz.FuzzSettings; -import top.byteeeee.fuzz.utils.ClientUtil; -import top.byteeeee.fuzz.utils.EntityUtil; - -@Environment(EnvType.CLIENT) -@Mixin(Entity.class) -public abstract class EntityMixin { - @ModifyReturnValue(method = "getBlockSpeedFactor", at = @At("RETURN")) - private float modifySpeedFactorValue(float original) { - if (!FuzzSettings.soulSandBlockSlowDownDisabled) { - return original; - } - - Entity entity = (Entity) (Object) this; - - if (!ClientUtil.isSelf(entity)) { - return original; - } - - BlockState blockState = EntityUtil.getEntityWorld(entity).getBlockState(entity.getOnPos()); - - if (blockState.is(Blocks.SOUL_SAND)) { - return 1.0F; - } else { - return original; - } - } -} diff --git a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java index 818a7a6..ec0778a 100644 --- a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java +++ b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java @@ -31,13 +31,15 @@ @Environment(EnvType.CLIENT) public class ClientUtil { + public static final ThreadLocal IS_LOCAL_PLAYER_TICKING = ThreadLocal.withInitial(() -> false); + public static LocalPlayer getCurrentPlayer() { return FuzzModClient.minecraftClient.player; } public static boolean isSelf(Entity entity) { if (getCurrentPlayer() != null) { - return entity.getId() == getCurrentPlayer().getId(); + return entity.is(getCurrentPlayer()); } else { return false; } diff --git a/src/main/resources/fuzz.mixins.json b/src/main/resources/fuzz.mixins.json index 0862306..f7fb524 100644 --- a/src/main/resources/fuzz.mixins.json +++ b/src/main/resources/fuzz.mixins.json @@ -4,9 +4,9 @@ "package": "top.byteeeee.fuzz.mixin", "compatibilityLevel": "/*JAVA_VERSION*/", "mixins": [ - "rule.slimeBlockSlowDownDisabled.SlimeBlockMixin" ], "client": [ + "hooks.LocalPlayerMixin", "hooks.MinecraftMixin", "key.KeyMapping_CategoryMixin", "rule.bedRockFlying.LocalPlayerInvoker", @@ -28,7 +28,7 @@ "rule.commandHighlightEntites.MinecraftMixin", "rule.fluidPushDisabled.PlayerMixin", "rule.fogColor.FogRendererMixin", - "rule.honeyBlockSlowDownDisabled.EntityMixin", + "rule.honeyBlockSlowDownDisabled.BlockMixin", "rule.hurtShakeDisabled.GameRendererMixin", "rule.iceSlipperinessDisabled.LivingEntityMixin", "rule.jumpDelayDisabled.LivingEntityMixin", @@ -40,9 +40,9 @@ "rule.pickFluidBucketItemInCreative.MinecraftMixin", "rule.renderHandDisabled.GameRendererMixin", "rule.skyColor.SkyRenderStateMixin", - "rule.slimeBlockSlowDownDisabled.EntityMixin", + "rule.slimeBlockSlowDownDisabled.SlimeBlockMixin", "rule.sneakingSlowDownDisabled.LocalPlayerMixin", - "rule.soulSandBlockSlowDownDisabled.EntityMixin", + "rule.soulSandBlockSlowDownDisabled.BlockMixin", "rule.usingItemSlowDownDisabled.LocalPlayerMixin", "rule.waterColor.WaterRendererMixin", "rule.waterFogColor.FogRendererMixin", diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java deleted file mode 100644 index efe3f96..0000000 --- a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the Fuzz project, licensed under the - * GNU Lesser General Public License v3.0 - * - * Copyright (C) 2025 1024_byteeeee and contributors - * - * Fuzz is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Fuzz is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Fuzz. If not, see . - */ - -package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; - -import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.SlimeBlock; -import net.minecraft.world.entity.Entity; - -import net.minecraft.world.level.block.state.BlockState; -import org.spongepowered.asm.mixin.Mixin; - -import top.byteeeee.fuzz.FuzzSettings; -import top.byteeeee.fuzz.helpers.Noop; -import top.byteeeee.fuzz.utils.ClientUtil; - -@Mixin(SlimeBlock.class) -public abstract class SlimeBlockMixin { - @WrapMethod(method = "fallOn") - private void slimeBlockBounceDisabled(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance, Operation original) { - if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isSelf(entity)) { - Noop.noop(); - } else { - original.call(level, state, pos, entity, fallDistance); - } - } -} From 3c377b191502d6563bf437e361219c5d25172cdc Mon Sep 17 00:00:00 2001 From: 1024-byteeeee <2270484921@qq.com> Date: Thu, 16 Jul 2026 00:41:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fuzz/mixin/hooks/LocalPlayerMixin.java | 28 ++++++- .../BubbleColumnBlockMixin.java | 2 +- .../cobwebSlowDownDisabled/WebBlockMixin.java | 2 +- .../rule/fluidPushDisabled/PlayerMixin.java | 2 +- .../BlockMixin.java | 26 +++++- .../LivingEntityMixin.java | 2 +- .../jumpDelayDisabled/LivingEntityMixin.java | 8 +- .../letFluidInteractLikeAir/EntityMixin.java | 14 ++-- .../LivingEntityMixin.java | 2 +- .../LocalPlayerMixin.java | 2 +- .../letFluidInteractLikeAir/PlayerMixin.java | 2 +- .../BlockMixin.java | 82 +++++++++++++++++++ .../EntityMixin.java | 32 ++++++++ .../SlimeBlockMixin.java | 63 ++++++++++---- .../BlockMixin.java | 6 +- .../LocalPlayerMixin.java | 2 +- .../top/byteeeee/fuzz/utils/ClientUtil.java | 18 +++- src/main/resources/fuzz.mixins.json | 2 + 18 files changed, 246 insertions(+), 49 deletions(-) create mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/BlockMixin.java create mode 100644 src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java diff --git a/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java index 73342a7..7915026 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/hooks/LocalPlayerMixin.java @@ -1,3 +1,23 @@ +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ + package top.byteeeee.fuzz.mixin.hooks; import net.fabricmc.api.EnvType; @@ -18,16 +38,16 @@ public abstract class LocalPlayerMixin { @Inject(method = "tick", at = @At("HEAD")) private void onTickStart(CallbackInfo ci) { LocalPlayer player = (LocalPlayer) (Object) this; - if (ClientUtil.isSelf(player)) { - ClientUtil.IS_LOCAL_PLAYER_TICKING.set(true); + if (ClientUtil.isLocalPlayerSelf(player)) { + ClientUtil.setLocalPlayerTicking(true); } } @Inject(method = "tick", at = @At("RETURN")) private void onTickEnd(CallbackInfo ci) { LocalPlayer player = (LocalPlayer) (Object) this; - if (ClientUtil.isSelf(player)) { - ClientUtil.IS_LOCAL_PLAYER_TICKING.remove(); + if (ClientUtil.isLocalPlayerSelf(player)) { + ClientUtil.removeLocalPlayerTicking(); } } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java index a5d62b1..89d5ee6 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/bubbleColumnInteractDisabled/BubbleColumnBlockMixin.java @@ -44,7 +44,7 @@ public abstract class BubbleColumnBlockMixin { @WrapMethod(method = "entityInside") private void onEntityCollision(BlockState state, Level world, BlockPos pos, Entity entity, InsideBlockEffectApplier handler, boolean bl, Operation original) { - if (FuzzSettings.bubbleColumnInteractDisabled && ClientUtil.isSelf(entity)) { + if (FuzzSettings.bubbleColumnInteractDisabled && ClientUtil.isLocalPlayerSelf(entity)) { Noop.noop(); } else { original.call(state, world, pos, entity,handler,bl); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java index f2e4bfa..7abcc3d 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/cobwebSlowDownDisabled/WebBlockMixin.java @@ -44,7 +44,7 @@ public abstract class WebBlockMixin { ) ) private void slowDownDisabled(Entity entity, BlockState blockState, Vec3 speedMultiplier, Operation original) { - if (FuzzSettings.cobwebSlowDownDisabled && ClientUtil.isSelf(entity)) { + if (FuzzSettings.cobwebSlowDownDisabled && ClientUtil.isLocalPlayerSelf(entity)) { Noop.noop(); } else { original.call(entity, blockState, speedMultiplier); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java index ce71773..a5bf16b 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/fluidPushDisabled/PlayerMixin.java @@ -40,6 +40,6 @@ public abstract class PlayerMixin { @ModifyReturnValue(method = "isPushedByFluid", at = @At("RETURN")) public boolean isPushedByFluids(boolean original) { Player player = (Player) (Object) this; - return FuzzSettings.fluidPushDisabled && ClientUtil.isSelf(player) ? false : original; + return FuzzSettings.fluidPushDisabled && ClientUtil.isLocalPlayerSelf(player) ? false : original; } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java index e62b2d9..beb0094 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/BlockMixin.java @@ -1,3 +1,23 @@ +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ + package top.byteeeee.fuzz.mixin.rule.honeyBlockSlowDownDisabled; import com.llamalad7.mixinextras.injector.ModifyReturnValue; @@ -20,7 +40,7 @@ public abstract class BlockMixin { @ModifyReturnValue(method = "getFriction", at = @At("RETURN")) private float modifyFriction(float original){ - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } @@ -34,7 +54,7 @@ private float modifyFriction(float original){ @ModifyReturnValue(method = "getSpeedFactor", at = @At("RETURN")) private float modifySpeedFactor(float original) { - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } @@ -48,7 +68,7 @@ private float modifySpeedFactor(float original) { @ModifyReturnValue(method = "getJumpFactor", at = @At("RETURN")) private float modifyJumpFactor(float original) { - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java index 6210def..9287608 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/iceSlipperinessDisabled/LivingEntityMixin.java @@ -49,7 +49,7 @@ public abstract class LivingEntityMixin { ) private float iceSlipperinessDisabled(Block block, Operation original) { LivingEntity entity = (LivingEntity) (Object) this; - if (FuzzSettings.iceSlipperinessDisabled && ClientUtil.isSelf(entity) && IceFamily.isIce(block)) { + if (FuzzSettings.iceSlipperinessDisabled && ClientUtil.isLocalPlayerSelf(entity) && IceFamily.isIce(block)) { return Blocks.TNT.getFriction(); } else { return original.call(block); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java index 99352f2..eed144a 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/jumpDelayDisabled/LivingEntityMixin.java @@ -45,7 +45,7 @@ public abstract class LivingEntityMixin { private void removeJumpDelay1(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (ClientUtil.isSelf(entity)) { + if (ClientUtil.isLocalPlayerSelf(entity)) { this.noJumpDelay = 0; } } @@ -55,7 +55,7 @@ private void removeJumpDelay1(CallbackInfo ci) { private void removeJumpDelay2(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (ClientUtil.isSelf(entity)) { + if (ClientUtil.isLocalPlayerSelf(entity)) { this.noJumpDelay = 0; } } @@ -65,7 +65,7 @@ private void removeJumpDelay2(CallbackInfo ci) { private void removeJumpDelay3(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (ClientUtil.isSelf(entity)) { + if (ClientUtil.isLocalPlayerSelf(entity)) { this.noJumpDelay = 0; } } @@ -75,7 +75,7 @@ private void removeJumpDelay3(CallbackInfo ci) { private void removeJumpDelay4(CallbackInfo ci) { if (FuzzSettings.jumpDelayDisabled) { LivingEntity entity = (LivingEntity) (Object) this; - if (ClientUtil.isSelf(entity)) { + if (ClientUtil.isLocalPlayerSelf(entity)) { this.noJumpDelay = 0; } } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java index 6f793eb..a6ad801 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/EntityMixin.java @@ -42,7 +42,7 @@ public abstract class EntityMixin { @ModifyReturnValue(method = "isInWater", at = @At("RETURN")) private boolean isInWater(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -52,7 +52,7 @@ private boolean isInWater(boolean original) { @ModifyReturnValue(method = "isInShallowWater", at = @At("RETURN")) private boolean isInShallowWater(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -62,7 +62,7 @@ private boolean isInShallowWater(boolean original) { @ModifyReturnValue(method = "isInLava", at = @At("RETURN")) private boolean isInLava(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -72,7 +72,7 @@ private boolean isInLava(boolean original) { @ModifyReturnValue(method = "updateFluidInteraction", at = @At("RETURN")) private boolean noUpdate(boolean original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && !entity.isOnFire()) { return false; } else { return original; @@ -87,7 +87,7 @@ private boolean noUpdate(boolean original) { ) ) private boolean noPush(Entity entity, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && !entity.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && !entity.isOnFire()) { return false; } else { return original.call(entity); @@ -102,13 +102,13 @@ private boolean noPush(Entity entity, Operation original) { ) ) private boolean setSwimming(Entity entity, int index, boolean value) { - return !FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity); + return !FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity); } @ModifyReturnValue(method = "getFluidHeight", at = @At("RETURN")) private double getFluidHeight(double original) { Entity entity = (Entity) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity)) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity)) { return 0.114514D; } else { return original; diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java index 3cd83b3..e25f700 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LivingEntityMixin.java @@ -46,7 +46,7 @@ public abstract class LivingEntityMixin { ) ) private boolean travel(LivingEntity entity, FluidState fluidState, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(entity) && entity.isInLava()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(entity) && entity.isInLava()) { return false; } else { return original.call(entity,fluidState); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java index 4e1599f..df9a26c 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/LocalPlayerMixin.java @@ -49,7 +49,7 @@ public abstract class LocalPlayerMixin { @WrapMethod(method = "updateIsUnderwater") private boolean preventSwimmingWhileSprinting(Operation original) { LocalPlayer player = (LocalPlayer) (Object) this; - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(player) && !player.isOnFire()) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(player) && !player.isOnFire()) { return false; } else { return original.call(); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java index 535fec4..f2b5e6d 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/letFluidInteractLikeAir/PlayerMixin.java @@ -45,7 +45,7 @@ public abstract class PlayerMixin { ) ) private boolean checkFallFlying(Player player, Operation original) { - if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isSelf(player)) { + if (FuzzSettings.letFluidInteractLikeAir && ClientUtil.isLocalPlayerSelf(player)) { return false; } else { return original.call(player); diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/BlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/BlockMixin.java new file mode 100644 index 0000000..a4074c9 --- /dev/null +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/BlockMixin.java @@ -0,0 +1,82 @@ +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ + +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SlimeBlock; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.utils.ClientUtil; + +@Environment(EnvType.CLIENT) +@Mixin(Block.class) +public abstract class BlockMixin { + @ModifyReturnValue(method = "getFriction", at = @At("RETURN")) + private float modifyFriction(float original){ + if (!ClientUtil.isLocalPlayerTicking()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.slimeBlockSlowDownDisabled && block instanceof SlimeBlock) { + return Blocks.TNT.getFriction(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getSpeedFactor", at = @At("RETURN")) + private float modifySpeedFactor(float original) { + if (!ClientUtil.isLocalPlayerTicking()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.slimeBlockSlowDownDisabled && block instanceof SlimeBlock) { + return Blocks.TNT.getSpeedFactor(); + } else { + return original; + } + } + + @ModifyReturnValue(method = "getJumpFactor", at = @At("RETURN")) + private float modifyJumpFactor(float original) { + if (!ClientUtil.isLocalPlayerTicking()) { + return original; + } + + Block block = (Block) (Object) this; + if (FuzzSettings.slimeBlockSlowDownDisabled && block instanceof SlimeBlock) { + return Blocks.TNT.getJumpFactor(); + } else { + return original; + } + } +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java new file mode 100644 index 0000000..2dfe069 --- /dev/null +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java @@ -0,0 +1,32 @@ +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.Blocks; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.utils.ClientUtil; +import top.byteeeee.fuzz.utils.EntityUtil; + +@Environment(EnvType.CLIENT) +@Mixin(Entity.class) +public abstract class EntityMixin { + @ModifyReturnValue(method = "isSuppressingBounce", at = @At("RETURN")) + private boolean skipSlimeBounceLogic(boolean original) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { + Entity entity = (Entity) (Object) this; + BlockPos belowPos = entity.getBlockPosBelowThatAffectsMyMovement(); + return EntityUtil.getEntityWorld(entity).getBlockState(belowPos).is(Blocks.SLIME_BLOCK); + } else { + return original; + } + } +} diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java index c2de0a7..38465b5 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java @@ -1,35 +1,64 @@ -package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ -import com.llamalad7.mixinextras.injector.ModifyReturnValue; +package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.player.LocalPlayer; -import net.minecraft.core.BlockPos; +//#if MC<260200 import net.minecraft.world.entity.Entity; import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; - +//#endif +import net.minecraft.world.level.block.HalfTransparentBlock; import net.minecraft.world.level.block.SlimeBlock; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.block.state.BlockState; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; - import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + import top.byteeeee.fuzz.FuzzSettings; import top.byteeeee.fuzz.utils.ClientUtil; +@Environment(EnvType.CLIENT) @Mixin(SlimeBlock.class) -public abstract class SlimeBlockMixin { - @Inject(method = "", at = @At("TAIL")) - private void aVoid(BlockBehaviour.Properties properties, CallbackInfo ci) { - properties.jumpFactor(Blocks.TNT.getJumpFactor()); - properties.speedFactor(Blocks.TNT.getSpeedFactor()); - properties.friction(Blocks.TNT.getFriction()); +public abstract class SlimeBlockMixin extends HalfTransparentBlock { + public SlimeBlockMixin(Properties properties) { + super(properties); + } + + @Inject(method = "stepOn", at = @At("HEAD"), cancellable = true) + private void tt(CallbackInfo ci) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { + ci.cancel(); + } + } + + //#if MC<260200 + @Inject(method = "updateEntityMovementAfterFallOn", at = @At("HEAD"), cancellable = true) + private void skipSlimeBounceLogic(BlockGetter level, Entity entity, CallbackInfo ci) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { + super.updateEntityMovementAfterFallOn(level, entity); + ci.cancel(); + } } + //#endif } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java index dfd8f2b..1429942 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/BlockMixin.java @@ -40,7 +40,7 @@ public abstract class BlockMixin { @ModifyReturnValue(method = "getFriction", at = @At("RETURN")) private float modifyFriction(float original){ - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } @@ -54,7 +54,7 @@ private float modifyFriction(float original){ @ModifyReturnValue(method = "getSpeedFactor", at = @At("RETURN")) private float modifySpeedFactor(float original) { - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } @@ -68,7 +68,7 @@ private float modifySpeedFactor(float original) { @ModifyReturnValue(method = "getJumpFactor", at = @At("RETURN")) private float modifyJumpFactor(float original) { - if (!ClientUtil.IS_LOCAL_PLAYER_TICKING.get()) { + if (!ClientUtil.isLocalPlayerTicking()) { return original; } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java index f2e4a33..e7bf6cf 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/usingItemSlowDownDisabled/LocalPlayerMixin.java @@ -71,7 +71,7 @@ private boolean shouldStopSprinting(boolean original) { ) ) private boolean noApplySlowDown(LocalPlayer player, Operation original) { - if (FuzzSettings.usingItemSlowDownDisabled && ClientUtil.isSelf(player)) { + if (FuzzSettings.usingItemSlowDownDisabled && ClientUtil.isLocalPlayerSelf(player)) { return false; } else { return original.call(player); diff --git a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java index ec0778a..008f95d 100644 --- a/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java +++ b/src/main/java/top/byteeeee/fuzz/utils/ClientUtil.java @@ -25,19 +25,19 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; - import net.minecraft.world.entity.Entity; + import top.byteeeee.fuzz.FuzzModClient; @Environment(EnvType.CLIENT) public class ClientUtil { - public static final ThreadLocal IS_LOCAL_PLAYER_TICKING = ThreadLocal.withInitial(() -> false); + private static final ThreadLocal IS_LOCAL_PLAYER_TICKING = ThreadLocal.withInitial(() -> false); public static LocalPlayer getCurrentPlayer() { return FuzzModClient.minecraftClient.player; } - public static boolean isSelf(Entity entity) { + public static boolean isLocalPlayerSelf(Entity entity) { if (getCurrentPlayer() != null) { return entity.is(getCurrentPlayer()); } else { @@ -45,6 +45,18 @@ public static boolean isSelf(Entity entity) { } } + public static boolean isLocalPlayerTicking() { + return IS_LOCAL_PLAYER_TICKING.get(); + } + + public static void setLocalPlayerTicking(boolean isLocalPlayerTicking) { + IS_LOCAL_PLAYER_TICKING.set(isLocalPlayerTicking); + } + + public static void removeLocalPlayerTicking() { + IS_LOCAL_PLAYER_TICKING.remove(); + } + public static Minecraft getCurrentClient() { return FuzzModClient.minecraftClient; } diff --git a/src/main/resources/fuzz.mixins.json b/src/main/resources/fuzz.mixins.json index f7fb524..828011f 100644 --- a/src/main/resources/fuzz.mixins.json +++ b/src/main/resources/fuzz.mixins.json @@ -4,6 +4,8 @@ "package": "top.byteeeee.fuzz.mixin", "compatibilityLevel": "/*JAVA_VERSION*/", "mixins": [ + "rule.slimeBlockSlowDownDisabled.BlockMixin", + "rule.slimeBlockSlowDownDisabled.EntityMixin" ], "client": [ "hooks.LocalPlayerMixin", From 8bd575d7645888133a04e0949dbaeb06f940bccd Mon Sep 17 00:00:00 2001 From: 1024_byteeeee <2270484921@qq.com> Date: Thu, 16 Jul 2026 15:31:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityMixin.java | 20 ++++++++ .../SlimeBlockMixin.java | 49 ++++++++++++------- src/main/resources/fuzz.mixins.json | 6 +-- 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java index 2dfe069..cc415e0 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/EntityMixin.java @@ -1,3 +1,23 @@ +/* + * This file is part of the Fuzz project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2026 1024_byteeeee and contributors + * + * Fuzz is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Fuzz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Fuzz. If not, see . + */ + package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; import com.llamalad7.mixinextras.injector.ModifyReturnValue; diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java index 38465b5..edf4d91 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockSlowDownDisabled/SlimeBlockMixin.java @@ -20,44 +20,59 @@ package top.byteeeee.fuzz.mixin.rule.slimeBlockSlowDownDisabled; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; + import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -//#if MC<260200 -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.BlockGetter; -//#endif -import net.minecraft.world.level.block.HalfTransparentBlock; import net.minecraft.world.level.block.SlimeBlock; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import top.byteeeee.fuzz.FuzzSettings; import top.byteeeee.fuzz.utils.ClientUtil; @Environment(EnvType.CLIENT) @Mixin(SlimeBlock.class) -public abstract class SlimeBlockMixin extends HalfTransparentBlock { - public SlimeBlockMixin(Properties properties) { - super(properties); +public abstract class SlimeBlockMixin { + @ModifyExpressionValue( + method = "stepOn", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/Entity;isSteppingCarefully()Z" + ) + ) + private boolean skipStepOnLogic(boolean original) { + if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { + return true; + } else { + return original; + } } - @Inject(method = "stepOn", at = @At("HEAD"), cancellable = true) - private void tt(CallbackInfo ci) { + @ModifyExpressionValue( + method = "fallOn", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/Entity;isSuppressingBounce()Z" + ) + ) + private boolean skipFallOnLogic(boolean original) { if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { - ci.cancel(); + return true; + } else { + return original; } } //#if MC<260200 - @Inject(method = "updateEntityMovementAfterFallOn", at = @At("HEAD"), cancellable = true) - private void skipSlimeBounceLogic(BlockGetter level, Entity entity, CallbackInfo ci) { + @ModifyExpressionValue(method = "updateEntityMovementAfterFallOn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;isSuppressingBounce()Z")) + private boolean skipUpdateMovementLogic(boolean original) { if (FuzzSettings.slimeBlockSlowDownDisabled && ClientUtil.isLocalPlayerTicking()) { - super.updateEntityMovementAfterFallOn(level, entity); - ci.cancel(); + return true; + } else { + return original; } } //#endif diff --git a/src/main/resources/fuzz.mixins.json b/src/main/resources/fuzz.mixins.json index 828011f..6de6e65 100644 --- a/src/main/resources/fuzz.mixins.json +++ b/src/main/resources/fuzz.mixins.json @@ -4,8 +4,6 @@ "package": "top.byteeeee.fuzz.mixin", "compatibilityLevel": "/*JAVA_VERSION*/", "mixins": [ - "rule.slimeBlockSlowDownDisabled.BlockMixin", - "rule.slimeBlockSlowDownDisabled.EntityMixin" ], "client": [ "hooks.LocalPlayerMixin", @@ -48,7 +46,9 @@ "rule.usingItemSlowDownDisabled.LocalPlayerMixin", "rule.waterColor.WaterRendererMixin", "rule.waterFogColor.FogRendererMixin", - "translations.TranslatableTextMixin" + "translations.TranslatableTextMixin", + "rule.slimeBlockSlowDownDisabled.BlockMixin", + "rule.slimeBlockSlowDownDisabled.EntityMixin" ], "injectors": { "defaultRequire": 1 From e3cc81a6838c2581fb7dde1ec6be28697a493082 Mon Sep 17 00:00:00 2001 From: 1024_byteeeee <2270484921@qq.com> Date: Thu, 16 Jul 2026 15:31:23 +0800 Subject: [PATCH 5/5] v1.6.12 -> v1.6.13 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b419161..b6ec93c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ loader_version = 0.19.3 # Mod Properties mod_id = fuzz mod_name = Fuzz -mod_version = 1.6.12 +mod_version = 1.6.13 maven_group = top.1024byteeeee archives_base_name = Fuzz