Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ loader_version = 0.18.2
# Mod Properties
mod_id = fuzz
mod_name = Fuzz
mod_version = 1.6.8-beta.1
mod_version = 1.6.8-beta.2
maven_group = top.1024byteeeee
archives_base_name = Fuzz

Expand All @@ -18,7 +18,7 @@ annotationtoolbox_version = 0.3
# https://github.com/LlamaLad7/MixinExtras
mixinextras_version = 0.5.0
# https://github.com/ReplayMod/preprocessor
preprocess_version = d452ef7612
preprocess_version = c5abb4fb12
fabric_loom_version = 1.14-SNAPSHOT
hierynomus_license_version = 0.16.1
tiny_yaml_version = 1.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import org.spongepowered.asm.mixin.injection.ModifyVariable;
import top.byteeeee.annotationtoolbox.annotation.GameVersion;
import top.byteeeee.fuzz.FuzzSettings;
import top.byteeeee.fuzz.helpers.rule.blockOutline.RainbowColorHelper;
Expand All @@ -46,18 +47,8 @@
@Environment(EnvType.CLIENT)
@Mixin(WorldRenderer.class)
public abstract class WorldRendererMixin implements WorldRendererAccessor {
@WrapOperation(
method = "renderTargetBlockOutline",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/render/WorldRenderer;drawBlockOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;DDDLnet/minecraft/client/render/state/OutlineRenderState;IF)V"
)
)
private void renderBlockOutlineWrapper(
WorldRenderer worldRenderer, MatrixStack matrixStack, VertexConsumer vertexConsumer,
double cameraX, double cameraY, double cameraZ, OutlineRenderState outlineRenderState, int color, float width,
Operation<Void> original
) {
@ModifyVariable(method = "drawBlockOutline", at = @At("HEAD"), argsOnly = true)
private int ModifyColor(int originalColor) {
if (!Objects.equals(FuzzSettings.blockOutlineColor, "false")) {
String colorString = FuzzSettings.blockOutlineColor;
int customColor;
Expand All @@ -71,13 +62,12 @@ private void renderBlockOutlineWrapper(
double alpha = FuzzSettings.blockOutlineAlpha;
customColor = ColorHelper.getArgb((int) alpha, red, green, blue);
} else {
original.call(worldRenderer, matrixStack, vertexConsumer, cameraX, cameraY, cameraZ, outlineRenderState, color, width);
return;
return originalColor;
}
}
original.call(worldRenderer, matrixStack, vertexConsumer, cameraX, cameraY, cameraZ, outlineRenderState, customColor, width);
return customColor;
} else {
original.call(worldRenderer, matrixStack, vertexConsumer, cameraX, cameraY, cameraZ, outlineRenderState, color, width);
return originalColor;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,16 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;

import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.SimpleOption;
import net.minecraft.client.render.*;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ColorHelper;
import net.minecraft.util.shape.VoxelShape;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import org.spongepowered.asm.mixin.injection.ModifyVariable;
import top.byteeeee.annotationtoolbox.annotation.GameVersion;
import top.byteeeee.fuzz.FuzzSettings;
import top.byteeeee.fuzz.validators.HexValidator;
Expand All @@ -55,18 +51,8 @@
@Environment(EnvType.CLIENT)
@Mixin(WorldRenderer.class)
public abstract class WorldRendererMixin implements WorldRendererAccessor {
@WrapOperation(
method = "renderTargetBlockOutline",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/render/WorldRenderer;drawBlockOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/entity/Entity;DDDLnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)V"
)
)
private void renderBlockOutlineWrapper(
WorldRenderer worldRenderer, MatrixStack matrices, VertexConsumer vertexConsumer, Entity entity,
double cameraX, double cameraY, double cameraZ,
BlockPos pos, BlockState state, int originalColor, Operation<Void> original
) {
@ModifyVariable(method = "drawBlockOutline", at = @At("HEAD"), argsOnly = true)
private int ModifyColor(int originalColor) {
if (!Objects.equals(FuzzSettings.blockOutlineColor, "false")) {
String colorString = FuzzSettings.blockOutlineColor;
int customColor;
Expand All @@ -80,15 +66,12 @@ private void renderBlockOutlineWrapper(
double alpha = FuzzSettings.blockOutlineAlpha;
customColor = ColorHelper.getArgb((int) alpha, red, green, blue);
} else {
original.call(worldRenderer, matrices, vertexConsumer, entity, cameraX, cameraY, cameraZ, pos, state, originalColor);
return;
return originalColor;
}
}

VoxelShape shape = state.getOutlineShape(this.getWorld(), pos, ShapeContext.of(entity));
VertexRendering.drawOutline(matrices, vertexConsumer, shape, pos.getX() - cameraX, pos.getY() - cameraY, pos.getZ() - cameraZ, customColor);
return customColor;
} else {
original.call(worldRenderer, matrices, vertexConsumer, entity, cameraX, cameraY, cameraZ, pos, state, originalColor);
return originalColor;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import net.minecraft.client.render.fog.FogRenderer;

import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

Expand All @@ -41,7 +42,8 @@ public abstract class FogRendererMixin {
method = "getFogBuffer",
at = @At(
value = "FIELD",
target = "Lnet/minecraft/client/render/fog/FogRenderer;fogEnabled:Z"
target = "Lnet/minecraft/client/render/fog/FogRenderer;fogEnabled:Z",
opcode = Opcodes.GETSTATIC
)
)
private boolean noFog(boolean original) {
Expand Down
Loading