From d89924f60d90f3454b6916b8bcc041fd1cfb7e52 Mon Sep 17 00:00:00 2001 From: strubium <113206902+strubium@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:53:24 -0600 Subject: [PATCH] GrenadeRenderer --- .../weaponlib/grenade/GrenadeRenderer.java | 39 +++++-------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java b/src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java index 51cdd2848..0d43cf90d 100644 --- a/src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java +++ b/src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java @@ -5,6 +5,8 @@ import com.paneedah.weaponlib.animation.*; import com.paneedah.weaponlib.animation.DebugPositioner.TransitionConfiguration; import com.paneedah.weaponlib.animation.MultipartPositioning.Positioner; +import lombok.Getter; +import lombok.Setter; import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.BufferBuilder; @@ -95,13 +97,13 @@ private static class SimplePositioning { public static class Builder { - private ModelBase model; - private String textureName; + @Getter private ModelBase model; + @Getter private String textureName; - private Consumer entityPositioning; + @Getter private Consumer entityPositioning; private Runnable thrownEntityPositioning = () -> {}; - private Consumer inventoryPositioning; - private Consumer> thirdPersonPositioning; + @Getter private Consumer inventoryPositioning; + @Getter private Consumer> thirdPersonPositioning; private Consumer> firstPersonPositioning; private Consumer> firstPersonLeftHandPositioning; @@ -549,25 +551,6 @@ public GrenadeRenderer build() { return renderer; } - public Consumer getEntityPositioning() { - return entityPositioning; - } - - public Consumer getInventoryPositioning() { - return inventoryPositioning; - } - - public Consumer> getThirdPersonPositioning() { - return thirdPersonPositioning; - } - - public String getTextureName() { - return textureName; - } - - public ModelBase getModel() { - return model; - } } private Builder builder; @@ -576,7 +559,7 @@ public ModelBase getModel() { private final MultipartTransitionProvider> weaponTransitionProvider; - protected ClientModContext clientModContext; + @Setter protected ClientModContext clientModContext; private GrenadeRenderer(Builder builder) { this.builder = builder; @@ -599,10 +582,6 @@ protected ClientModContext getClientModContext() { return clientModContext; } - public void setClientModContext(ClientModContext clientModContext) { - this.clientModContext = clientModContext; - } - private static class StateManagerKey { EntityLivingBase player; @@ -1119,7 +1098,7 @@ public void renderItem() { WeaponRenderer.renderLeftArm(player, renderContext, positioner); - // Randomization is supported for the right hand only only + // Randomization is supported for the right hand only positioner.randomize(stateDescriptor.rate, stateDescriptor.amplitude); WeaponRenderer.renderRightArm(player, renderContext, positioner);