diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..a441313 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-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/ladysnake/ratsmischief/client/render/entity/PartyHatFeatureRenderer.java b/src/main/java/ladysnake/ratsmischief/client/render/entity/PartyHatFeatureRenderer.java index 7fd9980..fe9663b 100644 --- a/src/main/java/ladysnake/ratsmischief/client/render/entity/PartyHatFeatureRenderer.java +++ b/src/main/java/ladysnake/ratsmischief/client/render/entity/PartyHatFeatureRenderer.java @@ -16,7 +16,7 @@ public class PartyHatFeatureRenderer extends GeoLayerRenderer { public static final Set DISALLOWED_TYPES = Sets.immutableEnumSet(RatEntity.Type.RAT_KID, RatEntity.Type.BIGGIE_CHEESE, RatEntity.Type.REMY); - public static Identifier[] TEXTURES; + private static Identifier[] TEXTURES; private final PartyHatEntityRenderer partyHatEntityRenderer; @@ -28,13 +28,7 @@ public PartyHatFeatureRenderer(IGeoRenderer entityRendererIn, PartyHa @Override public void render(MatrixStack matrixStackIn, VertexConsumerProvider bufferIn, int packedLightIn, RatEntity ratEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { if (RatsMischiefUtils.IS_BIRTHDAY && !DISALLOWED_TYPES.contains(ratEntity.getRatType())) { - if (TEXTURES == null) { - TEXTURES = new Identifier[RatEntity.PartyHat.values().length]; - for (RatEntity.PartyHat hat : RatEntity.PartyHat.values()) { - TEXTURES[hat.ordinal()] = new Identifier(RatsMischief.MOD_ID, "textures/entity/birthday_hats/" + hat.toString().toLowerCase() + ".png"); - } - } - Identifier hatTexture = TEXTURES[ratEntity.getPartyHat().ordinal()]; + Identifier hatTexture = getTexture(ratEntity.getPartyHat()); this.partyHatEntityRenderer.render(this.getEntityModel().getModel(this.getEntityModel().getModelResource(ratEntity)), ratEntity, partialTicks, @@ -45,4 +39,14 @@ public void render(MatrixStack matrixStackIn, VertexConsumerProvider bufferIn, i packedLightIn, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); } } + + public static Identifier getTexture(RatEntity.PartyHat partyHat) { + if (TEXTURES == null) { + TEXTURES = new Identifier[RatEntity.PartyHat.values().length]; + for (RatEntity.PartyHat hat : RatEntity.PartyHat.values()) { + TEXTURES[hat.ordinal()] = new Identifier(RatsMischief.MOD_ID, "textures/entity/birthday_hats/" + hat.toString().toLowerCase() + ".png"); + } + } + return TEXTURES[partyHat.ordinal()]; + } } diff --git a/src/main/java/ladysnake/ratsmischief/client/render/item/RatItemRenderer.java b/src/main/java/ladysnake/ratsmischief/client/render/item/RatItemRenderer.java index 1ec6330..95cecff 100644 --- a/src/main/java/ladysnake/ratsmischief/client/render/item/RatItemRenderer.java +++ b/src/main/java/ladysnake/ratsmischief/client/render/item/RatItemRenderer.java @@ -71,7 +71,7 @@ public void render(RatItem animatable, MatrixStack matrices, VertexConsumerProvi && stack.getNbt().getCompound(RatsMischief.MOD_ID).contains("rat") && stack.getNbt().getCompound(RatsMischief.MOD_ID).getCompound("rat").contains("PartyHat")) { String hat = stack.getNbt().getCompound(RatsMischief.MOD_ID).getCompound("rat").getString("PartyHat"); - Identifier hatTexture = PartyHatFeatureRenderer.TEXTURES[RatEntity.PartyHat.valueOf(hat).ordinal()]; + Identifier hatTexture = PartyHatFeatureRenderer.getTexture(RatEntity.PartyHat.valueOf(hat)); MinecraftClient.getInstance().getTextureManager().bindTexture(hatTexture); this.render(model, animatable, 0.0F, RenderLayer.getEntityCutout(hatTexture), matrices, bufferSource, null, packedLight, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); diff --git a/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java b/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java index 68aff35..bc4e840 100644 --- a/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java +++ b/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java @@ -55,8 +55,8 @@ public ArmorFeatureRendererMixin(FeatureRendererContext context) { if (context instanceof PlayerEntityRendererWrapper playerWrapper) { this.slim = playerWrapper.mischief$isSlim(); } - this.leggingsModel = new PlayerEntityModel<>(wrapper.getContext().getPart(RatsMischiefClient.RAT_MASTER_ARMOR_INNER_LAYER), false); - this.playerModel = new PlayerEntityModel<>(wrapper.getContext().getPart(this.slim ? RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER_SLIM : RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER), this.slim); + this.leggingsModel = new PlayerEntityModel<>(wrapper.mischief$getContext().getPart(RatsMischiefClient.RAT_MASTER_ARMOR_INNER_LAYER), false); + this.playerModel = new PlayerEntityModel<>(wrapper.mischief$getContext().getPart(this.slim ? RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER_SLIM : RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER), this.slim); } }