diff --git a/.github/workflows/matrix_includes.json b/.github/workflows/matrix_includes.json index 39c51ce..d0abfe1 100644 --- a/.github/workflows/matrix_includes.json +++ b/.github/workflows/matrix_includes.json @@ -1,11 +1,8 @@ [ { - "subproject_dir": "26.1" - }, - { - "subproject_dir": "26.1.1" + "subproject_dir": "26.1.2" }, { - "subproject_dir": "26.1.2" + "subproject_dir": "26.2" } ] diff --git a/build.gradle b/build.gradle index 3d2cfe0..9101f24 100644 --- a/build.gradle +++ b/build.gradle @@ -8,12 +8,10 @@ plugins { preprocess { preprocess.strictExtraMappings.set(false) - def mc260100 = createNode('26.1', 26_01_00, '') - def mc260101 = createNode('26.1.1', 26_01_01, '') def mc260102 = createNode('26.1.2', 26_01_02, '') + def mc260200 = createNode('26.2', 26_02_00, '') - mc260100.link(mc260101, file('versions/mapping-26.1-26.1.1.txt')) - mc260101.link(mc260102, file('versions/mapping-26.1.1-26.1.2.txt')) + mc260102.link(mc260200, file('versions/mapping-26.1.2-26.2.txt')) } tasks.register('buildAndGather') { diff --git a/common.gradle b/common.gradle index 6080595..22a45a9 100644 --- a/common.gradle +++ b/common.gradle @@ -61,6 +61,17 @@ loom { accessWidenerPath = file("fuzz.accesswidener") } +afterEvaluate { + tasks.matching { it.name.startsWith('runMixinAudit') }.configureEach { runTask -> + parent.subprojects.findAll { it != project }.each { otherProject -> + def downloadAssets = otherProject.tasks.findByName('downloadAssets') + if (downloadAssets != null) { + runTask.mustRunAfter(downloadAssets) + } + } + } +} + JavaVersion JAVA_VERSION if (mcVersion >= 260000) { JAVA_VERSION = JavaVersion.VERSION_25 diff --git a/docs/development.md b/docs/development.md index a1f3feb..8a6b143 100644 --- a/docs/development.md +++ b/docs/development.md @@ -4,36 +4,6 @@ --- -## 版本支持 - -✔ 正在维护 - -✖ 停止维护 - -❓ 通常只修复BUG - -| 游戏版本 | 开发状态 | 最后支持版本 | -|:--------------------:| :------: | :----------: | -| 26.1.1 | ✔ | --- | -| 26.1 | ✔ | --- | -| 1.21.11 | ✔ | --- | -| 1.21.10 | ✔ | --- | -| 1.21.9 | ✔ | --- | -| 1.21.8 | ✔ | --- | -| 1.21.7 | ✔ | --- | -| 1.21.6 | ✔ | --- | -| 1.21.5 | ✔ | --- | -| 1.21.4 | ✔ | --- | -| 1.21.3 | ✔ | --- | -| 1.21.2 | ✔ | --- | -| 1.21.1 | ✔ | --- | -| 1.21 | ✔ | --- | -| 1.20.6 | ✔ | --- | -| 1.19.4 | ✔ | --- | -| 1.18.2 | ✔ | --- | -| 1.17.1 | ✔ | --- | -| **1.16.5(主)** | ✔ | --- | - ## 依赖 | 依赖 | 链接 | 要求 | |:-------------------:|:-------------------------------------------------:|:--:| diff --git a/docs/en/development_en.md b/docs/en/development_en.md index 30fe87d..c72df8a 100644 --- a/docs/en/development_en.md +++ b/docs/en/development_en.md @@ -4,36 +4,6 @@ --- -## Support Version - -✔ Under maintenance - -✖ Discontinued maintenance - -❓ Usually only bug fixes - -| Game Version | Development Status | Last Supported Version | -|:-------------------------:| :----------------: | :--------------------: | -| 26.1.1 | ✔ | --- | -| 26.1 | ✔ | --- | -| 1.21.11 | ✔ | --- | -| 1.21.10 | ✔ | --- | -| 1.21.9 | ✔ | --- | -| 1.21.8 | ✔ | --- | -| 1.21.7 | ✔ | --- | -| 1.21.6 | ✔ | --- | -| 1.21.5 | ✔ | --- | -| 1.21.4 | ✔ | --- | -| 1.21.3 | ✔ | --- | -| 1.21.2 | ✔ | --- | -| 1.21.1 | ✔ | --- | -| 1.21 | ✔ | --- | -| 1.20.6 | ✔ | --- | -| 1.19.4 | ✔ | --- | -| 1.18.2 | ✔ | --- | -| 1.17.1 | ✔ | --- | -| **1.16.5(master)** | ✔ | --- | - ## Dependencies | Dependency | Link | Requirements | |:-------------------:|:-------------------------------------------------:|:------------:| diff --git a/gradle.properties b/gradle.properties index 2005fba..b419161 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx6G # Fabric Properties # check these on https://fabricmc.net/develop -loader_version = 0.18.4 +loader_version = 0.19.3 # Mod Properties mod_id = fuzz mod_name = Fuzz -mod_version = 1.6.11 +mod_version = 1.6.12 maven_group = top.1024byteeeee archives_base_name = Fuzz @@ -19,6 +19,6 @@ annotationtoolbox_version = 0.3 mixinextras_version = 0.5.2 # https://github.com/ReplayMod/preprocessor preprocess_version = c5abb4fb12 -fabric_loom_version = 1.15-SNAPSHOT +fabric_loom_version = 1.17-SNAPSHOT hierynomus_license_version = 0.16.1 tiny_yaml_version = 1.0.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23449a2..7e7d24f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/minecraftVersions.json b/minecraftVersions.json index 462ef23..11c710f 100644 --- a/minecraftVersions.json +++ b/minecraftVersions.json @@ -1,7 +1,6 @@ { "versions": [ - "26.1", - "26.1.1", - "26.1.2" + "26.1.2", + "26.2" ] } diff --git a/run/options.txt b/run/options.txt index a2264b4..2be01bd 100644 --- a/run/options.txt +++ b/run/options.txt @@ -1,4 +1,4 @@ -version:4790 +version:4788 ao:true biomeBlendRadius:2 chunkSectionFadeInTime:0.75 @@ -167,9 +167,9 @@ key_key.debug.profilingChart:key.keyboard.1 key_key.debug.fpsCharts:key.keyboard.2 key_key.debug.networkCharts:key.keyboard.3 key_key.debug.lightmapTexture:key.keyboard.4 -key_quickKickFakePlayer:key.keyboard.unknown -key_quickDropFakePlayerAllItemStack:key.keyboard.unknown -key_Clear Coordinate Compass:key.keyboard.unknown +key_快捷踢出假人:key.keyboard.unknown +key_快捷扔出假人背包:key.keyboard.unknown +key_清除坐标罗盘:key.keyboard.unknown soundCategory_master:0.24668874 soundCategory_music:0.0 soundCategory_record:1.0 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 index 4b1a1f7..3f68ffc 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/honeyBlockSlowDownDisabled/HoneyBlockMixin.java @@ -40,11 +40,11 @@ public HoneyBlockMixin(Properties settings) { @Override public float getSpeedFactor() { - return FuzzSettings.honeyBlockSlowDownDisabled ? Blocks.GRAY_CONCRETE.getSpeedFactor() : super.getSpeedFactor(); + return FuzzSettings.honeyBlockSlowDownDisabled ? Blocks.TNT.getSpeedFactor() : super.getSpeedFactor(); } @Override public float getJumpFactor() { - return FuzzSettings.honeyBlockSlowDownDisabled ? Blocks.GRAY_CONCRETE.getJumpFactor() : super.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 7db3113..78179f3 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 @@ -50,7 +50,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)) { - return Blocks.GRAY_CONCRETE.getFriction(); + return Blocks.TNT.getFriction(); } else { return original.call(block); } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java index 26c5dbc..cc7986b 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java @@ -49,7 +49,7 @@ public abstract class LivingEntityMixin { 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.GRAY_CONCRETE.getFriction(); + return Blocks.TNT.getFriction(); } else { return original.call(block); } diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java index 31634bc..7b5efbe 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java @@ -28,10 +28,12 @@ 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") diff --git a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java index 596a06e..cd0f0db 100644 --- a/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java +++ b/src/main/java/top/byteeeee/fuzz/mixin/rule/soulSandBlockSlowDownDisabled/SoulSandBlockMixin.java @@ -39,6 +39,6 @@ public SoulSandBlockMixin(Properties settings) { @Override public float getSpeedFactor() { - return FuzzSettings.soulSandBlockSlowDownDisabled ? Blocks.GRAY_CONCRETE.getSpeedFactor() : super.getSpeedFactor(); + return FuzzSettings.soulSandBlockSlowDownDisabled ? Blocks.TNT.getSpeedFactor() : super.getSpeedFactor(); } } diff --git a/src/main/java/top/byteeeee/fuzz/renderer/rule/commandCoordCompass/CoordCompassRenderer.java b/src/main/java/top/byteeeee/fuzz/renderer/rule/commandCoordCompass/CoordCompassRenderer.java index cbdb222..763426b 100644 --- a/src/main/java/top/byteeeee/fuzz/renderer/rule/commandCoordCompass/CoordCompassRenderer.java +++ b/src/main/java/top/byteeeee/fuzz/renderer/rule/commandCoordCompass/CoordCompassRenderer.java @@ -69,7 +69,11 @@ protected static void renderWorld(LevelRenderContext context) { return; } + //#if MC>=260200 + //$$ Camera camera = client.gameRenderer.mainCamera(); + //#else Camera camera = client.gameRenderer.getMainCamera(); + //#endif PoseStack matrixStack = context.poseStack(); matrixStack.pushPose(); Vec3 cameraPos = camera.position(); @@ -95,13 +99,24 @@ protected static void renderWorld(LevelRenderContext context) { matrixStack.mulPose(new Quaternionf().rotationYXZ((float)Math.toRadians(yaw), (float)Math.toRadians(pitch), 0)); float scale = 1.0F; matrixStack.scale(scale, scale, scale); + //#if MC<260200 PoseStack.Pose entry = matrixStack.last(); + //#endif RenderType renderLayer = RenderTypes.textSeeThrough(TARGET_ICON); + //#if MC>=260200 + //$$ context.submitNodeCollector().order(-1).submitCustomGeometry(context.poseStack(), renderLayer, (pose, buffer) -> { + //$$ buffer.addVertex(pose, -1F, -1F, 0F).setColor(1F, 1F, 1F, 1).setUv(0F, 0F); + //$$ buffer.addVertex(pose, -1F, 1F, 0F).setColor(1F, 1F, 1F, 1).setUv(0F, 1F); + //$$ buffer.addVertex(pose, 1F, 1F, 0F).setColor(1F, 1F, 1F, 1).setUv(1F, 1F); + //$$ buffer.addVertex(pose, 1F, -1F, 0F).setColor(1F, 1F, 1F, 1).setUv(1F, 0F); + //$$ }); + //#else VertexConsumer vertexConsumer = Objects.requireNonNull(context.bufferSource()).getBuffer(renderLayer); vertexConsumer.addVertex(entry.pose(), -1F, -1F, 0F).setUv(0F, 0F).setColor(-1).setLight(0xF000F0); vertexConsumer.addVertex(entry.pose(), -1F, 1F, 0F).setUv(0F, 1F).setColor(-1).setLight(0xF000F0); vertexConsumer.addVertex(entry.pose(), 1F, 1F, 0F).setUv(1F, 1F).setColor(-1).setLight(0xF000F0); vertexConsumer.addVertex(entry.pose(), 1F, -1F, 0F).setUv(1F, 0F).setColor(-1).setLight(0xF000F0); + //#endif matrixStack.popPose(); } diff --git a/src/main/java/top/byteeeee/fuzz/utils/MixinUtil.java b/src/main/java/top/byteeeee/fuzz/utils/MixinUtil.java index 1010231..729d0b2 100644 --- a/src/main/java/top/byteeeee/fuzz/utils/MixinUtil.java +++ b/src/main/java/top/byteeeee/fuzz/utils/MixinUtil.java @@ -21,7 +21,6 @@ package top.byteeeee.fuzz.utils; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; - import net.minecraft.network.chat.MutableComponent; import org.jetbrains.annotations.Nullable; @@ -33,6 +32,7 @@ public class MixinUtil { public static boolean audit(@Nullable FabricClientCommandSource source) { boolean ok; MutableComponent response; + try { MixinEnvironment.getCurrentEnvironment().audit(); response = Messenger.s("Mixin environment audited successfully"); @@ -42,9 +42,11 @@ public static boolean audit(@Nullable FabricClientCommandSource source) { response = Messenger.s(String.format("Mixin environment auditing failed, check console for more information (%s)", e)); ok = false; } + if (source != null) { Messenger.tell(source, response); } + return ok; } } \ No newline at end of file diff --git a/versions/26.2/fuzz.accesswidener b/versions/26.2/fuzz.accesswidener new file mode 100644 index 0000000..33eaa64 --- /dev/null +++ b/versions/26.2/fuzz.accesswidener @@ -0,0 +1 @@ +accessWidener v1 official diff --git a/versions/26.2/gradle.properties b/versions/26.2/gradle.properties new file mode 100644 index 0000000..404b52d --- /dev/null +++ b/versions/26.2/gradle.properties @@ -0,0 +1,16 @@ +# Fabric Properties +# check these on https://fabricmc.net/develop/ +minecraft_version = 26.2 + +# Fabric Mod Metadata +minecraft_dependency = >=26.2 +fabric_api_dependency = >=0.153.0+26.2 + +# Build Infomation +game_versions = 26.2 + +fabric_api_version = 0.153.0+26.2 +# fabric_module_version = 0.133.10+1.21.9 + +# https://masa.dy.fi/maven/carpet/fabric-carpet/ +# carpet_core_version = 1.21.11-1.4.193+v251211 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 new file mode 100644 index 0000000..7dfcad1 --- /dev/null +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererAccessor.java @@ -0,0 +1,37 @@ +/* + * 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.blockOutlineColor_Width; + +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; + +@GameVersion(version = "Minecraft < 21.2") +@Environment(EnvType.CLIENT) +@Mixin(DummyInterface.class) +public interface LevelRendererAccessor {} diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererMixin.java b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererMixin.java new file mode 100644 index 0000000..7b509ef --- /dev/null +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/blockOutlineColor_Width/LevelRendererMixin.java @@ -0,0 +1,125 @@ +/* + * 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.blockOutlineColor_Width; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +import com.mojang.blaze3d.vertex.PoseStack; + +import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.renderer.SubmitNodeCollector; +import net.minecraft.client.renderer.rendertype.RenderType; +import net.minecraft.client.renderer.rendertype.RenderTypes; +import net.minecraft.client.renderer.state.level.BlockOutlineRenderState; +import net.minecraft.util.ARGB; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; + +import top.byteeeee.fuzz.FuzzSettings; +import top.byteeeee.fuzz.helpers.rule.blockOutline.RainbowColorHelper; +import top.byteeeee.fuzz.validators.HexValidator; + +import java.util.Objects; + +@Environment(EnvType.CLIENT) +@Mixin(LevelRenderer.class) +public abstract class LevelRendererMixin implements LevelRendererAccessor { + + @Unique + private int getCustomOutlineColor() { + String colorCfg = FuzzSettings.blockOutlineColor; + if (Objects.equals(colorCfg, "false")) return Integer.MIN_VALUE; + if (Objects.equals(colorCfg, "rainbow")) { + return RainbowColorHelper.getRainbowColor(); + } + if (HexValidator.isValidHexColor(colorCfg)) { + int r = Integer.parseInt(colorCfg.substring(1, 3), 16); + int g = Integer.parseInt(colorCfg.substring(3, 5), 16); + int b = Integer.parseInt(colorCfg.substring(5, 7), 16); + int alpha = Math.clamp(FuzzSettings.blockOutlineAlpha, 0, 255); + return ARGB.color(alpha, r, g, b); + } + return Integer.MIN_VALUE; + } + + @WrapOperation( + method = "submitBlockOutline", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/LevelRenderer;submitHitOutline(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/rendertype/RenderType;Lnet/minecraft/client/renderer/state/level/BlockOutlineRenderState;IFZ)V" + ) + ) + private void wrapSubmitHitOutline( + LevelRenderer instance, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, + RenderType renderType, BlockOutlineRenderState state, + int originalColor, float lineWidth, boolean translucent, + Operation original + ) { + int customColor = getCustomOutlineColor(); + + if (customColor == Integer.MIN_VALUE) { + original.call(instance, poseStack, submitNodeCollector, renderType, state, originalColor, lineWidth, translucent); + return; + } + + if (renderType == RenderTypes.secondaryBlockOutline()) { + original.call(instance, poseStack, submitNodeCollector, renderType, state, customColor, lineWidth, translucent); + } else { + original.call(instance, poseStack, submitNodeCollector, renderType, state, customColor, lineWidth, translucent); + } + } + + @WrapOperation( + method = "submitBlockOutline", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/LevelRenderer;submitHitOutline(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/rendertype/RenderType;Lnet/minecraft/client/renderer/state/level/BlockOutlineRenderState;IFZ)V" + ) + ) + private void wrapOutlineWidth( + LevelRenderer instance, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, RenderType renderType, BlockOutlineRenderState blockOutlineRenderState, int originalColor, float originalWidth, boolean b, Operation original + ) { + float finalWidth = FuzzSettings.blockOutlineWidth >= 0 ? (float) FuzzSettings.blockOutlineWidth : originalWidth; + original.call(instance, poseStack, submitNodeCollector, renderType, blockOutlineRenderState, originalColor, finalWidth, b); + } + + @WrapOperation( + method = "submitBlockOutline", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/state/level/BlockOutlineRenderState;highContrast()Z" + ) + ) + private boolean wrapHighContrast(BlockOutlineRenderState state, Operation original) { + boolean customEnable = !Objects.equals(FuzzSettings.blockOutlineColor, "false") || FuzzSettings.blockOutlineWidth != -1.0D; + if (customEnable) { + return original.call(state); + } + + return original.call(state); + } +} diff --git a/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java new file mode 100644 index 0000000..cc7986b --- /dev/null +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/LivingEntityMixin.java @@ -0,0 +1,57 @@ +/* + * 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.slimeBlockBounceDisabled; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; + +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.entity.LivingEntity; + +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(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(); + } else { + return original.call(block); + } + } +} \ No newline at end of file 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/slimeBlockBounceDisabled/SlimeBlockMixin.java new file mode 100644 index 0000000..e27a4b5 --- /dev/null +++ b/versions/26.2/src/main/java/top/byteeeee/fuzz/mixin/rule/slimeBlockBounceDisabled/SlimeBlockMixin.java @@ -0,0 +1,48 @@ +/* + * 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.slimeBlockBounceDisabled; + +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 && entity.equals(ClientUtil.getCurrentPlayer())) { + Noop.noop(); + } else { + original.call(level, state, pos, entity, fallDistance); + } + } +} diff --git a/versions/mainProject b/versions/mainProject index bf18016..3b68c90 100644 --- a/versions/mainProject +++ b/versions/mainProject @@ -1 +1 @@ -26.1 \ No newline at end of file +26.1.2 \ No newline at end of file diff --git a/versions/mapping-26.1.1-26.1.2.txt b/versions/mapping-26.1.1-26.1.2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/versions/mapping-26.1-26.1.1.txt b/versions/mapping-26.1.2-26.2.txt similarity index 100% rename from versions/mapping-26.1-26.1.1.txt rename to versions/mapping-26.1.2-26.2.txt