mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
Fixed pony body parts appearing on players in spectator mode and possily invisible players/mobs
This commit is contained in:
parent
e27fd49c40
commit
3a094fe1bf
8 changed files with 55 additions and 4 deletions
|
@ -11,7 +11,6 @@ import com.minelittlepony.client.util.render.plane.PlaneRenderer;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IPart;
|
import com.minelittlepony.model.IPart;
|
||||||
import com.minelittlepony.model.armour.IEquestrianArmour;
|
import com.minelittlepony.model.armour.IEquestrianArmour;
|
||||||
|
|
||||||
import net.minecraft.client.model.Cuboid;
|
import net.minecraft.client.model.Cuboid;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -767,8 +766,10 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
|
|
||||||
protected void renderVest(float scale) {
|
protected void renderVest(float scale) {
|
||||||
bodyOverlay.render(scale);
|
bodyOverlay.render(scale);
|
||||||
|
if (bodyOverlay.visible) {
|
||||||
upperTorsoOverlay.render(scale);
|
upperTorsoOverlay.render(scale);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void renderLegs(float scale) {
|
protected void renderLegs(float scale) {
|
||||||
if (!isSneaking) {
|
if (!isSneaking) {
|
||||||
|
@ -788,6 +789,18 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
rightLegOverlay.render(scale);
|
rightLegOverlay.render(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
|
||||||
|
upperTorso.visible = visible;
|
||||||
|
upperTorsoOverlay.visible = visible;
|
||||||
|
|
||||||
|
neck.visible = visible;
|
||||||
|
|
||||||
|
tail.setVisible(visible);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void transform(BodyPart part) {
|
public void transform(BodyPart part) {
|
||||||
if (attributes.isSleeping) {
|
if (attributes.isSleeping) {
|
||||||
|
|
|
@ -6,13 +6,12 @@ import net.minecraft.util.math.MathHelper;
|
||||||
import com.minelittlepony.client.util.render.PonyRenderer;
|
import com.minelittlepony.client.util.render.PonyRenderer;
|
||||||
import com.minelittlepony.model.IPart;
|
import com.minelittlepony.model.IPart;
|
||||||
import com.minelittlepony.model.IPegasus;
|
import com.minelittlepony.model.IPegasus;
|
||||||
import com.minelittlepony.model.PonyModelConstants;
|
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class PegasusWings<T extends Model & IPegasus> implements IPart, PonyModelConstants {
|
public class PegasusWings<T extends Model & IPegasus> implements IPart {
|
||||||
|
|
||||||
protected final T pegasus;
|
protected final T pegasus;
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,14 @@ public class ModelEnderStallion extends ModelSkeletonPony<EndermanEntity> {
|
||||||
rightLeg = new Cuboid(this, 0, 20);
|
rightLeg = new Cuboid(this, 0, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
|
||||||
|
leftHorn.visible = visible;
|
||||||
|
rightHorn.visible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean wingsAreOpen() {
|
public boolean wingsAreOpen() {
|
||||||
return isAttacking;
|
return isAttacking;
|
||||||
|
|
|
@ -185,6 +185,12 @@ public class ModelSeapony<T extends LivingEntity> extends ModelUnicorn<T> {
|
||||||
rightLeg.visible = false;
|
rightLeg.visible = false;
|
||||||
leftLegOverlay.visible = false;
|
leftLegOverlay.visible = false;
|
||||||
rightLegOverlay.visible = false;
|
rightLegOverlay.visible = false;
|
||||||
|
|
||||||
|
bodyCenter.visible = visible;
|
||||||
|
|
||||||
|
leftFin.visible = visible;
|
||||||
|
centerFin.visible = visible;
|
||||||
|
rightFin.visible = visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Armour extends ModelPonyArmour<T> {
|
class Armour extends ModelPonyArmour<T> {
|
||||||
|
|
|
@ -40,4 +40,10 @@ public class ModelAlicorn<T extends LivingEntity> extends ModelUnicorn<T> implem
|
||||||
wings.renderPart(scale, attributes.interpolatorId);
|
wings.renderPart(scale, attributes.interpolatorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
wings.setVisible(visible);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,4 +34,10 @@ public class ModelPegasus<T extends LivingEntity> extends ModelEarthPony<T> impl
|
||||||
super.renderBody(scale);
|
super.renderBody(scale);
|
||||||
wings.renderPart(scale, attributes.interpolatorId);
|
wings.renderPart(scale, attributes.interpolatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
wings.setVisible(visible);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,4 +125,10 @@ public class ModelUnicorn<T extends LivingEntity> extends ModelEarthPony<T> impl
|
||||||
}
|
}
|
||||||
return super.getArm(side);
|
return super.getArm(side);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
horn.setVisible(visible);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,13 @@ public class ModelZebra<T extends LivingEntity> extends ModelEarthPony<T> {
|
||||||
.pitch = -1F;
|
.pitch = -1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
super.setVisible(visible);
|
||||||
|
bristles.visible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
class Armour extends ModelPonyArmour<T> {
|
class Armour extends ModelPonyArmour<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue