diamond armor rendering (for hats)
This commit is contained in:
@@ -28,20 +28,16 @@ public class SaturnClient implements ModInitializer {
|
||||
public static ConfigManager config = new ConfigManager("Saturn Client");
|
||||
|
||||
public static Property<Integer> COLOR = config.property(
|
||||
"Primary color",
|
||||
new Property<Integer>(
|
||||
ColorHelper.getArgb(255, 251, 60, 79),
|
||||
Property.PropertyType.HEX
|
||||
)
|
||||
);
|
||||
"Primary color",
|
||||
new Property<Integer>(
|
||||
ColorHelper.getArgb(255, 251, 60, 79),
|
||||
Property.PropertyType.HEX));
|
||||
|
||||
public static Property<Integer> NORMAL = config.property(
|
||||
"Default color",
|
||||
new Property<Integer>(
|
||||
ColorHelper.getArgb(255, 182, 182, 182),
|
||||
Property.PropertyType.HEX
|
||||
)
|
||||
);
|
||||
"Default color",
|
||||
new Property<Integer>(
|
||||
ColorHelper.getArgb(255, 182, 182, 182),
|
||||
Property.PropertyType.HEX));
|
||||
|
||||
public static int WHITE = ColorHelper.getArgb(255, 255, 255, 255);
|
||||
public static TextRenderer textRenderer = null;
|
||||
@@ -60,9 +56,7 @@ public class SaturnClient implements ModInitializer {
|
||||
ModManager.init();
|
||||
ConfigManager.load();
|
||||
|
||||
ClientLifecycleEvents.CLIENT_STOPPING.register(_o ->
|
||||
ConfigManager.save()
|
||||
);
|
||||
ClientLifecycleEvents.CLIENT_STOPPING.register(_o -> ConfigManager.save());
|
||||
|
||||
KeyInputHandler.register();
|
||||
if (SaturnSocket.authenticate()) {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.saturnclient.saturnclient.mixin;
|
||||
|
||||
import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer;
|
||||
import net.minecraft.client.render.entity.state.BipedEntityRenderState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(ArmorFeatureRenderer.class)
|
||||
public class ArmorFeatureRendererMixin {
|
||||
@Redirect(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/entity/state/BipedEntityRenderState;equippedHeadStack:Lnet/minecraft/item/ItemStack;", opcode = org.objectweb.asm.Opcodes.GETFIELD))
|
||||
private ItemStack redirectEquippedHeadStack(BipedEntityRenderState state) {
|
||||
ItemStack original = state.equippedHeadStack;
|
||||
if (original.isEmpty()) {
|
||||
return new ItemStack(Items.DIAMOND_HELMET);
|
||||
}
|
||||
return original;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,12 @@
|
||||
"minVersion": "0.8",
|
||||
"package": "org.saturnclient.saturnclient.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"client": ["CapeRenderer", "TabListMixin", "NameTagMixin"],
|
||||
"client": [
|
||||
"CapeRenderer",
|
||||
"TabListMixin",
|
||||
"NameTagMixin",
|
||||
"ArmorFeatureRendererMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user