More codestyle

This commit is contained in:
Sollace 2018-04-26 22:30:17 +02:00
parent ca2e5ddf46
commit 16eed1e568
7 changed files with 22 additions and 27 deletions

View file

@ -17,8 +17,7 @@ public abstract class AbstractPonyLayer<T extends EntityLivingBase> implements L
this.layer = humanLayer; this.layer = humanLayer;
} }
public final void doRenderLayer(T entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks, public final void doRenderLayer(T entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
float netHeadYaw, float headPitch, float scale) {
ModelBase model = renderer.getMainModel(); ModelBase model = renderer.getMainModel();
if (model instanceof ModelHumanPlayer) { if (model instanceof ModelHumanPlayer) {
// render the human layer // render the human layer

View file

@ -30,11 +30,10 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
this.rm = rm; this.rm = rm;
} }
public void doPonyRender(EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, public void doPonyRender(EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
float ageInTicks, float netHeadYaw, float headPitch, float scale) {
GlStateManager.enableRescaleNormal(); GlStateManager.enableRescaleNormal();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1, 1, 1, 1);
NBTTagCompound leftTag = player.getLeftShoulderEntity(); NBTTagCompound leftTag = player.getLeftShoulderEntity();
@ -71,9 +70,7 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
model.transform(BodyPart.BODY); model.transform(BodyPart.BODY);
// render on the haunches // render on the haunches
float f = .25F; GlStateManager.translate(left ? 0.25F : -0.25F, 0.25F, 0.35F);
float f1 = left ? 0.25F : -0.25F;
GlStateManager.translate(f1, f, 0.35F);
GlStateManager.scale(1, -1, -1); GlStateManager.scale(1, -1, -1);
GlStateManager.rotate(5 * (left ? -1 : 1), 0, 0, 1); GlStateManager.rotate(5 * (left ? -1 : 1), 0, 0, 1);

View file

@ -33,12 +33,13 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
} }
@Override @Override
public void doPonyRender(EntityLivingBase entity, float p_177141_2_, float p_177141_3_, public void doPonyRender(EntityLivingBase entity, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
ModelBase model = getRenderer().getMainModel(); ModelBase model = getRenderer().getMainModel();
boolean mainRight = entity.getPrimaryHand() == EnumHandSide.RIGHT; boolean mainRight = entity.getPrimaryHand() == EnumHandSide.RIGHT;
ItemStack itemMain = entity.getHeldItemMainhand(); ItemStack itemMain = entity.getHeldItemMainhand();
ItemStack itemOff = entity.getHeldItemOffhand(); ItemStack itemOff = entity.getHeldItemOffhand();
ItemStack left = mainRight ? itemOff : itemMain; ItemStack left = mainRight ? itemOff : itemMain;
ItemStack right = mainRight ? itemMain : itemOff; ItemStack right = mainRight ? itemMain : itemOff;
@ -70,14 +71,14 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
GlStateManager.translate(0.0F, 0.2F, 0.0F); GlStateManager.translate(0.0F, 0.2F, 0.0F);
} }
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(-90.0F, 1, 0, 0);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(180.0F, 0, 1, 0);
boolean isUnicorn = isUnicorn(this.getRenderer().getMainModel()); boolean isUnicorn = isUnicorn(this.getRenderer().getMainModel());
boolean isLeft = hand == EnumHandSide.LEFT; boolean isLeft = hand == EnumHandSide.LEFT;
if (isUnicorn) { if (isUnicorn) {
GlStateManager.translate(isLeft ? -0.6F : 0.1F, 1, -.5); GlStateManager.translate(isLeft ? -0.6F : 0.1F, 1, -0.5F);
} else { } else {
GlStateManager.translate(0.0425F, 0.125F, -1.00F); GlStateManager.translate(0.0425F, 0.125F, -1);
} }
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity, drop, transform, isLeft); Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity, drop, transform, isLeft);

