Skip to content

Commit

Permalink
Simplify Guard rendering checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andromander committed Apr 21, 2021
1 parent 800c7d0 commit d1ee3e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ public boolean removeWhenFarAway(double distance) {
return false;
}


@Override
public void checkDespawn() {
if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
Expand Down Expand Up @@ -428,14 +427,6 @@ protected boolean canRide(Entity entity) {
return false;
}

public boolean displayDefenceLayer() {
return getPhase() == 0;
}

public boolean displayResistLayer() {
return getPhase() == 2;
}

class AttackGoal extends MeleeAttackGoal {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MalachiteDefenceLayer(IEntityRenderer<T, M> renderer) {

@Override
public void render(MatrixStack matrix, IRenderTypeBuffer buffer, int light, T entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (entity.displayDefenceLayer()) {
if (entity.getPhase() == 0) {
float ticks = (float)entity.tickCount + partialTicks;
EntityModel<T> model = this.getEnergySwirlModel();
model.prepareMobModel(entity, limbSwing, limbSwingAmount, partialTicks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MalachiteResistLayer(IEntityRenderer<T, M> renderer) {

@Override
public void render(MatrixStack matrix, IRenderTypeBuffer buffer, int light, T entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (entity.displayResistLayer()) {
if (entity.getPhase() == 2) {
float ticks = (float)entity.tickCount + partialTicks;
EntityModel<T> model = this.getEnergySwirlModel();
model.prepareMobModel(entity, limbSwing, limbSwingAmount, partialTicks);
Expand Down

0 comments on commit d1ee3e5

Please sign in to comment.