Skip to content

Commit

Permalink
Fix legacy block outline width
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasebtw committed Dec 22, 2024
1 parent 8d25679 commit 6dc2c4f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package me.mixces.animatium.mixins.renderer;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import me.mixces.animatium.config.AnimatiumConfig;
import net.minecraft.client.gl.ShaderProgram;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(ShaderProgram.class)
public abstract class MixinShaderProgram {
@WrapOperation(method = "initializeUniforms", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;getShaderLineWidth()F"))
private float animatium$legacyBlockOutlineRendering$lineWidth(Operation<Float> original) {
if (AnimatiumConfig.getInstance().getLegacyBlockOutlineRendering()) {
return 2.0F;
} else {
return original.call();
}
}
}
11 changes: 6 additions & 5 deletions src/main/resources/animatium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"package": "me.mixces.animatium.mixins",
"compatibilityLevel": "JAVA_21",
"client": [
"screen.MixinCamera",
"network.MixinClientPlayerInteractionManager",
"MixinMinecraftClient",
"renderer.MixinShaderProgram",
"accessor.CameraAccessor",
"accessor.ClientWorldPropertiesAccessor",
"accessor.EntryListWidgetAccessor",
Expand All @@ -16,6 +15,7 @@
"model.item.MixinItemModelManager",
"model.item.MixinItemRenderLayerState",
"model.item.MixinUsingItemProperty",
"network.MixinClientPlayerInteractionManager",
"network.MixinClientPlayNetworkHandler",
"renderer.MixinDrawContext",
"renderer.MixinGameRenderer",
Expand All @@ -31,6 +31,7 @@
"renderer.item.MixinHeldItemFeatureRenderer",
"renderer.item.MixinHeldItemRenderer",
"renderer.item.MixinItemRenderer",
"screen.MixinCamera",
"screen.MixinChatScreen",
"screen.MixinDebugHud",
"screen.MixinEntryListWidget",
Expand All @@ -43,11 +44,11 @@
"screen.widget.toast.MixinRecipeToast",
"screen.widget.toast.MixinToastManagerEntry",
"screen.widget.toast.MixinTutorialToast",
"world.MixinItem",
"world.MixinItemStack",
"world.entity.MixinLivingEntity",
"world.entity.MixinPlayerEntity",
"world.entity.MixinThrownEntity",
"world.MixinItem",
"world.MixinItemStack"
"world.entity.MixinThrownEntity"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 6dc2c4f

Please sign in to comment.