View file

@ -163,9 +163,9 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
} }
} }
private void renderEnchantment(EntityLivingBase entitylivingbaseIn, ModelBase modelbaseIn, float p_177183_3_, float p_177183_4_, float p_177183_5_, private void renderEnchantment(EntityLivingBase entity, ModelBase model, float p_177183_3_, float p_177183_4_, float p_177183_5_,
float p_177183_6_, float p_177183_7_, float p_177183_8_, float p_177183_9_) { float p_177183_6_, float p_177183_7_, float p_177183_8_, float p_177183_9_) {
float f7 = entitylivingbaseIn.ticksExisted + p_177183_5_; float f7 = entity.ticksExisted + p_177183_5_;
this.getRenderer().bindTexture(ENCHANTED_ITEM_GLINT_RES); this.getRenderer().bindTexture(ENCHANTED_ITEM_GLINT_RES);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.depthFunc(514); GlStateManager.depthFunc(514);
@ -185,7 +185,7 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
GlStateManager.rotate(30.0F - i * 60.0F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(30.0F - i * 60.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, f7 * (0.001F + i * 0.003F) * 20.0F, 0.0F); GlStateManager.translate(0.0F, f7 * (0.001F + i * 0.003F) * 20.0F, 0.0F);
GlStateManager.matrixMode(5888); GlStateManager.matrixMode(5888);
modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, p_177183_9_); model.render(entity, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, p_177183_9_);
} }
GlStateManager.matrixMode(5890); GlStateManager.matrixMode(5890);

View file

@ -2,6 +2,6 @@ package com.minelittlepony.render.plane;
enum Face { enum Face {
NORTH, SOUTH, NORTH, SOUTH,
UP, DOWN, UP, DOWN,
EAST, WEST; EAST, WEST;
} }

View file

@ -73,8 +73,6 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
super.doRender(player, x, y, z, entityYaw, partialTicks); super.doRender(player, x, y, z, entityYaw, partialTicks);
} }
// TODO: Why are there two sets of arms?
@Override @Override
public void renderRightArm(AbstractClientPlayer player) { public void renderRightArm(AbstractClientPlayer player) {
updateModel(player); updateModel(player);

View file

@ -54,14 +54,14 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
@Override @Override
public void doRender(EntityIllusionIllager entity, double x, double y, double z, float yaw, float partialTicks) { public void doRender(EntityIllusionIllager entity, double x, double y, double z, float yaw, float partialTicks) {
if (entity.isInvisible()) { if (entity.isInvisible()) {
Vec3d[] avec3d = entity.getRenderLocations(partialTicks); Vec3d[] vects = entity.getRenderLocations(partialTicks);
float f = this.handleRotationFloat(entity, partialTicks); float f = this.handleRotationFloat(entity, partialTicks);
for (int i = 0; i < avec3d.length; ++i) { for (int i = 0; i < vects.length; ++i) {
super.doRender(entity, super.doRender(entity,
x + avec3d[i].x + (double) MathHelper.cos((float) i + f * 0.5F) * 0.025D, x + vects[i].x + (double) MathHelper.cos((float) i + f * 0.5F) * 0.025D,
y + avec3d[i].y + (double) MathHelper.cos((float) i + f * 0.75F) * 0.0125D, y + vects[i].y + (double) MathHelper.cos((float) i + f * 0.75F) * 0.0125D,
z + avec3d[i].z + (double) MathHelper.cos((float) i + f * 0.7F) * 0.025D, z + vects[i].z + (double) MathHelper.cos((float) i + f * 0.7F) * 0.025D,
yaw, partialTicks); yaw, partialTicks);
} }
} else { } else {
@ -70,7 +70,7 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
} }
@Override @Override
protected boolean isVisible(EntityIllusionIllager p_193115_1_) { protected boolean isVisible(EntityIllusionIllager entity) {
return true; return true;
} }
} }