Skip to content

Commit

Permalink
GrenadeRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
strubium committed Nov 5, 2024
1 parent 71ae8f9 commit d89924f
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ItemStack> entityPositioning;
@Getter private Consumer<ItemStack> entityPositioning;
private Runnable thrownEntityPositioning = () -> {};
private Consumer<ItemStack> inventoryPositioning;
private Consumer<RenderContext<RenderableState>> thirdPersonPositioning;
@Getter private Consumer<ItemStack> inventoryPositioning;
@Getter private Consumer<RenderContext<RenderableState>> thirdPersonPositioning;

private Consumer<RenderContext<RenderableState>> firstPersonPositioning;
private Consumer<RenderContext<RenderableState>> firstPersonLeftHandPositioning;
Expand Down Expand Up @@ -549,25 +551,6 @@ public GrenadeRenderer build() {
return renderer;
}

public Consumer<ItemStack> getEntityPositioning() {
return entityPositioning;
}

public Consumer<ItemStack> getInventoryPositioning() {
return inventoryPositioning;
}

public Consumer<RenderContext<RenderableState>> getThirdPersonPositioning() {
return thirdPersonPositioning;
}

public String getTextureName() {
return textureName;
}

public ModelBase getModel() {
return model;
}
}

private Builder builder;
Expand All @@ -576,7 +559,7 @@ public ModelBase getModel() {

private final MultipartTransitionProvider<RenderableState, Part, RenderContext<RenderableState>> weaponTransitionProvider;

protected ClientModContext clientModContext;
@Setter protected ClientModContext clientModContext;

private GrenadeRenderer(Builder builder) {
this.builder = builder;
Expand All @@ -599,10 +582,6 @@ protected ClientModContext getClientModContext() {
return clientModContext;
}

public void setClientModContext(ClientModContext clientModContext) {
this.clientModContext = clientModContext;
}


private static class StateManagerKey {
EntityLivingBase player;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d89924f

Please sign in to comment.