mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +01:00
More codestyle
This commit is contained in:
parent
ca2e5ddf46
commit
16eed1e568
7 changed files with 22 additions and 27 deletions
|
@ -17,8 +17,7 @@ public abstract class AbstractPonyLayer<T extends EntityLivingBase> implements L
|
|||
this.layer = humanLayer;
|
||||
}
|
||||
|
||||
public final void doRenderLayer(T entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks,
|
||||
float netHeadYaw, float headPitch, float scale) {
|
||||
public final void doRenderLayer(T entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
ModelBase model = renderer.getMainModel();
|
||||
if (model instanceof ModelHumanPlayer) {
|
||||
// render the human layer
|
||||
|
|
|
@ -30,11 +30,10 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
this.rm = rm;
|
||||
}
|
||||
|
||||
public void doPonyRender(EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks,
|
||||
float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
public void doPonyRender(EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
|
||||
NBTTagCompound leftTag = player.getLeftShoulderEntity();
|
||||
|
||||
|
@ -71,9 +70,7 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
model.transform(BodyPart.BODY);
|
||||
|
||||
// render on the haunches
|
||||
float f = .25F;
|
||||
float f1 = left ? 0.25F : -0.25F;
|
||||
GlStateManager.translate(f1, f, 0.35F);
|
||||
GlStateManager.translate(left ? 0.25F : -0.25F, 0.25F, 0.35F);
|
||||
GlStateManager.scale(1, -1, -1);
|
||||
GlStateManager.rotate(5 * (left ? -1 : 1), 0, 0, 1);
|
||||
|
||||
|
|
|
@ -33,12 +33,13 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
|
|||
}
|
||||
|
||||
@Override
|
||||
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) {
|
||||
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) {
|
||||
ModelBase model = getRenderer().getMainModel();
|
||||
boolean mainRight = entity.getPrimaryHand() == EnumHandSide.RIGHT;
|
||||
|
||||
ItemStack itemMain = entity.getHeldItemMainhand();
|
||||
ItemStack itemOff = entity.getHeldItemOffhand();
|
||||
|
||||
ItemStack left = mainRight ? itemOff : itemMain;
|
||||
ItemStack right = mainRight ? itemMain : itemOff;
|
||||
|
||||
|
@ -70,14 +71,14 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
|
|||
GlStateManager.translate(0.0F, 0.2F, 0.0F);
|
||||
}
|
||||
|
||||
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(-90.0F, 1, 0, 0);
|
||||
GlStateManager.rotate(180.0F, 0, 1, 0);
|
||||
boolean isUnicorn = isUnicorn(this.getRenderer().getMainModel());
|
||||
boolean isLeft = hand == EnumHandSide.LEFT;
|
||||
if (isUnicorn) {
|
||||
GlStateManager.translate(isLeft ? -0.6F : 0.1F, 1, -.5);
|
||||
GlStateManager.translate(isLeft ? -0.6F : 0.1F, 1, -0.5F);
|
||||
} else {
|
||||
GlStateManager.translate(0.0425F, 0.125F, -1.00F);
|
||||
GlStateManager.translate(0.0425F, 0.125F, -1);
|
||||
}
|
||||
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity, drop, transform, isLeft);
|
||||
|
||||
|
|
|
@ -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 f7 = entitylivingbaseIn.ticksExisted + p_177183_5_;
|
||||
float f7 = entity.ticksExisted + p_177183_5_;
|
||||
this.getRenderer().bindTexture(ENCHANTED_ITEM_GLINT_RES);
|
||||
GlStateManager.enableBlend();
|
||||
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.translate(0.0F, f7 * (0.001F + i * 0.003F) * 20.0F, 0.0F);
|
||||
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);
|
||||
|
|
|
@ -2,6 +2,6 @@ package com.minelittlepony.render.plane;
|
|||
|
||||
enum Face {
|
||||
NORTH, SOUTH,
|
||||
UP, DOWN,
|
||||
EAST, WEST;
|
||||
UP, DOWN,
|
||||
EAST, WEST;
|
||||
}
|
|
@ -73,8 +73,6 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
super.doRender(player, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
|
||||
// TODO: Why are there two sets of arms?
|
||||
@Override
|
||||
public void renderRightArm(AbstractClientPlayer player) {
|
||||
updateModel(player);
|
||||
|
|
|
@ -54,14 +54,14 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
|
|||
@Override
|
||||
public void doRender(EntityIllusionIllager entity, double x, double y, double z, float yaw, float partialTicks) {
|
||||
if (entity.isInvisible()) {
|
||||
Vec3d[] avec3d = entity.getRenderLocations(partialTicks);
|
||||
Vec3d[] vects = entity.getRenderLocations(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,
|
||||
x + avec3d[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,
|
||||
z + avec3d[i].z + (double) MathHelper.cos((float) i + f * 0.7F) * 0.025D,
|
||||
x + vects[i].x + (double) MathHelper.cos((float) i + f * 0.5F) * 0.025D,
|
||||
y + vects[i].y + (double) MathHelper.cos((float) i + f * 0.75F) * 0.0125D,
|
||||
z + vects[i].z + (double) MathHelper.cos((float) i + f * 0.7F) * 0.025D,
|
||||
yaw, partialTicks);
|
||||
}
|
||||
} else {
|
||||
|
@ -70,7 +70,7 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isVisible(EntityIllusionIllager p_193115_1_) {
|
||||
protected boolean isVisible(EntityIllusionIllager entity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue