mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Codestyle to remove all trailing whitespace, unneccessary this arguments, and standardise parameter names
This commit is contained in:
parent
7fbb56ad79
commit
0e0ee17f46
67 changed files with 802 additions and 770 deletions
|
@ -19,7 +19,7 @@ import java.util.function.Function;
|
|||
* Proxy class for accessing forge fields and methods.
|
||||
*/
|
||||
public class ForgeProxy {
|
||||
|
||||
|
||||
/**
|
||||
* True if forge is present.
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ public class ForgeProxy {
|
|||
|
||||
/**
|
||||
* Gets the mod armour texture for associated item and slot.
|
||||
*
|
||||
*
|
||||
* @param entity The entity to get armour for.
|
||||
* @param item The armour item
|
||||
* @param def Default return value if no mods present
|
||||
|
@ -43,7 +43,7 @@ public class ForgeProxy {
|
|||
|
||||
/**
|
||||
* Gets the mod armour texture for associated item and slot.
|
||||
*
|
||||
*
|
||||
* @param entity The entity to get armour for.
|
||||
* @param item The armour item
|
||||
* @param slot The slot this armour piece is place in.
|
||||
|
|
|
@ -27,16 +27,16 @@ public class LiteModMineLittlePony implements Tickable, InitCompleteListener {
|
|||
|
||||
@Override
|
||||
public void init(File configPath) {
|
||||
this.mlp = new MineLittlePony();
|
||||
mlp = new MineLittlePony();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitCompleted(Minecraft minecraft, LiteLoader loader) {
|
||||
this.mlp.postInit(minecraft);
|
||||
mlp.postInit(minecraft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) {
|
||||
this.mlp.onTick(minecraft, inGame);
|
||||
mlp.onTick(minecraft, inGame);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class MineLittlePony {
|
|||
config = new PonyConfig();
|
||||
ponyManager = new PonyManager(config);
|
||||
renderManager = new PonyRenderManager();
|
||||
|
||||
|
||||
LiteLoader.getInstance().registerExposable(config, null);
|
||||
|
||||
IReloadableResourceManager irrm = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager();
|
||||
|
@ -108,7 +108,7 @@ public class MineLittlePony {
|
|||
public PonyManager getManager() {
|
||||
return ponyManager;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the static pony render manager responsible for all entity renderers.
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,7 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
|
||||
/**
|
||||
* Gets or creates a pony for the given skin resource and vanilla model type.
|
||||
*
|
||||
*
|
||||
* @param resource A texture resource
|
||||
*/
|
||||
public Pony getPony(ResourceLocation resource, boolean slim) {
|
||||
|
@ -72,45 +72,45 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
/**
|
||||
* Gets or creates a pony for the given player.
|
||||
* Delegates to the background-ponies registry if no pony skins were available and client settings allows it.
|
||||
*
|
||||
*
|
||||
* @param player the player
|
||||
*/
|
||||
public Pony getPony(AbstractClientPlayer player) {
|
||||
return getPony(IPlayerInfo.getPlayerInfo(player).unwrap());
|
||||
}
|
||||
|
||||
|
||||
public Pony getPony(NetworkPlayerInfo playerInfo) {
|
||||
ResourceLocation skin = playerInfo.getLocationSkin();
|
||||
UUID uuid = playerInfo.getGameProfile().getId();
|
||||
|
||||
|
||||
if (skin == null) return getDefaultPony(uuid);
|
||||
|
||||
|
||||
return getPony(skin, uuid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets or creates a pony for the given skin resource and entity id.
|
||||
*
|
||||
*
|
||||
* Whether is has slim arms is determined by the id.
|
||||
*
|
||||
*
|
||||
* Delegates to the background-ponies registry if no pony skins were available and client settings allows it.
|
||||
*
|
||||
*
|
||||
* @param resource A texture resource
|
||||
* @param uuid id of a player or entity
|
||||
*/
|
||||
public Pony getPony(ResourceLocation resource, UUID uuid) {
|
||||
Pony pony = getPony(resource, isSlimSkin(uuid));
|
||||
|
||||
|
||||
if (config.getPonyLevel() == PonyLevel.PONIES && pony.getMetadata().getRace().isHuman()) {
|
||||
return getBackgroundPony(uuid);
|
||||
}
|
||||
|
||||
|
||||
return pony;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default pony. Either STEVE/ALEX, or a background pony based on client settings.
|
||||
*
|
||||
*
|
||||
* @param uuid id of a player or entity
|
||||
*/
|
||||
public Pony getDefaultPony(UUID uuid) {
|
||||
|
@ -131,7 +131,7 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
|
||||
return getPony(backgroundPonyList.get(bgi), false);
|
||||
}
|
||||
|
||||
|
||||
private boolean isUser(UUID uuid) {
|
||||
return Minecraft.getMinecraft().player != null && Minecraft.getMinecraft().player.getUniqueID().equals(uuid);
|
||||
}
|
||||
|
@ -145,17 +145,17 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
this.poniesCache.clear();
|
||||
this.backgroudPoniesCache.clear();
|
||||
this.backgroundPonyList.clear();
|
||||
poniesCache.clear();
|
||||
backgroudPoniesCache.clear();
|
||||
backgroundPonyList.clear();
|
||||
try {
|
||||
for (IResource res : resourceManager.getAllResources(BGPONIES_JSON)) {
|
||||
try (Reader reader = new InputStreamReader((res.getInputStream()))) {
|
||||
BackgroundPonies ponies = GSON.fromJson(reader, BackgroundPonies.class);
|
||||
if (ponies.override) {
|
||||
this.backgroundPonyList.clear();
|
||||
backgroundPonyList.clear();
|
||||
}
|
||||
this.backgroundPonyList.addAll(ponies.getPonies());
|
||||
backgroundPonyList.addAll(ponies.getPonies());
|
||||
} catch (JsonParseException e) {
|
||||
MineLittlePony.logger.error("Invalid bgponies.json in " + res.getResourcePackName(), e);
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
private ResourceLocation getDefaultSkin(UUID uuid) {
|
||||
return isSlimSkin(uuid) ? ALEX : STEVE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the given uuid is of a player would would use the ALEX skin type.
|
||||
*/
|
||||
|
@ -196,7 +196,7 @@ public class PonyManager implements IResourceManagerReloadListener {
|
|||
}
|
||||
|
||||
public List<ResourceLocation> getPonies() {
|
||||
return this.ponies.stream().map(this::apply).collect(Collectors.toList());
|
||||
return ponies.stream().map(this::apply).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,20 +40,20 @@ import net.minecraft.entity.passive.EntityVillager;
|
|||
* Old values of persisted internally.
|
||||
*/
|
||||
public class PonyRenderManager {
|
||||
|
||||
|
||||
private final Map<Class<? extends Entity>, Render<?>> renderMap = Maps.newHashMap();
|
||||
|
||||
|
||||
public PonyRenderManager() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers all new player skin types. (currently only pony and slimpony).
|
||||
*/
|
||||
public void initialisePlayerRenderers(RenderManager rm) {
|
||||
// Preview on the select skin gui
|
||||
ModUtilities.addRenderer(EntityPonyModel.class, new RenderPonyModel(rm));
|
||||
|
||||
|
||||
new RenderPonyPlayer(rm, false, "pony", PMAPI.pony);
|
||||
new RenderPonyPlayer(rm, true, "slimpony", PMAPI.ponySmall);
|
||||
//TODO: Add skin types for each species? May require model break up.
|
||||
|
@ -63,7 +63,7 @@ public class PonyRenderManager {
|
|||
* Registers all entity model replacements. (except for players).
|
||||
*/
|
||||
public void initializeMobRenderers(RenderManager rm, PonyConfig config) {
|
||||
|
||||
|
||||
if (config.villagers) {
|
||||
pushNewRenderer(rm, EntityVillager.class, new RenderPonyVillager(rm));
|
||||
pushNewRenderer(rm, EntityZombieVillager.class, new RenderPonyZombieVillager(rm));
|
||||
|
@ -129,7 +129,7 @@ public class PonyRenderManager {
|
|||
}
|
||||
ModUtilities.addRenderer(type, renderer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Restores a renderer to its previous value.
|
||||
*/
|
||||
|
|
|
@ -65,22 +65,22 @@ public class PonySettingPanel extends GuiScreen {
|
|||
final int LEFT = width / 10 + 16;
|
||||
GuiCheckbox pony, human, both, hd, sizes, snuzzles, showscale, villager, zombie, pigmen, skeleton, illager;
|
||||
int row = 32;
|
||||
this.buttonList.add(pony = ponies = new GuiCheckbox(PONY_ID, LEFT, row += 15, I18n.format(PONY)));
|
||||
this.buttonList.add(human = humans = new GuiCheckbox(HUMAN_ID, LEFT, row += 15, I18n.format(HUMAN)));
|
||||
this.buttonList.add(both = this.both = new GuiCheckbox(BOTH_ID, LEFT, row += 15, I18n.format(BOTH)));
|
||||
buttonList.add(pony = ponies = new GuiCheckbox(PONY_ID, LEFT, row += 15, I18n.format(PONY)));
|
||||
buttonList.add(human = humans = new GuiCheckbox(HUMAN_ID, LEFT, row += 15, I18n.format(HUMAN)));
|
||||
buttonList.add(both = this.both = new GuiCheckbox(BOTH_ID, LEFT, row += 15, I18n.format(BOTH)));
|
||||
row += 15;
|
||||
this.buttonList.add(hd = new GuiCheckbox(HD_ID, LEFT, row += 15, I18n.format(HD)));
|
||||
this.buttonList.add(sizes = new GuiCheckbox(SIZES_ID, LEFT, row += 15, I18n.format(SIZES)));
|
||||
this.buttonList.add(snuzzles = new GuiCheckbox(SNUZZLES_ID, LEFT, row += 15, I18n.format(SNUZZLES)));
|
||||
this.buttonList.add(showscale = new GuiCheckbox(SHOW_SCALE_ID, LEFT, row += 15, I18n.format(SHOW_SCALE)));
|
||||
buttonList.add(hd = new GuiCheckbox(HD_ID, LEFT, row += 15, I18n.format(HD)));
|
||||
buttonList.add(sizes = new GuiCheckbox(SIZES_ID, LEFT, row += 15, I18n.format(SIZES)));
|
||||
buttonList.add(snuzzles = new GuiCheckbox(SNUZZLES_ID, LEFT, row += 15, I18n.format(SNUZZLES)));
|
||||
buttonList.add(showscale = new GuiCheckbox(SHOW_SCALE_ID, LEFT, row += 15, I18n.format(SHOW_SCALE)));
|
||||
|
||||
final int RIGHT = width - width / 3;
|
||||
row = 32;
|
||||
this.buttonList.add(villager = new GuiCheckbox(VILLAGERS_ID, RIGHT, row += 15, I18n.format(VILLAGERS)));
|
||||
this.buttonList.add(zombie = new GuiCheckbox(ZOMBIES_ID, RIGHT, row += 15, I18n.format(ZOMBIES)));
|
||||
this.buttonList.add(pigmen = new GuiCheckbox(ZOMBIE_PIGMEN_ID, RIGHT, row += 15, I18n.format(ZOMBIE_PIGMEN)));
|
||||
this.buttonList.add(skeleton = new GuiCheckbox(SKELETONS_ID, RIGHT, row += 15, I18n.format(SKELETONS)));
|
||||
this.buttonList.add(illager = new GuiCheckbox(ILLAGER_ID, RIGHT, row += 15, I18n.format(ILLAGERS)));
|
||||
buttonList.add(villager = new GuiCheckbox(VILLAGERS_ID, RIGHT, row += 15, I18n.format(VILLAGERS)));
|
||||
buttonList.add(zombie = new GuiCheckbox(ZOMBIES_ID, RIGHT, row += 15, I18n.format(ZOMBIES)));
|
||||
buttonList.add(pigmen = new GuiCheckbox(ZOMBIE_PIGMEN_ID, RIGHT, row += 15, I18n.format(ZOMBIE_PIGMEN)));
|
||||
buttonList.add(skeleton = new GuiCheckbox(SKELETONS_ID, RIGHT, row += 15, I18n.format(SKELETONS)));
|
||||
buttonList.add(illager = new GuiCheckbox(ILLAGER_ID, RIGHT, row += 15, I18n.format(ILLAGERS)));
|
||||
|
||||
switch (config.getPonyLevel()) {
|
||||
default:
|
||||
|
@ -107,13 +107,13 @@ public class PonySettingPanel extends GuiScreen {
|
|||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
this.drawDefaultBackground();
|
||||
drawDefaultBackground();
|
||||
|
||||
this.drawCenteredString(mc.fontRenderer, I18n.format(TITLE), width / 2, 12, -1);
|
||||
drawCenteredString(mc.fontRenderer, I18n.format(TITLE), width / 2, 12, -1);
|
||||
|
||||
this.drawString(mc.fontRenderer, I18n.format(MOB_TITLE), width - width / 3 - 16, 32, -1);
|
||||
this.drawString(mc.fontRenderer, I18n.format(PONY_LEVEL), width / 10, 32, -1);
|
||||
this.drawString(mc.fontRenderer, I18n.format(OPTIONS), width / 10, 94, -1);
|
||||
drawString(mc.fontRenderer, I18n.format(MOB_TITLE), width - width / 3 - 16, 32, -1);
|
||||
drawString(mc.fontRenderer, I18n.format(PONY_LEVEL), width / 10, 32, -1);
|
||||
drawString(mc.fontRenderer, I18n.format(OPTIONS), width / 10, 94, -1);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public interface IPlayerInfo {
|
|||
public static IPlayerInfo getPlayerInfo(AbstractClientPlayer player) {
|
||||
return (IPlayerInfo)Minecraft.getMinecraft().getConnection().getPlayerInfo(player.getUniqueID());
|
||||
}
|
||||
|
||||
|
||||
default NetworkPlayerInfo unwrap() {
|
||||
return (NetworkPlayerInfo)this;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ package com.minelittlepony.ducks;
|
|||
* Holding class for entities that support special pony animations used for the renderers.
|
||||
*/
|
||||
public interface IPonyAnimationHolder {
|
||||
|
||||
|
||||
/**
|
||||
* Updates and gets the amount this entity is strafing to each side.
|
||||
*/
|
||||
|
|
|
@ -11,4 +11,9 @@ public interface IRenderPony {
|
|||
* Gets the wrapped pony model for this renderer.
|
||||
*/
|
||||
ModelWrapper getPlayerModel();
|
||||
|
||||
/**
|
||||
* Gets the current shadow size for rendering.
|
||||
*/
|
||||
float getShadowScale();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class GuiSkinsMineLP extends GuiSkins {
|
|||
private PonyManager ponyManager;
|
||||
|
||||
public GuiSkinsMineLP(PonyManager manager) {
|
||||
this.ponyManager = manager;
|
||||
ponyManager = manager;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@ public class GuiSkinsMineLP extends GuiSkins {
|
|||
protected void onSetLocalSkin(MinecraftProfileTexture.Type type) {
|
||||
MineLittlePony.logger.debug("Invalidating old local skin, checking updated local skin");
|
||||
if (type == MinecraftProfileTexture.Type.SKIN) {
|
||||
ponyManager.removePony(this.localPlayer.getSkinTexture());
|
||||
ponyManager.removePony(localPlayer.getSkinTexture());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ public class GuiSkinsMineLP extends GuiSkins {
|
|||
@Override
|
||||
public void onGuiClosed() {
|
||||
super.onGuiClosed();
|
||||
ponyManager.removePony(this.localPlayer.getSkinTexture());
|
||||
ponyManager.removePony(this.remotePlayer.getSkinTexture());
|
||||
ponyManager.removePony(localPlayer.getSkinTexture());
|
||||
ponyManager.removePony(remotePlayer.getSkinTexture());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public abstract class MixinEntityLivingBase extends Entity implements IPonyAnima
|
|||
|
||||
@Override
|
||||
public float getStrafeAmount(float ticks) {
|
||||
float strafing = this.moveStrafing;
|
||||
float strafing = moveStrafing;
|
||||
if (strafing != 0) {
|
||||
if (Math.abs(strafeRollAmount) < Math.abs(strafing)) {
|
||||
strafeRollAmount += strafing/10;
|
||||
|
@ -33,7 +33,7 @@ public abstract class MixinEntityLivingBase extends Entity implements IPonyAnima
|
|||
} else {
|
||||
strafeRollAmount *= 0.8;
|
||||
}
|
||||
|
||||
|
||||
return (float)Math.toDegrees(strafeRollAmount);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public abstract class MixinRenderManager implements IRenderManager {
|
|||
@Shadow @Final
|
||||
private Map<String, RenderPlayer> skinMap;
|
||||
|
||||
@Override
|
||||
public void addPlayerSkin(String key, RenderPlayer render) {
|
||||
skinMap.put(key, render);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public abstract class MixinThreadDownloadImageData extends SimpleTexture impleme
|
|||
super(textureResourceLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Accessor("bufferedImage")
|
||||
public abstract BufferedImage getBufferedImage();
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
protected abstract void initPositions(float yOffset, float stretch);
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
if (doCancelRender()) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
|
||||
/**
|
||||
* Rotates the provided arm to the correct orientation for holding an item.
|
||||
*
|
||||
*
|
||||
* @param arm The arm to rotate
|
||||
* @param direction Direction multiplier. 1 for right, -1 for left.
|
||||
* @param swingProgress How far we are through the current swing
|
||||
|
@ -140,7 +140,7 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
|
||||
/**
|
||||
* Applies a transform particular to a certain body part.
|
||||
*
|
||||
*
|
||||
* FIXME: Too long! Is there a better way to do this?
|
||||
*/
|
||||
public void transform(BodyPart part) {
|
||||
|
@ -195,7 +195,7 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
}
|
||||
|
||||
private void transformLarge(BodyPart part) {
|
||||
if (this.isSleeping) translate(0, -0.7F, 0.2F);
|
||||
if (isSleeping) translate(0, -0.7F, 0.2F);
|
||||
|
||||
switch (part) {
|
||||
case HEAD:
|
||||
|
|
|
@ -17,21 +17,21 @@ public class ModelMobPony extends ModelPlayerPony {
|
|||
@Override
|
||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||
super.rotateLegs(move, swing, tick, entity);
|
||||
|
||||
|
||||
rotateRightArm(move, tick);
|
||||
rotateLeftArm(move, tick);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to update the left arm's final rotation.
|
||||
* Subclasses may replace it with their own implementations.
|
||||
*
|
||||
*
|
||||
* @param move Limb swing amount.
|
||||
* @param tick Render partial ticks.
|
||||
*/
|
||||
protected void rotateRightArm(float move, float tick) {
|
||||
if (this.rightArmPose == ArmPose.EMPTY) return;
|
||||
|
||||
if (rightArmPose == ArmPose.EMPTY) return;
|
||||
|
||||
if (!metadata.hasMagic()) {
|
||||
rotateArmHolding(bipedRightArm, -1, swingProgress, tick);
|
||||
} else {
|
||||
|
@ -39,10 +39,10 @@ public class ModelMobPony extends ModelPlayerPony {
|
|||
rotateArmHolding(unicornArmRight, -1, swingProgress, tick);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Same as rotateRightArm but for the left arm (duh).
|
||||
*
|
||||
*
|
||||
* @param move Limb swing amount.
|
||||
* @param tick Render partial ticks.
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,8 @@ public class ModelWrapper {
|
|||
*/
|
||||
public ModelWrapper(AbstractPonyModel model) {
|
||||
this.model = model;
|
||||
this.armor = model.createArmour();
|
||||
this.armor.apply(model.metadata);
|
||||
armor = model.createArmour();
|
||||
armor.apply(model.metadata);
|
||||
}
|
||||
|
||||
public AbstractPonyModel getModel() {
|
||||
|
@ -39,7 +39,7 @@ public class ModelWrapper {
|
|||
model.metadata = meta;
|
||||
armor.apply(meta);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called at startup to configure a model's needed components.
|
||||
*/
|
||||
|
|
|
@ -10,18 +10,24 @@ import com.minelittlepony.render.PonyRenderer;
|
|||
|
||||
public class ModelPonyArmor extends ModelMobPony {
|
||||
|
||||
public PonyRenderer Bodypiece, extBody, extLegLeft, extLegRight, extHead;
|
||||
|
||||
public PonyRenderer flankGuard;
|
||||
|
||||
public PonyRenderer saddle;
|
||||
public PonyRenderer helmet;
|
||||
|
||||
public PonyRenderer leftLegging;
|
||||
public PonyRenderer rightLegging;
|
||||
|
||||
public ModelPonyArmor() {
|
||||
super();
|
||||
this.textureHeight = 32;
|
||||
textureHeight = 32;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
|
||||
bipedBody.rotateAngleY = bodySwing * 0.2F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void adjustBodyRiding() {
|
||||
adjustBody(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
|
||||
|
@ -30,14 +36,14 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
@Override
|
||||
protected void setHead(float posX, float posY, float posZ) {
|
||||
super.setHead(posX, posY, posZ);
|
||||
extHead.setRotationPoint(posX, posY, posZ);
|
||||
helmet.setRotationPoint(posX, posY, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateHeadRotation(float x, float y) {
|
||||
super.updateHeadRotation(x, y);
|
||||
extHead.rotateAngleX = x;
|
||||
extHead.rotateAngleY = y;
|
||||
helmet.rotateAngleX = x;
|
||||
helmet.rotateAngleY = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,20 +51,20 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
bipedBody.rotateAngleX = rotateAngleX;
|
||||
bipedBody.rotationPointY = rotationPointY;
|
||||
bipedBody.rotationPointZ = rotationPointZ;
|
||||
|
||||
Bodypiece.rotateAngleX = rotateAngleX;
|
||||
Bodypiece.rotationPointY = rotationPointY;
|
||||
Bodypiece.rotationPointZ = rotationPointZ;
|
||||
|
||||
extBody.rotateAngleX = rotateAngleX;
|
||||
extBody.rotationPointY = rotationPointY;
|
||||
extBody.rotationPointZ = rotationPointZ;
|
||||
|
||||
flankGuard.rotateAngleX = rotateAngleX;
|
||||
flankGuard.rotationPointY = rotationPointY;
|
||||
flankGuard.rotationPointZ = rotationPointZ;
|
||||
|
||||
saddle.rotateAngleX = rotateAngleX;
|
||||
saddle.rotationPointY = rotationPointY;
|
||||
saddle.rotationPointZ = rotationPointZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderHead(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
bipedHead.render(this.scale);
|
||||
extHead.render(this.scale);
|
||||
helmet.render(this.scale);
|
||||
bipedHeadwear.render(this.scale);
|
||||
}
|
||||
|
||||
|
@ -69,24 +75,24 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
@Override
|
||||
protected void renderBody(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
bipedBody.render(this.scale);
|
||||
Bodypiece.render(this.scale);
|
||||
extBody.render(this.scale);
|
||||
flankGuard.render(this.scale);
|
||||
saddle.render(this.scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLegs() {
|
||||
if (!isSneak) {
|
||||
boolean isLegs = this.extBody.showModel;
|
||||
extBody.showModel = true;
|
||||
extBody.postRender(scale);
|
||||
extBody.showModel = isLegs;
|
||||
boolean isLegs = saddle.showModel;
|
||||
saddle.showModel = true;
|
||||
saddle.postRender(scale);
|
||||
saddle.showModel = isLegs;
|
||||
}
|
||||
bipedLeftArm.render(scale);
|
||||
bipedRightArm.render(scale);
|
||||
bipedLeftLeg.render(scale);
|
||||
bipedRightLeg.render(scale);
|
||||
extLegRight.render(scale);
|
||||
extLegLeft.render(scale);
|
||||
rightLegging.render(scale);
|
||||
leftLegging.render(scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,46 +106,46 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
protected void initHeadTextures() {
|
||||
bipedHead = new ModelRenderer(this, 0, 0);
|
||||
bipedHeadwear = new ModelRenderer(this, 32, 0);
|
||||
extHead = new PonyRenderer(this, 0, 0);
|
||||
helmet = new PonyRenderer(this, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initBodyTextures() {
|
||||
bipedBody = new PonyRenderer(this, 16, 16);
|
||||
Bodypiece = new PonyRenderer(this, 0, 0);
|
||||
extBody = new PonyRenderer(this, 16, 8);
|
||||
flankGuard = new PonyRenderer(this, 0, 0);
|
||||
saddle = new PonyRenderer(this, 16, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLegTextures() {
|
||||
bipedRightArm = new PonyRenderer(this, 0, 16);
|
||||
bipedRightLeg = new ModelRenderer(this, 0, 16);
|
||||
|
||||
|
||||
bipedLeftArm = new PonyRenderer(this, 0, 16).mirror();
|
||||
bipedLeftLeg = new PonyRenderer(this, 0, 16).mirror();
|
||||
|
||||
|
||||
unicornArmRight = new PonyRenderer(this, 0, 16);
|
||||
unicornArmLeft = new PonyRenderer(this, 0, 16);
|
||||
|
||||
extLegLeft = new PonyRenderer(this, 48, 8);
|
||||
extLegRight = new PonyRenderer(this, 48, 8);
|
||||
|
||||
leftLegging = new PonyRenderer(this, 48, 8);
|
||||
rightLegging = new PonyRenderer(this, 48, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTailPositions(float yOffset, float stretch) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initHeadPositions(float yOffset, float stretch) {
|
||||
bipedHead .addBox(HEAD_CENTRE_X - 4, HEAD_CENTRE_Y - 4, HEAD_CENTRE_Z - 4, 8, 8, 8, stretch * 1.1F);
|
||||
bipedHeadwear.addBox(HEAD_CENTRE_X - 4, HEAD_CENTRE_Y - 4, HEAD_CENTRE_Z - 4, 8, 8, 8, stretch * 1.1F + 0.5F);
|
||||
|
||||
extHead.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
|
||||
helmet.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4, -6, 1, 2, 2, 2, stretch * 0.5F)
|
||||
.tex(0, 4).box( 2, -6, 1, 2, 2, 2, stretch * 0.5F);
|
||||
|
||||
|
||||
bipedHead .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
bipedHeadwear.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
}
|
||||
|
@ -148,28 +154,28 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
protected void initBodyPositions(float yOffset, float stretch) {
|
||||
bipedBody.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
bipedBody.addBox(-4.0F, 4.0F, -2.0F, 8, 8, 4, stretch);
|
||||
|
||||
Bodypiece.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
|
||||
flankGuard.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4.0F, 4.0F, 6.0F, 8, 8, 8, stretch);
|
||||
extBody.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
saddle.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4.0F, 4.0F, -2.0F, 8, 8, 16, stretch);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLegPositions(float yOffset, float stretch) {
|
||||
super.initLegPositions(yOffset, stretch);
|
||||
|
||||
extLegLeft.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z)
|
||||
|
||||
leftLegging.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z)
|
||||
.around(3, yOffset, 0)
|
||||
.box(-2, -6, -2, 4, 12, 4, stretch);
|
||||
extLegRight.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z)
|
||||
rightLegging.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z)
|
||||
.around(-3, yOffset, 0)
|
||||
.mirror().box(-2, -6, -2, 4, 12, 4, stretch);
|
||||
}
|
||||
|
||||
protected void syncLegs() {
|
||||
extLegRight.rotateAt(bipedRightLeg).rotateTo(bipedRightLeg);
|
||||
extLegLeft.rotateAt(bipedLeftLeg).rotateTo(bipedLeftLeg);
|
||||
rightLegging.rotateAt(bipedRightLeg).rotateTo(bipedRightLeg);
|
||||
leftLegging.rotateAt(bipedLeftLeg).rotateTo(bipedLeftLeg);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -196,12 +202,13 @@ public class ModelPonyArmor extends ModelMobPony {
|
|||
syncLegs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean invisible) {
|
||||
super.setVisible(invisible);
|
||||
Bodypiece.showModel = invisible;
|
||||
extBody.showModel = invisible;
|
||||
extHead.showModel = invisible;
|
||||
extLegLeft.showModel = invisible;
|
||||
extLegRight.showModel = invisible;
|
||||
flankGuard.showModel = invisible;
|
||||
saddle.showModel = invisible;
|
||||
helmet.showModel = invisible;
|
||||
leftLegging.showModel = invisible;
|
||||
rightLegging.showModel = invisible;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor {
|
|||
@Override
|
||||
protected void fixSpecialRotationPoints(float move) {
|
||||
if (rightArmPose != ArmPose.EMPTY && !metadata.hasMagic()) {
|
||||
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4.0F);
|
||||
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import net.minecraft.client.model.ModelRenderer;
|
|||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class ModelZombiePonyArmor extends ModelPonyArmor {
|
||||
|
||||
|
||||
private boolean isRight(float move) {
|
||||
return MathHelper.sin(move / 20f) < 0;
|
||||
}
|
||||
|
||||
|
||||
// Copied from ModelZombiePony
|
||||
@Override
|
||||
protected void rotateRightArm(float move, float tick) {
|
||||
|
@ -20,7 +20,7 @@ public class ModelZombiePonyArmor extends ModelPonyArmor {
|
|||
rotateArmHolding(bipedLeftArm, -1, swingProgress, tick);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void rotateLeftArm(float move, float tick) {
|
||||
// Zombies are unidexterous.
|
||||
|
@ -32,7 +32,7 @@ public class ModelZombiePonyArmor extends ModelPonyArmor {
|
|||
boolean right = isRight(move);
|
||||
float xchange = right ? 0.5f : -0.5f;
|
||||
ModelRenderer arm = right ? bipedRightArm : bipedLeftArm;
|
||||
|
||||
|
||||
shiftRotationPoint(arm, xchange, 1.5f, 3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,20 +5,21 @@ import com.minelittlepony.pony.data.IPonyData;
|
|||
|
||||
public class PonyArmor {
|
||||
|
||||
public final AbstractPonyModel modelArmorChestplate, modelArmor;
|
||||
|
||||
public final AbstractPonyModel chestplate;
|
||||
public final AbstractPonyModel armour;
|
||||
|
||||
public PonyArmor(AbstractPonyModel chest, AbstractPonyModel body) {
|
||||
this.modelArmorChestplate = chest;
|
||||
this.modelArmor = body;
|
||||
chestplate = chest;
|
||||
armour = body;
|
||||
}
|
||||
|
||||
|
||||
public void apply(IPonyData meta) {
|
||||
modelArmorChestplate.metadata = meta;
|
||||
modelArmor.metadata = meta;
|
||||
chestplate.metadata = meta;
|
||||
armour.metadata = meta;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
modelArmorChestplate.init(0, 1);
|
||||
modelArmor.init(0, 0.5f);
|
||||
chestplate.init(0, 1);
|
||||
armour.init(0, 0.5f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,20 +10,20 @@ public class ModelWing {
|
|||
public PonyRenderer folded;
|
||||
|
||||
private boolean mirror;
|
||||
|
||||
|
||||
public ModelWing(AbstractPonyModel pony, boolean mirror, float x, float y, float scale, int texY) {
|
||||
this.mirror = mirror;
|
||||
|
||||
|
||||
folded = new PonyRenderer(pony, 56, texY)
|
||||
.around(HEAD_RP_X, WING_FOLDED_RP_Y, WING_FOLDED_RP_Z);
|
||||
extended = new PonyRenderer(pony, 56, texY + 3)
|
||||
.around(HEAD_RP_X, WING_FOLDED_RP_Y, WING_FOLDED_RP_Z).mirror(mirror);
|
||||
|
||||
addCloseWing(x, y, scale);
|
||||
|
||||
addClosedWing(x, y, scale);
|
||||
addFeathers(mirror, y, scale);
|
||||
}
|
||||
|
||||
private void addCloseWing(float x, float y, float scale) {
|
||||
|
||||
private void addClosedWing(float x, float y, float scale) {
|
||||
folded.box(x, 5f, 2, 2, 6, 2, scale)
|
||||
.box(x, 5f, 4, 2, 8, 2, scale)
|
||||
.box(x, 5f, 6, 2, 6, 2, scale)
|
||||
|
@ -50,11 +50,11 @@ public class ModelWing {
|
|||
folded.rotateAngleY = swing * 0.2F;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void render(boolean extend, float scale) {
|
||||
extended.rotationPointX = (mirror ? -1 : 1) * LEFT_WING_EXT_RP_X;
|
||||
extended.rotationPointY = LEFT_WING_EXT_RP_Y;
|
||||
|
||||
|
||||
extended.rotateAngleY = 3;
|
||||
if (extend) {
|
||||
extended.render(scale);
|
||||
|
|
|
@ -15,58 +15,58 @@ public class PegasusWings extends ModelBase {
|
|||
public final ModelWing leftWing;
|
||||
public final ModelWing rightWing;
|
||||
|
||||
public PegasusWings(AbstractPonyModel pony, float yOffset, float stretch) {
|
||||
this.pony = pony;
|
||||
|
||||
public PegasusWings(AbstractPonyModel model, float yOffset, float stretch) {
|
||||
pony = model;
|
||||
|
||||
leftWing = new ModelWing(pony, false, 4f, yOffset, stretch, 32);
|
||||
rightWing = new ModelWing(pony, true, -6f, yOffset, stretch, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ticks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
if (!isVisible()) return;
|
||||
|
||||
float swing = 0;
|
||||
|
||||
|
||||
float flap = 0;
|
||||
|
||||
if (pony.swingProgress > 0) {
|
||||
swing = MathHelper.sin(MathHelper.sqrt(pony.swingProgress) * PI * 2);
|
||||
flap = MathHelper.sin(MathHelper.sqrt(pony.swingProgress) * PI * 2);
|
||||
} else {
|
||||
float pi = PI * (float) Math.pow(limbSwingAmount, 16);
|
||||
|
||||
float mve = limbSwing * 0.6662f; // magic number ahoy
|
||||
float srt = limbSwingAmount / 4;
|
||||
|
||||
swing = MathHelper.cos(mve + pi) * srt;
|
||||
float pi = PI * (float) Math.pow(swing, 16);
|
||||
|
||||
float mve = move * 0.6662f; // magic number ahoy
|
||||
float srt = swing / 4;
|
||||
|
||||
flap = MathHelper.cos(mve + pi) * srt;
|
||||
}
|
||||
|
||||
leftWing.rotateWalking(swing);
|
||||
rightWing.rotateWalking(-swing);
|
||||
|
||||
|
||||
leftWing.rotateWalking(flap);
|
||||
rightWing.rotateWalking(-flap);
|
||||
|
||||
if (isExtended()) {
|
||||
float flapAngle = getWingRotationFactor(ticks);
|
||||
leftWing.rotateFlying(flapAngle);
|
||||
rightWing.rotateFlying(-flapAngle);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public float getWingRotationFactor(float ticks) {
|
||||
if (pony.isFlying) {
|
||||
return (MathHelper.sin(ticks * 0.536f) * 1) + ROTATE_270 + 0.4f;
|
||||
}
|
||||
return LEFT_WING_ROTATE_ANGLE_Z_SNEAK;
|
||||
}
|
||||
|
||||
|
||||
public boolean isVisible() {
|
||||
return pony.metadata.getRace().hasWings();
|
||||
}
|
||||
|
||||
|
||||
public boolean isExtended() {
|
||||
return pony.isFlying || pony.isSneak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
public void render(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
if (!isVisible()) return;
|
||||
boolean standing = isExtended();
|
||||
leftWing.render(standing, scale);
|
||||
|
|
|
@ -19,12 +19,12 @@ public class PonyElytra extends ModelBase {
|
|||
private PonyRenderer leftWing = new PonyRenderer(this, 22, 0);
|
||||
|
||||
public PonyElytra() {
|
||||
this.leftWing .box(-10, 0, 0, 10, 20, 2, 1);
|
||||
this.rightWing.mirror().box( 0, 0, 0, 10, 20, 2, 1);
|
||||
leftWing .box(-10, 0, 0, 10, 20, 2, 1);
|
||||
rightWing.mirror().box( 0, 0, 0, 10, 20, 2, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
public void render(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.disableCull();
|
||||
leftWing.render(scale);
|
||||
|
@ -32,8 +32,8 @@ public class PonyElytra extends ModelBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity);
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
|
||||
float rotateX = PI / 2;
|
||||
float rotateY = PI / 8;
|
||||
|
|
|
@ -10,26 +10,26 @@ import com.minelittlepony.pony.data.TailLengths;
|
|||
import com.minelittlepony.render.plane.PlaneRenderer;
|
||||
|
||||
public class PonyTail extends PlaneRenderer {
|
||||
|
||||
|
||||
private final TailSegment[] segments = new TailSegment[4];
|
||||
|
||||
|
||||
private final AbstractPonyModel theModel;
|
||||
|
||||
|
||||
public PonyTail(AbstractPonyModel model) {
|
||||
super(model);
|
||||
theModel = model;
|
||||
}
|
||||
|
||||
|
||||
public void init(float yOffset, float stretch) {
|
||||
for (int i = 0; i < segments.length; i++) {
|
||||
addChild(segments[i] = new TailSegment(theModel, i, yOffset, stretch));
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotationAndAngles(boolean rainboom, float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
|
||||
swingZ(rainboom, limbSwing, limbSwingAmount);
|
||||
|
||||
public void setRotationAndAngles(boolean rainboom, float move, float swing, float bodySwing, float ticks) {
|
||||
rotateAngleZ = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2f * swing;
|
||||
rotateAngleY = bodySwing;
|
||||
|
||||
|
||||
if (theModel.isSneak && !theModel.isFlying && !rainboom) {
|
||||
rotateSneak();
|
||||
} else if (theModel.isRiding) {
|
||||
|
@ -39,9 +39,9 @@ public class PonyTail extends PlaneRenderer {
|
|||
} else {
|
||||
setRotationPoint(TAIL_RP_X, TAIL_RP_Y, TAIL_RP_Z_NOTSNEAK);
|
||||
if (rainboom) {
|
||||
rotateAngleX = ROTATE_90 + MathHelper.sin(limbSwing) / 10;
|
||||
rotateAngleX = ROTATE_90 + MathHelper.sin(move) / 10;
|
||||
} else {
|
||||
rotateAngleX = limbSwingAmount / 2;
|
||||
rotateAngleX = swing / 2;
|
||||
}
|
||||
|
||||
if (!rainboom) {
|
||||
|
@ -55,16 +55,12 @@ public class PonyTail extends PlaneRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
public void swingZ(boolean rainboom, float move, float swing) {
|
||||
rotateAngleZ = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2f * swing;
|
||||
}
|
||||
|
||||
public void swingX(float tick) {
|
||||
float sinTickFactor = MathHelper.sin(tick * 0.067f) * 0.05f;
|
||||
rotateAngleX += sinTickFactor;
|
||||
rotateAngleY += sinTickFactor;
|
||||
}
|
||||
|
||||
|
||||
public void rotateSneak() {
|
||||
setRotationPoint(TAIL_RP_X, TAIL_RP_Y, TAIL_RP_Z_SNEAK);
|
||||
rotateAngleX = -BODY_ROTATE_ANGLE_X_SNEAK + 0.1F;
|
||||
|
@ -79,24 +75,24 @@ public class PonyTail extends PlaneRenderer {
|
|||
|
||||
super.render(scale);
|
||||
}
|
||||
|
||||
|
||||
private class TailSegment extends PlaneRenderer {
|
||||
|
||||
|
||||
public TailSegment(ModelBase model, int index, float yOffset, float stretch) {
|
||||
super(model);
|
||||
|
||||
this.offsetY = ((float)index)/4 + 0.063f;
|
||||
|
||||
|
||||
offsetY = ((float)index)/4 + 0.063f;
|
||||
|
||||
init(index, yOffset, stretch);
|
||||
}
|
||||
|
||||
|
||||
public void init(int index, float yOffset, float stretch) {
|
||||
int texX = (index % 2) * 4;
|
||||
|
||||
|
||||
if (index == 0) {
|
||||
tex(32, 0).addTopPlane(-2, 0, 2, 4, 4, stretch);
|
||||
}
|
||||
|
||||
|
||||
around(TAIL_RP_X, TAIL_RP_Y + yOffset, TAIL_RP_Z);
|
||||
tex(36, texX)
|
||||
.addEastPlane(2, 0, 2, 4, 4, stretch)
|
||||
|
|
|
@ -25,7 +25,7 @@ public class UnicornHorn extends ModelBase {
|
|||
|
||||
horn = new PonyRenderer(pony, 0, 3);
|
||||
glow = new HornGlowRenderer(pony, 0, 3);
|
||||
|
||||
|
||||
horn.offset(HORN_X, HORN_Y, HORN_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(0, 0, 0, 1, 4, 1, stretch)
|
||||
|
@ -38,16 +38,16 @@ public class UnicornHorn extends ModelBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
public void render(Entity entityIn, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
if (!pony.metadata.getRace().hasHorn()) return;
|
||||
|
||||
|
||||
horn.render(scale);
|
||||
|
||||
|
||||
if (usingMagic && pony.metadata.hasMagic()) {
|
||||
renderMagic(pony.metadata.getGlowColor(), scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void renderMagic(int tint, float scale) {
|
||||
glPushAttrib(24577);
|
||||
disableTexture2D();
|
||||
|
|
|
@ -20,7 +20,7 @@ public enum PlayerModels {
|
|||
}
|
||||
|
||||
public ModelWrapper getModel(boolean slim) {
|
||||
return slim ? this.slim.resolve() : this.normal.resolve();
|
||||
return slim ? this.slim.resolve() : normal.resolve();
|
||||
}
|
||||
|
||||
public String getId(boolean useSlimArms) {
|
||||
|
|
|
@ -11,6 +11,7 @@ public class ModelBreezie extends ModelBiped {
|
|||
ModelRenderer neck;
|
||||
ModelRenderer tail;
|
||||
ModelRenderer tailStub;
|
||||
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer rightWing;
|
||||
|
||||
|
@ -18,7 +19,7 @@ public class ModelBreezie extends ModelBiped {
|
|||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
this.bipedHeadwear.showModel = false;
|
||||
bipedHeadwear.showModel = false;
|
||||
|
||||
bipedHead = new ModelRenderer(this, 0, 0);
|
||||
bipedHead.setRotationPoint(0, 0, -4);
|
||||
|
@ -30,58 +31,58 @@ public class ModelBreezie extends ModelBiped {
|
|||
ModelRenderer antenna = new ModelRenderer(this);
|
||||
antenna.setTextureOffset(28, 2).addBox(1F, -11F, -2F, 1, 6, 1);
|
||||
antenna.setTextureOffset(24, 2).addBox(-2F, -11F, -2F, 1, 6, 1);
|
||||
setRotation(antenna, -0.2617994F, 0F, 0F);
|
||||
setRotation(antenna, -0.2617994F, 0, 0);
|
||||
|
||||
this.bipedHead.addChild(antenna);
|
||||
bipedHead.addChild(antenna);
|
||||
|
||||
bipedBody = new ModelRenderer(this, 2, 12);
|
||||
bipedBody.addBox(0F, 0F, 0F, 6, 7, 14).setRotationPoint(-3F, 1F, -3F);
|
||||
setRotation(bipedBody, -0.5235988F, 0F, 0F);
|
||||
bipedBody.addBox(0, 0, 0, 6, 7, 14).setRotationPoint(-3, 1, -3);
|
||||
setRotation(bipedBody, -0.5235988F, 0, 0);
|
||||
|
||||
bipedRightArm = new ModelRenderer(this, 36, 12);
|
||||
bipedRightArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 8F, -5F);
|
||||
bipedRightArm.addBox(0, 0, 0, 2, 12, 2).setRotationPoint(-3, 8, -5);
|
||||
|
||||
bipedLeftArm = new ModelRenderer(this, 28, 12);
|
||||
bipedLeftArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 8F, -5F);
|
||||
bipedLeftArm.addBox(0, 0, 0, 2, 12, 2).setRotationPoint(1, 8, -5);
|
||||
|
||||
bipedLeftLeg = new ModelRenderer(this, 8, 12);
|
||||
bipedLeftLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 12F, 3F);
|
||||
bipedLeftLeg.addBox(0, 0, 0, 2, 12, 2).setRotationPoint(1, 12, 3);
|
||||
|
||||
bipedRightLeg = new ModelRenderer(this, 0, 12);
|
||||
bipedRightLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 12F, 3F);
|
||||
bipedRightLeg.addBox(0, 0, 0, 2, 12, 2).setRotationPoint(-3, 12, 3);
|
||||
|
||||
neck = new ModelRenderer(this, 40, 0);
|
||||
neck.addBox(0F, 0F, 0F, 2, 5, 2).setRotationPoint(-1F, -2F, -4F);
|
||||
setRotation(neck, 0.0872665F, 0F, 0F);
|
||||
neck.addBox(0, 0, 0, 2, 5, 2).setRotationPoint(-1, -2, -4);
|
||||
setRotation(neck, 0.0872665F, 0, 0);
|
||||
|
||||
tailStub = new ModelRenderer(this, 40, 7);
|
||||
tailStub.addBox(0F, 0F, 0F, 1, 1, 3).setRotationPoint(-0.5F, 8F, 8F);
|
||||
tailStub.addBox(0, 0, 0, 1, 1, 3).setRotationPoint(-0.5F, 8, 8);
|
||||
|
||||
tail = new ModelRenderer(this, 32, 0);
|
||||
tail.addBox(0F, 0F, 1F, 2, 9, 2).setRotationPoint(-1F, 7F, 10F);
|
||||
tail.addBox(0, 0, 1, 2, 9, 2).setRotationPoint(-1, 7, 10);
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 40);
|
||||
leftWing.addBox(0F, -12F, 0F, 24, 24, 0);
|
||||
leftWing.setRotationPoint(2F, 3F, 1F);
|
||||
leftWing.addBox(0, -12, 0, 24, 24, 0);
|
||||
leftWing.setRotationPoint(2, 3, 1);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
setRotation(leftWing, 0F, -0.6981317F, 0F);
|
||||
setRotation(leftWing, 0, -0.6981317F, 0);
|
||||
|
||||
rightWing = new ModelRenderer(this, 0, 40);
|
||||
rightWing.addBox(-24F, -12F, 0F, 24, 24, 0, true);
|
||||
rightWing.setRotationPoint(-2F, 3F, 1F);
|
||||
rightWing.addBox(-24, -12, 0, 24, 24, 0, true);
|
||||
rightWing.setRotationPoint(-2, 3, 1);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
setRotation(rightWing, 0F, 0.6981317F, 0F);
|
||||
setRotation(rightWing, 0, 0.6981317F, 0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
neck.render(f5);
|
||||
tailStub.render(f5);
|
||||
tail.render(f5);
|
||||
leftWing.render(f5);
|
||||
rightWing.render(f5);
|
||||
public void render(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
super.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
neck.render(scale);
|
||||
tailStub.render(scale);
|
||||
tail.render(scale);
|
||||
leftWing.render(scale);
|
||||
rightWing.render(scale);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
@ -92,106 +93,106 @@ public class ModelBreezie extends ModelBiped {
|
|||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
|
||||
this.bipedHead.rotateAngleY = netHeadYaw * 0.017453292F;
|
||||
this.bipedHead.rotateAngleX = headPitch * 0.017453292F;
|
||||
bipedHead.rotateAngleY = headYaw * 0.017453292F;
|
||||
bipedHead.rotateAngleX = headPitch * 0.017453292F;
|
||||
|
||||
this.bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount * 0.5F;
|
||||
this.bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.bipedLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.bipedRightLeg.rotateAngleY = 0.0F;
|
||||
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
||||
this.bipedRightLeg.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftLeg.rotateAngleZ = 0.0F;
|
||||
bipedRightArm.rotateAngleX = MathHelper.cos(move * 0.6662F + (float) Math.PI) * 2.0F * swing * 0.5F;
|
||||
bipedLeftArm.rotateAngleX = MathHelper.cos(move * 0.6662F) * 2.0F * swing * 0.5F;
|
||||
bipedRightArm.rotateAngleZ = 0;
|
||||
bipedLeftArm.rotateAngleZ = 0;
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(move * 0.6662F) * 1.4F * swing;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(move * 0.6662F + (float) Math.PI) * 1.4F * swing;
|
||||
bipedRightLeg.rotateAngleY = 0;
|
||||
bipedLeftLeg.rotateAngleY = 0;
|
||||
bipedRightLeg.rotateAngleZ = 0;
|
||||
bipedLeftLeg.rotateAngleZ = 0;
|
||||
|
||||
if (this.isRiding) {
|
||||
this.bipedRightArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
this.bipedLeftArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
this.bipedRightLeg.rotateAngleX = -1.4137167F;
|
||||
this.bipedRightLeg.rotateAngleY = ((float) Math.PI / 10F);
|
||||
this.bipedRightLeg.rotateAngleZ = 0.07853982F;
|
||||
this.bipedLeftLeg.rotateAngleX = -1.4137167F;
|
||||
this.bipedLeftLeg.rotateAngleY = -((float) Math.PI / 10F);
|
||||
this.bipedLeftLeg.rotateAngleZ = -0.07853982F;
|
||||
if (isRiding) {
|
||||
bipedRightArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
bipedLeftArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
bipedRightLeg.rotateAngleX = -1.4137167F;
|
||||
bipedRightLeg.rotateAngleY = ((float) Math.PI / 10F);
|
||||
bipedRightLeg.rotateAngleZ = 0.07853982F;
|
||||
bipedLeftLeg.rotateAngleX = -1.4137167F;
|
||||
bipedLeftLeg.rotateAngleY = -((float) Math.PI / 10F);
|
||||
bipedLeftLeg.rotateAngleZ = -0.07853982F;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleY = 0;
|
||||
this.bipedRightArm.rotateAngleZ = 0F;
|
||||
bipedRightArm.rotateAngleY = 0;
|
||||
bipedRightArm.rotateAngleZ = 0F;
|
||||
|
||||
switch (this.leftArmPose) {
|
||||
switch (leftArmPose) {
|
||||
case EMPTY:
|
||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
bipedLeftArm.rotateAngleY = 0;
|
||||
break;
|
||||
case BLOCK:
|
||||
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
|
||||
this.bipedLeftArm.rotateAngleY = 0.5235988F;
|
||||
bipedLeftArm.rotateAngleX = bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
|
||||
bipedLeftArm.rotateAngleY = 0.5235988F;
|
||||
break;
|
||||
case ITEM:
|
||||
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
bipedLeftArm.rotateAngleX = bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
bipedLeftArm.rotateAngleY = 0;
|
||||
}
|
||||
|
||||
switch (this.rightArmPose) {
|
||||
switch (rightArmPose) {
|
||||
case EMPTY:
|
||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||
bipedRightArm.rotateAngleY = 0;
|
||||
break;
|
||||
case BLOCK:
|
||||
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
|
||||
this.bipedRightArm.rotateAngleY = -0.5235988F;
|
||||
bipedRightArm.rotateAngleX = bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
|
||||
bipedRightArm.rotateAngleY = -0.5235988F;
|
||||
break;
|
||||
case ITEM:
|
||||
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||
bipedRightArm.rotateAngleX = bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
bipedRightArm.rotateAngleY = 0;
|
||||
}
|
||||
|
||||
if (this.swingProgress > 0.0F) {
|
||||
EnumHandSide enumhandside = this.getMainHand(entityIn);
|
||||
ModelRenderer modelrenderer = this.getArmForSide(enumhandside);
|
||||
float f1 = this.swingProgress;
|
||||
this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f1) * ((float) Math.PI * 2F)) * 0.2F;
|
||||
if (swingProgress > 0.0F) {
|
||||
EnumHandSide enumhandside = getMainHand(entity);
|
||||
ModelRenderer modelrenderer = getArmForSide(enumhandside);
|
||||
float f1 = swingProgress;
|
||||
bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f1) * ((float) Math.PI * 2F)) * 0.2F;
|
||||
|
||||
if (enumhandside == EnumHandSide.LEFT) {
|
||||
this.bipedBody.rotateAngleY *= -1.0F;
|
||||
bipedBody.rotateAngleY *= -1.0F;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
bipedRightArm.rotationPointZ = MathHelper.sin(bipedBody.rotateAngleY) * 5;
|
||||
bipedRightArm.rotationPointX = -MathHelper.cos(bipedBody.rotateAngleY) * 5;
|
||||
bipedLeftArm.rotationPointZ = -MathHelper.sin(bipedBody.rotateAngleY) * 5;
|
||||
bipedLeftArm.rotationPointX = MathHelper.cos(bipedBody.rotateAngleY) * 5;
|
||||
bipedRightArm.rotateAngleY += bipedBody.rotateAngleY;
|
||||
bipedLeftArm.rotateAngleY += bipedBody.rotateAngleY;
|
||||
//noinspection SuspiciousNameCombination
|
||||
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
|
||||
f1 = 1.0F - this.swingProgress;
|
||||
bipedLeftArm.rotateAngleX += bipedBody.rotateAngleY;
|
||||
f1 = 1.0F - swingProgress;
|
||||
f1 = f1 * f1;
|
||||
f1 = f1 * f1;
|
||||
f1 = 1.0F - f1;
|
||||
float f2 = MathHelper.sin(f1 * (float) Math.PI);
|
||||
float f3 = MathHelper.sin(this.swingProgress * (float) Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
|
||||
float f3 = MathHelper.sin(swingProgress * (float) Math.PI) * -(bipedHead.rotateAngleX - 0.7F) * 0.75F;
|
||||
modelrenderer.rotateAngleX = (float) (modelrenderer.rotateAngleX - (f2 * 1.2D + f3));
|
||||
modelrenderer.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
|
||||
modelrenderer.rotateAngleZ += MathHelper.sin(this.swingProgress * (float) Math.PI) * -0.4F;
|
||||
modelrenderer.rotateAngleY += bipedBody.rotateAngleY * 2.0F;
|
||||
modelrenderer.rotateAngleZ += MathHelper.sin(swingProgress * (float) Math.PI) * -0.4F;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
||||
bipedRightArm.rotateAngleZ += MathHelper.cos(age * 0.09F) * 0.05F + 0.05F;
|
||||
bipedLeftArm.rotateAngleZ -= MathHelper.cos(age * 0.09F) * 0.05F + 0.05F;
|
||||
bipedRightArm.rotateAngleX += MathHelper.sin(age * 0.067F) * 0.05F;
|
||||
bipedLeftArm.rotateAngleX -= MathHelper.sin(age * 0.067F) * 0.05F;
|
||||
|
||||
if (this.rightArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
|
||||
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY + 0.4F;
|
||||
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
} else if (this.leftArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
|
||||
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY - 0.4F;
|
||||
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY;
|
||||
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
if (rightArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
|
||||
bipedRightArm.rotateAngleY = -0.1F + bipedHead.rotateAngleY;
|
||||
bipedLeftArm.rotateAngleY = 0.1F + bipedHead.rotateAngleY + 0.4F;
|
||||
bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + bipedHead.rotateAngleX;
|
||||
bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + bipedHead.rotateAngleX;
|
||||
} else if (leftArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
|
||||
bipedRightArm.rotateAngleY = -0.1F + bipedHead.rotateAngleY - 0.4F;
|
||||
bipedLeftArm.rotateAngleY = 0.1F + bipedHead.rotateAngleY;
|
||||
bipedRightArm.rotateAngleX = -((float) Math.PI / 2) + bipedHead.rotateAngleX;
|
||||
bipedLeftArm.rotateAngleX = -((float) Math.PI / 2) + bipedHead.rotateAngleX;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,12 +21,12 @@ public class ModelHumanPlayer extends AbstractPonyModel {
|
|||
|
||||
@Override
|
||||
protected void initTextures() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initPositions(float yOffset, float stretch) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,64 +13,64 @@ public class ModelIllagerPony extends ModelPlayerPony {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float swing, float move, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
|
||||
super.setRotationAngles(swing, move, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
AbstractIllager illager = (AbstractIllager) entityIn;
|
||||
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
AbstractIllager illager = (AbstractIllager) entity;
|
||||
AbstractIllager.IllagerArmPose pose = illager.getArmPose();
|
||||
|
||||
boolean rightHanded = illager.getPrimaryHand() == EnumHandSide.RIGHT;
|
||||
|
||||
if (pose == AbstractIllager.IllagerArmPose.ATTACKING) {
|
||||
// vindicator attacking
|
||||
float f = MathHelper.sin(this.swingProgress * (float) Math.PI);
|
||||
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float) Math.PI);
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotateAngleY = 0.15707964F;
|
||||
this.bipedLeftArm.rotateAngleY = -0.15707964F;
|
||||
float f = MathHelper.sin(swingProgress * (float) Math.PI);
|
||||
float f1 = MathHelper.sin((1.0F - (1.0F - swingProgress) * (1.0F - swingProgress)) * (float) Math.PI);
|
||||
bipedRightArm.rotateAngleZ = 0.0F;
|
||||
bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
bipedRightArm.rotateAngleY = 0.15707964F;
|
||||
bipedLeftArm.rotateAngleY = -0.15707964F;
|
||||
|
||||
if (rightHanded) {
|
||||
this.bipedRightArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
|
||||
this.bipedRightArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
||||
bipedRightArm.rotateAngleX = -1.8849558F + MathHelper.cos(age * 0.09F) * 0.15F;
|
||||
bipedRightArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
||||
} else {
|
||||
this.bipedLeftArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
|
||||
this.bipedLeftArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
||||
bipedLeftArm.rotateAngleX = -1.8849558F + MathHelper.cos(age * 0.09F) * 0.15F;
|
||||
bipedLeftArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
||||
bipedRightArm.rotateAngleZ += MathHelper.cos(age * 0.09F) * 0.05F + 0.05F;
|
||||
bipedLeftArm.rotateAngleZ -= MathHelper.cos(age * 0.09F) * 0.05F + 0.05F;
|
||||
bipedRightArm.rotateAngleX += MathHelper.sin(age * 0.067F) * 0.05F;
|
||||
bipedLeftArm.rotateAngleX -= MathHelper.sin(age * 0.067F) * 0.05F;
|
||||
} else if (pose == AbstractIllager.IllagerArmPose.SPELLCASTING) {
|
||||
if (this.metadata.hasMagic()) {
|
||||
this.horn.setUsingMagic(true);
|
||||
if (metadata.hasMagic()) {
|
||||
horn.setUsingMagic(true);
|
||||
}
|
||||
// waving arms!
|
||||
if (rightHanded) {
|
||||
// this.bipedRightArm.rotationPointZ = 0.0F;
|
||||
// this.bipedRightArm.rotationPointX = -5.0F;
|
||||
this.bipedRightArm.rotateAngleX = (float) (-.75F * Math.PI);
|
||||
this.bipedRightArm.rotateAngleZ = MathHelper.cos(ageInTicks * 0.6662F) / 4;
|
||||
this.bipedRightArm.rotateAngleY = 1.1F;
|
||||
bipedRightArm.rotateAngleX = (float) (-.75F * Math.PI);
|
||||
bipedRightArm.rotateAngleZ = MathHelper.cos(age * 0.6662F) / 4;
|
||||
bipedRightArm.rotateAngleY = 1.1F;
|
||||
} else {
|
||||
// this.bipedLeftArm.rotationPointZ = 0.0F;
|
||||
// this.bipedLeftArm.rotationPointX = 5.0F;
|
||||
this.bipedLeftArm.rotateAngleX = (float) (-.75F * Math.PI);
|
||||
this.bipedLeftArm.rotateAngleZ = -MathHelper.cos(ageInTicks * 0.6662F) / 4;
|
||||
this.bipedLeftArm.rotateAngleY = -1.1F;
|
||||
bipedLeftArm.rotateAngleX = (float) (-.75F * Math.PI);
|
||||
bipedLeftArm.rotateAngleZ = -MathHelper.cos(age * 0.6662F) / 4;
|
||||
bipedLeftArm.rotateAngleY = -1.1F;
|
||||
}
|
||||
|
||||
} else if (pose == AbstractIllager.IllagerArmPose.BOW_AND_ARROW) {
|
||||
if (rightHanded) {
|
||||
aimBow(ArmPose.EMPTY, ArmPose.BOW_AND_ARROW, ageInTicks);
|
||||
aimBow(ArmPose.EMPTY, ArmPose.BOW_AND_ARROW, age);
|
||||
} else {
|
||||
aimBow(ArmPose.BOW_AND_ARROW, ArmPose.EMPTY, ageInTicks);
|
||||
aimBow(ArmPose.BOW_AND_ARROW, ArmPose.EMPTY, age);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ModelRenderer getArm(EnumHandSide side) {
|
||||
return metadata.hasMagic() ? side == EnumHandSide.LEFT ? this.unicornArmLeft : this.unicornArmRight : this.getArmForSide(side);
|
||||
return metadata.hasMagic() ? side == EnumHandSide.LEFT ? unicornArmLeft : unicornArmRight : getArmForSide(side);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,14 +24,15 @@ import static com.minelittlepony.model.PonyModelConstants.*;
|
|||
public class ModelPlayerPony extends AbstractPonyModel {
|
||||
|
||||
private final boolean smallArms;
|
||||
|
||||
|
||||
public ModelRenderer bipedCape;
|
||||
|
||||
|
||||
public PlaneRenderer upperTorso;
|
||||
public PlaneRenderer neck;
|
||||
|
||||
public PonyRenderer unicornArmRight, unicornArmLeft;
|
||||
|
||||
|
||||
public PonyRenderer unicornArmRight;
|
||||
public PonyRenderer unicornArmLeft;
|
||||
|
||||
public PonyTail tail;
|
||||
public PonySnout snout;
|
||||
public UnicornHorn horn;
|
||||
|
@ -41,7 +42,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
super(smallArms);
|
||||
this.smallArms = smallArms;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelPonyArmor(), new ModelPonyArmor());
|
||||
|
@ -56,29 +57,29 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
|
||||
this.checkRainboom(entityIn, limbSwingAmount);
|
||||
this.rotateHead(netHeadYaw, headPitch);
|
||||
checkRainboom(entity, swing);
|
||||
rotateHead(headYaw, headPitch);
|
||||
|
||||
float bodySwingRotation = 0;
|
||||
if (swingProgress > -9990.0F && !metadata.hasMagic()) {
|
||||
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.2F;
|
||||
}
|
||||
|
||||
rotateLook(limbSwing, limbSwingAmount, bodySwingRotation, ageInTicks);
|
||||
rotateLook(move, swing, bodySwingRotation, age);
|
||||
|
||||
setLegs(limbSwing, limbSwingAmount, ageInTicks, entityIn);
|
||||
holdItem(limbSwingAmount);
|
||||
swingItem(entityIn, swingProgress);
|
||||
setLegs(move, swing, age, entity);
|
||||
holdItem(swing);
|
||||
swingItem(entity, swingProgress);
|
||||
|
||||
if (isCrouching() && !rainboom) {
|
||||
adjustBody(BODY_ROTATE_ANGLE_X_SNEAK, BODY_RP_Y_SNEAK, BODY_RP_Z_SNEAK);
|
||||
sneakLegs();
|
||||
setHead(0, 6, -2);
|
||||
} else if (isRiding) {
|
||||
this.adjustBodyRiding();
|
||||
adjustBodyRiding();
|
||||
bipedLeftLeg.rotationPointZ = 15;
|
||||
bipedLeftLeg.rotationPointY = 10;
|
||||
bipedLeftLeg.rotateAngleX = -PI / 4;
|
||||
|
@ -96,35 +97,35 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
|
||||
bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK;
|
||||
bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK;
|
||||
swingArms(ageInTicks);
|
||||
swingArms(age);
|
||||
setHead(0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
if (isSleeping) ponySleep();
|
||||
|
||||
aimBow(leftArmPose, rightArmPose, ageInTicks);
|
||||
fixSpecialRotationPoints(limbSwing);
|
||||
aimBow(leftArmPose, rightArmPose, age);
|
||||
fixSpecialRotationPoints(move);
|
||||
|
||||
animateWears();
|
||||
|
||||
if (bipedCape != null) {
|
||||
bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0;
|
||||
|
||||
|
||||
snout.setGender(metadata.getGender());
|
||||
wings.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
wings.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void adjustBodyRiding() {
|
||||
adjustBodyComponents(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
|
||||
adjustNeck(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
|
||||
setHead(0, 0, 0);
|
||||
}
|
||||
|
||||
protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
|
||||
tail.setRotationAndAngles(rainboom, limbSwing, limbSwingAmount, bodySwing, ticks);
|
||||
|
||||
protected void rotateLook(float move, float swing, float bodySwing, float ticks) {
|
||||
tail.setRotationAndAngles(rainboom, move, swing, bodySwing, ticks);
|
||||
bodySwing /= 5;
|
||||
|
||||
|
||||
upperTorso.rotateAngleY = bodySwing;
|
||||
bipedBody.rotateAngleY = bodySwing;
|
||||
neck.rotateAngleY = bodySwing;
|
||||
|
@ -160,16 +161,16 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
private void rotateHead(float horz, float vert) {
|
||||
float headRotateAngleY = isSleeping ? 1.4f : horz / 57.29578F;
|
||||
float headRotateAngleX = isSleeping ? 0.1f : vert / 57.29578F;
|
||||
|
||||
|
||||
headRotateAngleX = Math.min(headRotateAngleX, (float) (0.5f - Math.toRadians(motionPitch)));
|
||||
headRotateAngleX = Math.max(headRotateAngleX, (float) (-1.25f - Math.toRadians(motionPitch)));
|
||||
|
||||
|
||||
updateHeadRotation(headRotateAngleX, headRotateAngleY);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to update the head rotation.
|
||||
*
|
||||
*
|
||||
* @param x New rotation X
|
||||
* @param y New rotation Y
|
||||
*/
|
||||
|
@ -182,14 +183,14 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
rotateLegs(move, swing, tick, entity);
|
||||
adjustLegs();
|
||||
}
|
||||
|
||||
|
||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||
float leftArm;
|
||||
float rightArm;
|
||||
float leftLeg;
|
||||
float rightLeg;
|
||||
|
||||
|
||||
|
||||
|
||||
if (isFlying(entity)) {
|
||||
if (rainboom) {
|
||||
rightArm = leftArm = ROTATE_270;
|
||||
|
@ -203,13 +204,13 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedLeftArm.rotateAngleY = bipedRightLeg.rotateAngleY = -0.2F;
|
||||
} else {
|
||||
float pi = PI * (float) Math.pow(swing, 16);
|
||||
|
||||
|
||||
float mve = move * 0.6662F; // magic number ahoy
|
||||
float srt = swing / 4;
|
||||
|
||||
|
||||
leftArm = MathHelper.cos(mve + pi) * srt;
|
||||
rightArm = MathHelper.cos(mve + PI + pi / 2) * srt;
|
||||
|
||||
|
||||
leftLeg = MathHelper.cos(mve + PI - (pi * 0.4f)) * srt;
|
||||
rightLeg = MathHelper.cos(mve + pi * 0.2f) * srt;
|
||||
|
||||
|
@ -238,7 +239,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
unicornArmLeft.rotateAngleX = 0;
|
||||
unicornArmRight.rotateAngleX = 0;
|
||||
}
|
||||
|
||||
|
||||
private float getLegOutset() {
|
||||
if (isSleeping) return 2.6f;
|
||||
if (isSneak && !isFlying) return smallArms ? 1 : 0;
|
||||
|
@ -277,8 +278,8 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedRightLeg.rotationPointZ = bipedLeftLeg.rotationPointZ = 10;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void holdItem(float swing) {
|
||||
boolean both = leftArmPose == ArmPose.ITEM && rightArmPose == ArmPose.ITEM;
|
||||
|
||||
|
@ -290,7 +291,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
alignArmForAction(unicornArmRight, rightArmPose, both, swing);
|
||||
}
|
||||
|
||||
horn.setUsingMagic(this.leftArmPose != ArmPose.EMPTY || this.rightArmPose != ArmPose.EMPTY);
|
||||
horn.setUsingMagic(leftArmPose != ArmPose.EMPTY || rightArmPose != ArmPose.EMPTY);
|
||||
}
|
||||
|
||||
private void alignArmForAction(ModelRenderer arm, ArmPose pose, boolean both, float swing) {
|
||||
|
@ -311,20 +312,20 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void blockArm(ModelRenderer arm) {
|
||||
arm.rotateAngleX = arm.rotateAngleX / 2 - 0.9424779F;
|
||||
arm.rotateAngleY = PI / 6;
|
||||
}
|
||||
|
||||
protected void swingItem(Entity entity, float swingProgress) {
|
||||
if (swingProgress > -9990.0F && !this.isSleeping) {
|
||||
EnumHandSide mainSide = this.getMainHand(entity);
|
||||
if (swingProgress > -9990.0F && !isSleeping) {
|
||||
EnumHandSide mainSide = getMainHand(entity);
|
||||
boolean mainRight = mainSide == EnumHandSide.RIGHT;
|
||||
ArmPose mainPose = mainRight ? rightArmPose : leftArmPose;
|
||||
|
||||
|
||||
if (mainPose == ArmPose.EMPTY) return;
|
||||
|
||||
|
||||
if (metadata.hasMagic()) {
|
||||
swingArm(mainRight ? unicornArmRight : unicornArmLeft);
|
||||
} else {
|
||||
|
@ -332,15 +333,15 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void swingArm(ModelRenderer arm) {
|
||||
float swing = 1 - (float)Math.pow(1 - swingProgress, 3);
|
||||
|
||||
|
||||
float deltaX = MathHelper.sin(swing * PI);
|
||||
float deltaZ = MathHelper.sin(swingProgress * PI);
|
||||
|
||||
|
||||
float deltaAim = deltaZ * (0.7F - bipedHead.rotateAngleX) * 0.75F;
|
||||
|
||||
|
||||
arm.rotateAngleX -= deltaAim + deltaX * 1.2F;
|
||||
arm.rotateAngleZ = deltaZ * -0.4F;
|
||||
arm.rotateAngleY += bipedBody.rotateAngleY * 2;
|
||||
|
@ -351,7 +352,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
float sin = MathHelper.sin(tick * 0.067F) * 0.05F;
|
||||
|
||||
if (rightArmPose != ArmPose.EMPTY && !isSleeping) {
|
||||
|
||||
|
||||
if (metadata.hasMagic()) {
|
||||
unicornArmRight.rotateAngleZ += cos;
|
||||
unicornArmRight.rotateAngleX += sin;
|
||||
|
@ -380,7 +381,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedBody.rotateAngleX = rotateAngleX;
|
||||
bipedBody.rotationPointY = rotationPointY;
|
||||
bipedBody.rotationPointZ = rotationPointZ;
|
||||
|
||||
|
||||
upperTorso.rotateAngleX = rotateAngleX;
|
||||
upperTorso.rotationPointY = rotationPointY;
|
||||
upperTorso.rotationPointZ = rotationPointZ;
|
||||
|
@ -408,9 +409,9 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedLeftArm.rotateAngleX = ROTATE_270;
|
||||
bipedRightLeg.rotateAngleX = ROTATE_90;
|
||||
bipedLeftLeg.rotateAngleX = ROTATE_90;
|
||||
|
||||
|
||||
setHead(1, 2, isSneak ? -1 : 1);
|
||||
|
||||
|
||||
shiftRotationPoint(bipedRightArm, 0, 2, 6);
|
||||
shiftRotationPoint(bipedLeftArm, 0, 2, 6);
|
||||
shiftRotationPoint(bipedRightLeg, 0, 2, -8);
|
||||
|
@ -443,11 +444,11 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
|
||||
public void render(Entity entityIn, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
|
||||
pushMatrix();
|
||||
transform(BodyPart.HEAD);
|
||||
renderHead(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
renderHead(entityIn, move, swing, age, headYaw, headPitch, scale);
|
||||
popMatrix();
|
||||
|
||||
pushMatrix();
|
||||
|
@ -457,7 +458,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
|
||||
pushMatrix();
|
||||
transform(BodyPart.BODY);
|
||||
renderBody(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
renderBody(entityIn, move, swing, age, headYaw, headPitch, scale);
|
||||
popMatrix();
|
||||
|
||||
pushMatrix();
|
||||
|
@ -466,11 +467,11 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
popMatrix();
|
||||
}
|
||||
|
||||
protected void renderHead(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
protected void renderHead(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
bipedHead.render(scale);
|
||||
bipedHeadwear.render(scale);
|
||||
bipedHead.postRender(scale);
|
||||
horn.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
horn.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
}
|
||||
|
||||
protected void renderNeck() {
|
||||
|
@ -478,14 +479,14 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
neck.render(scale);
|
||||
}
|
||||
|
||||
protected void renderBody(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
protected void renderBody(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
bipedBody.render(scale);
|
||||
if (textureHeight == 64) {
|
||||
bipedBodyWear.render(scale);
|
||||
}
|
||||
upperTorso.render(scale);
|
||||
bipedBody.postRender(scale);
|
||||
wings.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
wings.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
tail.render(metadata.getTail(), scale);
|
||||
}
|
||||
|
||||
|
@ -496,7 +497,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedRightArm.render(scale);
|
||||
bipedLeftLeg.render(scale);
|
||||
bipedRightLeg.render(scale);
|
||||
|
||||
|
||||
if (textureHeight == 64) {
|
||||
bipedLeftArmwear.render(scale);
|
||||
bipedRightArmwear.render(scale);
|
||||
|
@ -522,11 +523,11 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
|
||||
protected void initBodyTextures() {
|
||||
bipedBody = new ModelRenderer(this, 16, 16);
|
||||
|
||||
|
||||
if (textureHeight == 64) {
|
||||
bipedBodyWear = new ModelRenderer(this, 16, 32);
|
||||
}
|
||||
|
||||
|
||||
upperTorso = new PlaneRenderer(this, 24, 0);
|
||||
neck = new PlaneRenderer(this, 0, 16);
|
||||
}
|
||||
|
@ -557,14 +558,14 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
initLegPositions(yOffset, stretch);
|
||||
initTailPositions(yOffset, stretch);
|
||||
}
|
||||
|
||||
|
||||
protected void initTailPositions(float yOffset, float stretch) {
|
||||
tail.init(yOffset, stretch);
|
||||
}
|
||||
|
||||
protected void initHeadPositions(float yOffset, float stretch) {
|
||||
bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, stretch);
|
||||
|
||||
|
||||
((PonyRenderer)bipedHead).offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch)
|
||||
|
@ -572,7 +573,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
.box(-4, -6, 1, 2, 2, 2, stretch)
|
||||
.mirror()
|
||||
.box(2, -6, 1, 2, 2, 2, stretch);
|
||||
|
||||
|
||||
((PonyRenderer)bipedHeadwear).offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch + 0.5F);
|
||||
|
@ -584,10 +585,10 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
protected void initBodyPositions(float yOffset, float stretch) {
|
||||
bipedBody.addBox(-4, 4, -2, 8, 8, 4, stretch);
|
||||
bipedBody.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
|
||||
|
||||
bipedBodyWear.addBox(-4, 4, -2, 8, 8, 4, stretch + 0.25F);
|
||||
bipedBodyWear.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
|
||||
|
||||
upperTorso.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(24, 0) .addEastPlane( 4, -4, -4, 8, 8, stretch)
|
||||
|
@ -607,7 +608,7 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
.addBackPlane(-1, 2, 8, 2, 2, stretch)
|
||||
.flipZ().addWestPlane(-1, 2, 2, 2, 6, stretch)
|
||||
.rotateAngleX = 0.5F;
|
||||
|
||||
|
||||
neck.at(NECK_CENTRE_X, NECK_CENTRE_Y, NECK_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addFrontPlane(0, 0, 0, 4, 4, stretch)
|
||||
|
@ -621,20 +622,20 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
int armWidth = smallArms ? 3 : 4;
|
||||
float rarmY = smallArms ? 8.5f : 8;
|
||||
float rarmX = smallArms ? 2 : 3;
|
||||
|
||||
|
||||
float armX = THIRDP_ARM_CENTRE_X - 2;
|
||||
float armY = THIRDP_ARM_CENTRE_Y - 6;
|
||||
float armZ = THIRDP_ARM_CENTRE_Z - 2;
|
||||
|
||||
|
||||
bipedLeftArm .addBox(armX, armY, armZ, armWidth, 12, 4, stretch);
|
||||
bipedRightArm.addBox(armX, armY, armZ, armWidth, 12, 4, stretch);
|
||||
|
||||
|
||||
bipedLeftLeg .addBox(armX, armY, armZ, 4, 12, 4, stretch);
|
||||
bipedRightLeg.addBox(armX, armY, armZ, 4, 12, 4, stretch);
|
||||
|
||||
|
||||
bipedLeftArm .setRotationPoint( rarmX, yOffset + rarmY, 0);
|
||||
bipedRightArm.setRotationPoint(-rarmX, yOffset + rarmY, 0);
|
||||
|
||||
|
||||
bipedLeftLeg .setRotationPoint( rarmX, yOffset, 0);
|
||||
bipedRightLeg.setRotationPoint(-rarmX, yOffset, 0);
|
||||
|
||||
|
@ -642,17 +643,17 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
bipedLeftArmwear.addBox(armX, armY, armZ, 3, 12, 4, stretch + 0.25f);
|
||||
bipedLeftArmwear.setRotationPoint(3, yOffset + rarmY, 0);
|
||||
}
|
||||
|
||||
|
||||
if (bipedRightArmwear != null) {
|
||||
bipedRightArmwear.addBox(armX, armY, armZ, armWidth, 12, 4, stretch + 0.25f);
|
||||
bipedRightArmwear.setRotationPoint(-3, yOffset + rarmY, 0);
|
||||
}
|
||||
|
||||
|
||||
if (bipedLeftLegwear != null) {
|
||||
bipedLeftLegwear.addBox(armX, armY, armZ, 4, 12, 4, stretch + 0.25f);
|
||||
bipedRightLegwear.setRotationPoint(3, yOffset, 0);
|
||||
}
|
||||
|
||||
|
||||
if (bipedRightLegwear != null) {
|
||||
bipedRightLegwear.addBox(armX, armY, armZ, 4, 12, 4, stretch + 0.25f);
|
||||
bipedRightLegwear.setRotationPoint(-3, yOffset, 0);
|
||||
|
|
|
@ -21,12 +21,13 @@ public class ModelSkeletonPony extends ModelMobPony {
|
|||
public ModelSkeletonPony() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelSkeletonPonyArmor(), new ModelSkeletonPonyArmor());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||
rightArmPose = ModelBiped.ArmPose.EMPTY;
|
||||
leftArmPose = ModelBiped.ArmPose.EMPTY;
|
||||
|
@ -45,18 +46,18 @@ public class ModelSkeletonPony extends ModelMobPony {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||
super.rotateLegs(move, swing, tick, entity);
|
||||
aimBow(leftArmPose, rightArmPose, tick);
|
||||
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||
super.rotateLegs(move, swing, ticks, entity);
|
||||
aimBow(leftArmPose, rightArmPose, ticks);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void fixSpecialRotationPoints(float move) {
|
||||
if (rightArmPose != ArmPose.EMPTY && !metadata.hasMagic()) {
|
||||
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: HACK It would be better to just change the size of the legs.
|
||||
private void renderScaledArm(ModelRenderer arm, float x, float y, float z) {
|
||||
scale(x, y, z);
|
||||
|
|
|
@ -16,25 +16,25 @@ public class ModelVillagerPony extends ModelPlayerPony {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
|
||||
float swing = 0;
|
||||
float angleY = 0;
|
||||
if (swingProgress > -9990.0F && !metadata.hasMagic()) {
|
||||
swing = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.04F;
|
||||
angleY = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.04F;
|
||||
}
|
||||
bag.rotateAngleY = swing;
|
||||
apron.rotateAngleY = swing;
|
||||
trinket.rotateAngleY = swing;
|
||||
bag.rotateAngleY = angleY;
|
||||
apron.rotateAngleY = angleY;
|
||||
trinket.rotateAngleY = angleY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBody(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
super.renderBody(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
protected void renderBody(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
|
||||
super.renderBody(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
|
||||
if (entityIn instanceof EntityVillager) {
|
||||
if (entity instanceof EntityVillager) {
|
||||
bipedBody.postRender(this.scale);
|
||||
int profession = ((EntityVillager) entityIn).getProfession();
|
||||
int profession = ((EntityVillager) entity).getProfession();
|
||||
if (profession < 2) {
|
||||
bag.render(scale);
|
||||
} else if (profession == 2) {
|
||||
|
@ -43,7 +43,7 @@ public class ModelVillagerPony extends ModelPlayerPony {
|
|||
apron.render(scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +57,7 @@ public class ModelVillagerPony extends ModelPlayerPony {
|
|||
@Override
|
||||
protected void initPositions(float yOffset, float stretch) {
|
||||
super.initPositions(yOffset, stretch);
|
||||
|
||||
|
||||
bag.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(56, 25).addBackPlane(-7, -5, -4, 3, 6, stretch) //right bag front
|
||||
|
@ -75,7 +75,7 @@ public class ModelVillagerPony extends ModelPlayerPony {
|
|||
.tex(56, 22).addBottomPlane(2, 1, -2, 8, 3, stretch) //right bag bottom
|
||||
.addBottomPlane(2, 1, -13, 8, 3, stretch) //left bag bottom
|
||||
.rotateAngleY = 4.712389F;
|
||||
|
||||
|
||||
apron.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addBackPlane(-4, -4, -9, 8, 10, stretch);
|
||||
|
|
|
@ -11,16 +11,16 @@ public class ModelZombiePony extends ModelMobPony {
|
|||
public ModelZombiePony() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelZombiePonyArmor(), new ModelZombiePonyArmor());
|
||||
}
|
||||
|
||||
|
||||
private boolean isRight(float move) {
|
||||
return MathHelper.sin(move / 20) < 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void rotateRightArm(float move, float tick) {
|
||||
if (rightArmPose != ArmPose.EMPTY) return;
|
||||
|
|
|
@ -11,11 +11,11 @@ public interface ITriggerPixelMapped<T extends Enum<T> & ITriggerPixelMapped<T>>
|
|||
* Gets the pixel colour matching this enum value.
|
||||
*/
|
||||
int getTriggerPixel();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the enum value corresponding to the given enum type and pixel value.
|
||||
* If none are found, the first parameter is returned as the default.
|
||||
*
|
||||
*
|
||||
* @param type Return type and default value.
|
||||
* @param pixelValue The pixel colour to search for.
|
||||
*/
|
||||
|
|
|
@ -34,16 +34,16 @@ public class Pony {
|
|||
private final boolean smallArms;
|
||||
|
||||
public Pony(ResourceLocation resource, boolean slim) {
|
||||
this.texture = resource;
|
||||
this.metadata = this.checkSkin(this.texture);
|
||||
this.smallArms = slim;
|
||||
texture = resource;
|
||||
metadata = checkSkin(texture);
|
||||
smallArms = slim;
|
||||
}
|
||||
|
||||
private IPonyData checkSkin(ResourceLocation textureResourceLocation) {
|
||||
IPonyData data = checkPonyMeta(textureResourceLocation);
|
||||
if (data != null) return data;
|
||||
|
||||
BufferedImage skinImage = this.getBufferedImage(textureResourceLocation);
|
||||
BufferedImage skinImage = getBufferedImage(textureResourceLocation);
|
||||
return this.checkSkin(skinImage);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class Pony {
|
|||
|
||||
private IPonyData checkSkin(BufferedImage bufferedimage) {
|
||||
if (bufferedimage == null) return new PonyData();
|
||||
MineLittlePony.logger.debug("\tStart skin check for pony #{} with image {}.", this.ponyId, bufferedimage);
|
||||
MineLittlePony.logger.debug("\tStart skin check for pony #{} with image {}.", ponyId, bufferedimage);
|
||||
return PonyData.parse(bufferedimage);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,19 +20,19 @@ public class PonyData implements IPonyData {
|
|||
private final int glowColor;
|
||||
|
||||
public PonyData() {
|
||||
this.race = PonyRace.HUMAN;
|
||||
this.tailSize = TailLengths.FULL;
|
||||
this.gender = PonyGender.MARE;
|
||||
this.size = PonySize.NORMAL;
|
||||
this.glowColor = 0x4444aa;
|
||||
race = PonyRace.HUMAN;
|
||||
tailSize = TailLengths.FULL;
|
||||
gender = PonyGender.MARE;
|
||||
size = PonySize.NORMAL;
|
||||
glowColor = 0x4444aa;
|
||||
}
|
||||
|
||||
|
||||
private PonyData(BufferedImage image) {
|
||||
this.race = TriggerPixels.RACE.readValue(image);
|
||||
this.tailSize = TriggerPixels.TAIL.readValue(image);
|
||||
this.size = TriggerPixels.SIZE.readValue(image);
|
||||
this.gender = TriggerPixels.GENDER.readValue(image);
|
||||
this.glowColor = TriggerPixels.GLOW.readColor(image, -1);
|
||||
race = TriggerPixels.RACE.readValue(image);
|
||||
tailSize = TriggerPixels.TAIL.readValue(image);
|
||||
size = TriggerPixels.SIZE.readValue(image);
|
||||
gender = TriggerPixels.GENDER.readValue(image);
|
||||
glowColor = TriggerPixels.GLOW.readColor(image, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class PonyData implements IPonyData {
|
|||
|
||||
@Override
|
||||
public boolean hasMagic() {
|
||||
return this.race != null && this.race.hasHorn() && this.glowColor != 0;
|
||||
return race != null && race.hasHorn() && glowColor != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,9 +3,9 @@ package com.minelittlepony.pony.data;
|
|||
public enum PonyGender implements ITriggerPixelMapped<PonyGender> {
|
||||
MARE(0),
|
||||
STALLION(0xffffff);
|
||||
|
||||
|
||||
private int triggerValue;
|
||||
|
||||
|
||||
PonyGender(int pixel) {
|
||||
triggerValue = pixel;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
|
|||
private boolean horn;
|
||||
|
||||
private int triggerPixel;
|
||||
|
||||
|
||||
private PlayerModels model;
|
||||
|
||||
PonyRace(int triggerPixel, PlayerModels model, boolean wings, boolean horn) {
|
||||
this.triggerPixel = triggerPixel;
|
||||
|
||||
|
||||
this.wings = wings;
|
||||
this.horn = horn;
|
||||
this.model = model;
|
||||
|
|
|
@ -7,7 +7,7 @@ public enum PonySize implements ITriggerPixelMapped<PonySize> {
|
|||
TALL(0x534b76, 0.45f, 1f);
|
||||
|
||||
private int triggerValue;
|
||||
|
||||
|
||||
private float shadowSize;
|
||||
private float scale;
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@ public enum TailLengths implements ITriggerPixelMapped<TailLengths> {
|
|||
HALF(0x534b76),
|
||||
THREE_QUARTERS(0x8a6b7f),
|
||||
FULL(0);
|
||||
|
||||
|
||||
private int triggerValue;
|
||||
|
||||
|
||||
TailLengths(int pixel) {
|
||||
triggerValue = pixel;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getTriggerPixel() {
|
||||
return triggerValue;
|
||||
|
|
|
@ -15,15 +15,15 @@ public enum TriggerPixels {
|
|||
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
|
||||
ITriggerPixelMapped<?> def;
|
||||
|
||||
|
||||
TriggerPixels(ITriggerPixelMapped<?> def, int x, int y) {
|
||||
this.def = def;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads tis trigger pixel's value and returns the raw colour value.
|
||||
* @param image Image to read
|
||||
|
@ -35,7 +35,7 @@ public enum TriggerPixels {
|
|||
|
||||
/**
|
||||
* Reads this trigger pixel's value and parses it to an Enum instance.
|
||||
*
|
||||
*
|
||||
* @param image Image to read
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -16,7 +16,7 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
protected float modelOffsetX;
|
||||
protected float modelOffsetY;
|
||||
protected float modelOffsetZ;
|
||||
|
||||
|
||||
public AbstractPonyRenderer(ModelBase model) {
|
||||
super(model);
|
||||
baseModel = model;
|
||||
|
@ -26,7 +26,7 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
super(model, x, y);
|
||||
baseModel = model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to create a new instance of this renderer (used for child renderers)
|
||||
*/
|
||||
|
@ -39,37 +39,37 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
super.setTextureOffset(x, y);
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flips the mirror flag. All faces are mirrored until this is called again.
|
||||
*/
|
||||
public T mirror() {
|
||||
return mirror(!mirror);
|
||||
}
|
||||
|
||||
|
||||
public T mirror(boolean m) {
|
||||
mirror = m;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the texture offset
|
||||
*/
|
||||
public T tex(int x, int y) {
|
||||
return setTextureOffset(x, y);
|
||||
}
|
||||
|
||||
|
||||
public T size(int x, int y) {
|
||||
return (T) setTextureSize(x, y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Positions this model in space.
|
||||
*/
|
||||
public T at(float x, float y, float z) {
|
||||
return (T)at(this, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets an offset to be used on all shapes and children created through this renderer.
|
||||
*/
|
||||
|
@ -79,20 +79,20 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
modelOffsetZ = z;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
||||
public static <T extends ModelRenderer> T at(T renderer, float x, float y, float z) {
|
||||
renderer.offsetX = x / 16;
|
||||
renderer.offsetY = y / 16;
|
||||
renderer.offsetZ = z / 16;
|
||||
return renderer;
|
||||
}
|
||||
|
||||
|
||||
public void rotateTo(ModelRenderer other) {
|
||||
rotateAngleX = other.rotateAngleX;
|
||||
rotateAngleY = other.rotateAngleY;
|
||||
rotateAngleZ = other.rotateAngleZ;
|
||||
}
|
||||
|
||||
|
||||
public T rotateAt(ModelRenderer other) {
|
||||
return around(other.rotationPointX, other.rotationPointY, other.rotationPointZ);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
setRotationPoint(x, y, z);
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets or creates a new child model based on its unique index.
|
||||
* New children will be of the same type and inherit the same textures and offsets of the original.
|
||||
|
@ -134,27 +134,29 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T addBox(float offX, float offY, float offZ, int width, int height, int depth, boolean mirrored) {
|
||||
addBox(offX, offY, offZ, width, height, depth, 0, mirrored);
|
||||
return (T)this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) {
|
||||
addBox(offX, offY, offZ, width, height, depth, scaleFactor, mirror);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a textured box.
|
||||
*/
|
||||
public T box(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) {
|
||||
return addBox(offX, offY, offZ, width, height, depth, scaleFactor, mirror);
|
||||
}
|
||||
|
||||
|
||||
private T addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor, boolean mirrored) {
|
||||
createBox(modelOffsetX + offX, modelOffsetY + offY, modelOffsetZ + offZ, width, height, depth, scaleFactor, mirrored);
|
||||
return (T)this;
|
||||
}
|
||||
|
||||
|
||||
protected void createBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor, boolean mirrored) {
|
||||
cubeList.add(new ModelBox(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, mirrored));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class HornGlow extends ModelBox {
|
|||
this.parent = parent;
|
||||
this.alpha = alpha;
|
||||
|
||||
this.quadList = new TexturedQuad[6];
|
||||
quadList = new TexturedQuad[6];
|
||||
|
||||
float x2 = x + w + scale;
|
||||
float y2 = y + h + scale;
|
||||
|
@ -51,12 +51,12 @@ public class HornGlow extends ModelBox {
|
|||
PositionTextureVertex p5 = new PositionTextureVertex(x2, y2, z2, 8, 8);
|
||||
PositionTextureVertex p6 = new PositionTextureVertex(x, y2, z2, 8, 0);
|
||||
|
||||
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{p4, p0, p1, p5}, texU + d + w, texV + d, texU + d + w + d, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{p7, p3, p6, p2}, texU, texV + d, texU + d, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{p4, p3, p7, p0}, texU + d, texV, texU + d + w, texV + d, parent.textureWidth, parent.textureHeight);
|
||||
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{p1, p2, p6, p5}, texU + d + w, texV + d, texU + d + w + w, texV, parent.textureWidth, parent.textureHeight);
|
||||
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{p0, p7, p2, p1}, texU + d, texV + d, texU + d + w, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{p3, p4, p5, p6}, texU + d + w + d, texV + d, texU + d + w + d + w, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
quadList[0] = new TexturedQuad(new PositionTextureVertex[]{p4, p0, p1, p5}, texU + d + w, texV + d, texU + d + w + d, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
quadList[1] = new TexturedQuad(new PositionTextureVertex[]{p7, p3, p6, p2}, texU, texV + d, texU + d, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
quadList[2] = new TexturedQuad(new PositionTextureVertex[]{p4, p3, p7, p0}, texU + d, texV, texU + d + w, texV + d, parent.textureWidth, parent.textureHeight);
|
||||
quadList[3] = new TexturedQuad(new PositionTextureVertex[]{p1, p2, p6, p5}, texU + d + w, texV + d, texU + d + w + w, texV, parent.textureWidth, parent.textureHeight);
|
||||
quadList[4] = new TexturedQuad(new PositionTextureVertex[]{p0, p7, p2, p1}, texU + d, texV + d, texU + d + w, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
quadList[5] = new TexturedQuad(new PositionTextureVertex[]{p3, p4, p5, p6}, texU + d + w + d, texV + d, texU + d + w + d + w, texV + d + h, parent.textureWidth, parent.textureHeight);
|
||||
|
||||
if (parent.mirror) {
|
||||
for (TexturedQuad i : quadList) {
|
||||
|
|
|
@ -11,7 +11,7 @@ public class PonyRenderer extends AbstractPonyRenderer<PonyRenderer> {
|
|||
public PonyRenderer(ModelBase model, int x, int y) {
|
||||
super(model, x, y);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected PonyRenderer copySelf() {
|
||||
return new PonyRenderer(baseModel, textureOffsetX, textureOffsetY);
|
||||
|
|
|
@ -20,48 +20,50 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
|||
|
||||
protected ModelWrapper playerModel;
|
||||
|
||||
public RenderPonyMob(RenderManager renderManager, ModelWrapper playerModel) {
|
||||
super(renderManager, playerModel.getModel(), 0.5F);
|
||||
this.playerModel = playerModel;
|
||||
public RenderPonyMob(RenderManager manager, ModelWrapper model) {
|
||||
super(manager, model.getModel(), 0.5F);
|
||||
playerModel = model;
|
||||
|
||||
addLayers();
|
||||
}
|
||||
|
||||
protected void addLayers() {
|
||||
|
||||
this.addLayer(new LayerPonyArmor(this));
|
||||
this.addLayer(new LayerHeldPonyItem(this));
|
||||
// this.addLayer(new LayerArrow(this));
|
||||
this.addLayer(new LayerPonyCustomHead(this));
|
||||
this.addLayer(new LayerPonyElytra(this));
|
||||
addLayer(new LayerPonyArmor(this));
|
||||
addLayer(new LayerHeldPonyItem(this));
|
||||
// addLayer(new LayerArrow(this));
|
||||
addLayer(new LayerPonyCustomHead(this));
|
||||
addLayer(new LayerPonyElytra(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(T entity, double xPosition, double yPosition, double zPosition, float yaw, float partialTicks) {
|
||||
double yOrigin = yPosition;
|
||||
public void doRender(T entity, double xPosition, double yPosition, double zPosition, float yaw, float ticks) {
|
||||
if (entity.isSneaking()) {
|
||||
yOrigin -= 0.125D;
|
||||
yPosition -= 0.125D;
|
||||
}
|
||||
super.doRender(entity, xPosition, yOrigin, zPosition, yaw, partialTicks);
|
||||
super.doRender(entity, xPosition, yPosition, zPosition, yaw, ticks);
|
||||
}
|
||||
|
||||
@Override
|
||||
@OverridingMethodsMustInvokeSuper
|
||||
protected void preRenderCallback(T entity, float partialTickTime) {
|
||||
this.playerModel.getModel().isSneak = false;
|
||||
this.playerModel.getModel().isFlying = false;
|
||||
this.playerModel.getModel().isSleeping = false;
|
||||
protected void preRenderCallback(T entity, float ticks) {
|
||||
playerModel.getModel().isSneak = false;
|
||||
playerModel.getModel().isFlying = false;
|
||||
playerModel.getModel().isSleeping = false;
|
||||
|
||||
ResourceLocation loc = getEntityTexture(entity);
|
||||
this.playerModel.apply(MineLittlePony.getInstance().getManager().getPony(loc, false).getMetadata());
|
||||
playerModel.apply(MineLittlePony.getInstance().getManager().getPony(loc, false).getMetadata());
|
||||
|
||||
shadowSize = getShadowScale();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getShadowScale() {
|
||||
if (mainModel.isChild) {
|
||||
this.shadowSize = 0.25F;
|
||||
return 0.25F;
|
||||
} else if (MineLittlePony.getConfig().showscale) {
|
||||
this.shadowSize = 0.4F;
|
||||
} else {
|
||||
this.shadowSize = 0.5F;
|
||||
return 0.4F;
|
||||
}
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,18 +17,19 @@ 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) {
|
||||
@Override
|
||||
public final void doRenderLayer(T entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
ModelBase model = renderer.getMainModel();
|
||||
if (model instanceof ModelHumanPlayer) {
|
||||
// render the human layer
|
||||
layer.doRenderLayer(entity, limbSwing, limbSwingAmount, ticks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
layer.doRenderLayer(entity, move, swing, ticks, age, headYaw, headPitch, scale);
|
||||
} else {
|
||||
// render the pony layer
|
||||
doPonyRender(entity, limbSwing, limbSwingAmount, ticks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
doPonyRender(entity, move, swing, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void doPonyRender(T entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks, float netHeadYaw, float headPitch, float scale);
|
||||
protected abstract void doPonyRender(T entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale);
|
||||
|
||||
protected RenderLivingBase<? extends T> getRenderer() {
|
||||
return renderer;
|
||||
|
|
|
@ -21,16 +21,18 @@ import javax.annotation.Nullable;
|
|||
|
||||
public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
||||
|
||||
private final RenderManager rm;
|
||||
private final RenderManager renderManager;
|
||||
|
||||
private EntityLivingBase leftEntity;
|
||||
private EntityLivingBase rightEntity;
|
||||
|
||||
public LayerEntityOnPonyShoulder(RenderManager rm, RenderLivingBase<AbstractClientPlayer> renderer) {
|
||||
super(renderer, getForgeLayer(rm));
|
||||
this.rm = rm;
|
||||
public LayerEntityOnPonyShoulder(RenderManager manager, RenderLivingBase<AbstractClientPlayer> renderer) {
|
||||
super(renderer, getForgeLayer(manager));
|
||||
renderManager = manager;
|
||||
}
|
||||
|
||||
public void doPonyRender(EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
@Override
|
||||
public void doPonyRender(EntityPlayer player, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
|
@ -38,15 +40,15 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
NBTTagCompound leftTag = player.getLeftShoulderEntity();
|
||||
|
||||
if (!leftTag.hasNoTags()) {
|
||||
this.leftEntity = this.renderShoulderEntity(player, this.leftEntity, leftTag,
|
||||
limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, true);
|
||||
leftEntity = renderShoulderEntity(player, leftEntity,
|
||||
leftTag, move, swing, ticks, age, headYaw, headPitch, scale, true);
|
||||
}
|
||||
|
||||
NBTTagCompound rightTag = player.getRightShoulderEntity();
|
||||
|
||||
if (!rightTag.hasNoTags()) {
|
||||
this.rightEntity = this.renderShoulderEntity(player, this.rightEntity, rightTag,
|
||||
limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, false);
|
||||
rightEntity = renderShoulderEntity(player, rightEntity,
|
||||
rightTag, move, swing, ticks, age, headYaw, headPitch, scale, false);
|
||||
}
|
||||
|
||||
GlStateManager.disableRescaleNormal();
|
||||
|
@ -54,7 +56,8 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
private EntityLivingBase renderShoulderEntity(EntityPlayer player, @Nullable EntityLivingBase entity, NBTTagCompound tag, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, boolean left) {
|
||||
private EntityLivingBase renderShoulderEntity(EntityPlayer player, @Nullable EntityLivingBase entity, NBTTagCompound tag,
|
||||
float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale, boolean left) {
|
||||
|
||||
if (entity == null || !entity.getUniqueID().equals(tag.getUniqueId("UUID"))) {
|
||||
entity = (EntityLivingBase) EntityList.createEntityFromNBT(tag, player.world);
|
||||
|
@ -74,7 +77,7 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
GlStateManager.scale(1, -1, -1);
|
||||
GlStateManager.rotate(5 * (left ? -1 : 1), 0, 0, 1);
|
||||
|
||||
Render<Entity> render = rm.getEntityRenderObject(entity);
|
||||
Render<Entity> render = renderManager.getEntityRenderObject(entity);
|
||||
if (render != null) {
|
||||
render.doRender(entity, 0, 0, 0, 0, 0);
|
||||
GlStateManager.popMatrix();
|
||||
|
@ -82,9 +85,9 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<EntityPlayer> {
|
|||
return entity;
|
||||
}
|
||||
|
||||
private static LayerRenderer<EntityPlayer> getForgeLayer(RenderManager rm) {
|
||||
private static LayerRenderer<EntityPlayer> getForgeLayer(RenderManager manager) {
|
||||
return ForgeProxy.createShoulderLayer()
|
||||
.orElse(LayerEntityOnShoulder::new)
|
||||
.apply(rm);
|
||||
.apply(manager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import net.minecraft.client.model.ModelBiped;
|
|||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -33,13 +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 move, float swing, float ticks, float age, float headYaw, float headPitch, 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;
|
||||
|
||||
|
@ -55,36 +55,39 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
|
|||
scale(.5, .5, .5);
|
||||
}
|
||||
|
||||
renderHeldItem(entity, right, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
|
||||
renderHeldItem(entity, left, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
|
||||
renderHeldItem(entity, right, TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
|
||||
renderHeldItem(entity, left, TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
|
||||
|
||||
popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) {
|
||||
private void renderHeldItem(EntityLivingBase entity, ItemStack drop, TransformType transform, EnumHandSide hand) {
|
||||
if (!drop.isEmpty()) {
|
||||
GlStateManager.pushMatrix();
|
||||
translateToHand(hand);
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
GlStateManager.translate(0.0F, 0.2F, 0.0F);
|
||||
GlStateManager.translate(0, 0.2F, 0);
|
||||
}
|
||||
|
||||
GlStateManager.rotate(-90.0F, 1, 0, 0);
|
||||
GlStateManager.rotate(180.0F, 0, 1, 0);
|
||||
boolean isUnicorn = isUnicorn(this.getRenderer().getMainModel());
|
||||
GlStateManager.rotate(-90, 1, 0, 0);
|
||||
GlStateManager.rotate(180, 0, 1, 0);
|
||||
|
||||
boolean isUnicorn = isUnicorn(getRenderer().getMainModel());
|
||||
boolean isLeft = hand == EnumHandSide.LEFT;
|
||||
|
||||
if (isUnicorn) {
|
||||
GlStateManager.translate(isLeft ? -0.6F : 0.1F, 1, -0.5F);
|
||||
} else {
|
||||
GlStateManager.translate(0.0425F, 0.125F, -1);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity, drop, transform, isLeft);
|
||||
|
||||
if (isUnicorn) {
|
||||
IPonyData metadata = ((AbstractPonyModel) this.getRenderer().getMainModel()).metadata;
|
||||
this.renderItemGlow(entity, drop, transform, hand, metadata.getGlowColor());
|
||||
IPonyData metadata = ((AbstractPonyModel) getRenderer().getMainModel()).metadata;
|
||||
renderItemGlow(entity, drop, transform, hand, metadata.getGlowColor());
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
@ -95,18 +98,17 @@ public class LayerHeldPonyItem extends AbstractPonyLayer<EntityLivingBase> {
|
|||
}
|
||||
|
||||
protected void translateToHand(EnumHandSide hand) {
|
||||
AbstractPonyModel thePony = ((IRenderPony) this.getRenderer()).getPlayerModel().getModel();
|
||||
AbstractPonyModel thePony = ((IRenderPony) getRenderer()).getPlayerModel().getModel();
|
||||
if (thePony.metadata.hasMagic()) {
|
||||
ModelPlayerPony playerModel = (ModelPlayerPony) thePony;
|
||||
ModelRenderer unicornarm = hand == EnumHandSide.LEFT ? playerModel.unicornArmLeft : playerModel.unicornArmRight;
|
||||
unicornarm.postRender(0.0625F);
|
||||
} else {
|
||||
((ModelBiped) this.getRenderer().getMainModel()).postRenderArm(0.0625F, hand);
|
||||
((ModelBiped) getRenderer().getMainModel()).postRenderArm(0.0625F, hand);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderItemGlow(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand,
|
||||
int glowColor) {
|
||||
public void renderItemGlow(EntityLivingBase entity, ItemStack drop, TransformType transform, EnumHandSide hand, int glowColor) {
|
||||
|
||||
// enchantments mess up the rendering
|
||||
ItemStack drop2 = drop.copy();
|
||||
|
|
|
@ -12,7 +12,7 @@ public abstract class LayerOverlayBase<T extends EntityLiving> implements LayerR
|
|||
protected final RenderLivingBase<?> renderer;
|
||||
|
||||
public LayerOverlayBase(RenderLivingBase<?> render) {
|
||||
this.renderer = render;
|
||||
renderer = render;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,12 +20,15 @@ public abstract class LayerOverlayBase<T extends EntityLiving> implements LayerR
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void renderOverlay(T skele, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
ModelBase overlayModel = this.getOverlayModel();
|
||||
overlayModel.setModelAttributes(this.renderer.getMainModel());
|
||||
overlayModel.setLivingAnimations(skele, limbSwing, limbSwingAmount, partialTicks);
|
||||
renderer.bindTexture(this.getOverlayTexture());
|
||||
overlayModel.render(skele, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
protected void renderOverlay(T entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
ModelBase overlayModel = getOverlayModel();
|
||||
|
||||
overlayModel.setModelAttributes(renderer.getMainModel());
|
||||
overlayModel.setLivingAnimations(entity, move, swing, ticks);
|
||||
|
||||
renderer.bindTexture(getOverlayTexture());
|
||||
|
||||
overlayModel.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
}
|
||||
|
||||
protected abstract ModelBase getOverlayModel();
|
||||
|
|
|
@ -23,6 +23,9 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.Tuple;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -40,17 +43,17 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doPonyRender(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float ticks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
public void doPonyRender(EntityLivingBase entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
pony = ((IRenderPony) getRenderer()).getPlayerModel();
|
||||
|
||||
|
||||
for (EntityEquipmentSlot i : EntityEquipmentSlot.values()) {
|
||||
if (i.getSlotType() == Type.ARMOR) {
|
||||
renderArmor(entity, limbSwing, limbSwingAmount, ticks, ageInTicks, netHeadYaw, headPitch, scale, i);
|
||||
renderArmor(entity, move, swing, ticks, age, headYaw, headPitch, scale, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderArmor(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot armorSlot) {
|
||||
private void renderArmor(EntityLivingBase entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale, EntityEquipmentSlot armorSlot) {
|
||||
ItemStack itemstack = entity.getItemStackFromSlot(armorSlot);
|
||||
|
||||
if (!itemstack.isEmpty() && itemstack.getItem() instanceof ItemArmor) {
|
||||
|
@ -59,33 +62,33 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
|
|||
|
||||
AbstractPonyModel modelbase;
|
||||
if (armorSlot == EntityEquipmentSlot.LEGS) {
|
||||
modelbase = pony.getArmor().modelArmor;
|
||||
modelbase = pony.getArmor().armour;
|
||||
} else {
|
||||
modelbase = pony.getArmor().modelArmorChestplate;
|
||||
modelbase = pony.getArmor().chestplate;
|
||||
}
|
||||
modelbase = getArmorModel(entity, itemstack, armorSlot, modelbase);
|
||||
modelbase.setModelAttributes(this.pony.getModel());
|
||||
modelbase.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
|
||||
modelbase.setModelAttributes(pony.getModel());
|
||||
modelbase.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
|
||||
|
||||
Tuple<ResourceLocation, Boolean> armors = getArmorTexture(entity, itemstack, armorSlot, null);
|
||||
prepareToRender((ModelPonyArmor) modelbase, armorSlot, armors.getSecond());
|
||||
|
||||
this.getRenderer().bindTexture(armors.getFirst());
|
||||
getRenderer().bindTexture(armors.getFirst());
|
||||
if (itemarmor.getArmorMaterial() == ArmorMaterial.LEATHER) {
|
||||
int color = itemarmor.getColor(itemstack);
|
||||
float r = (color >> 16 & 255) / 255.0F;
|
||||
float g = (color >> 8 & 255) / 255.0F;
|
||||
float b = (color & 255) / 255.0F;
|
||||
GlStateManager.color(r, g, b, 1);
|
||||
modelbase.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
modelbase.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
armors = getArmorTexture(entity, itemstack, armorSlot, "overlay");
|
||||
this.getRenderer().bindTexture(armors.getFirst());
|
||||
getRenderer().bindTexture(armors.getFirst());
|
||||
}
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
modelbase.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
modelbase.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
|
||||
if (itemstack.isItemEnchanted()) {
|
||||
this.renderEnchantment(entity, modelbase, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
renderEnchantment(entity, modelbase, move, swing, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,8 +138,8 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
|
|||
model.bipedLeftArm.showModel = true;
|
||||
model.bipedRightLeg.showModel = !isPony;
|
||||
model.bipedLeftLeg.showModel = !isPony;
|
||||
model.extLegLeft.showModel = isPony;
|
||||
model.extLegRight.showModel = isPony;
|
||||
model.leftLegging.showModel = isPony;
|
||||
model.rightLegging.showModel = isPony;
|
||||
break;
|
||||
// legs
|
||||
case LEGS:
|
||||
|
@ -145,55 +148,63 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
|
|||
model.bipedRightArm.showModel = true;
|
||||
model.bipedLeftArm.showModel = true;
|
||||
model.bipedBody.showModel = !isPony;
|
||||
model.Bodypiece.showModel = !isPony;
|
||||
model.extBody.showModel = isPony;
|
||||
model.extLegLeft.showModel = isPony;
|
||||
model.extLegRight.showModel = isPony;
|
||||
model.flankGuard.showModel = !isPony;
|
||||
model.saddle.showModel = isPony;
|
||||
model.leftLegging.showModel = isPony;
|
||||
model.rightLegging.showModel = isPony;
|
||||
break;
|
||||
// chest
|
||||
case CHEST:
|
||||
model.extBody.showModel = isPony;
|
||||
model.saddle.showModel = isPony;
|
||||
model.bipedBody.showModel = !isPony;
|
||||
model.Bodypiece.showModel = !isPony;
|
||||
model.flankGuard.showModel = !isPony;
|
||||
break;
|
||||
// head
|
||||
case HEAD:
|
||||
model.bipedHead.showModel = true;
|
||||
model.extHead.showModel = isPony;
|
||||
model.helmet.showModel = isPony;
|
||||
}
|
||||
}
|
||||
|
||||
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 = entity.ticksExisted + p_177183_5_;
|
||||
this.getRenderer().bindTexture(ENCHANTED_ITEM_GLINT_RES);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.depthFunc(514);
|
||||
GlStateManager.depthMask(false);
|
||||
float f8 = 0.5F;
|
||||
GlStateManager.color(f8, f8, f8, 1.0F);
|
||||
private void renderEnchantment(EntityLivingBase entity, ModelBase model, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
getRenderer().bindTexture(ENCHANTED_ITEM_GLINT_RES);
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.depthFunc(GL11.GL_EQUAL);
|
||||
GlStateManager.depthMask(false);
|
||||
|
||||
float brightness = 0.5F;
|
||||
GlStateManager.color(brightness, brightness, brightness, 1);
|
||||
|
||||
float baseYOffset = entity.ticksExisted + ticks;
|
||||
float glintBrightness = 0.76F;
|
||||
float scaleFactor = 0.33333334F;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.blendFunc(768, 1);
|
||||
float f9 = 0.76F;
|
||||
GlStateManager.color(0.5F * f9, 0.25F * f9, 0.8F * f9, 1.0F);
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
|
||||
GlStateManager.color(glintBrightness / 2, glintBrightness / 4, 0.8F * glintBrightness, 1);
|
||||
|
||||
GlStateManager.matrixMode(5890);
|
||||
GlStateManager.loadIdentity();
|
||||
float f10 = 0.33333334F;
|
||||
GlStateManager.scale(f10, f10, f10);
|
||||
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);
|
||||
model.render(entity, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, p_177183_9_);
|
||||
|
||||
|
||||
GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);
|
||||
GlStateManager.rotate(30 - i * 60, 0, 0, 1);
|
||||
GlStateManager.translate(0, baseYOffset * (0.02F + i * 0.06F), 0);
|
||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
model.render(entity, move, swing, age, headYaw, headPitch, scale);
|
||||
}
|
||||
|
||||
GlStateManager.matrixMode(5890);
|
||||
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
||||
GlStateManager.loadIdentity();
|
||||
GlStateManager.matrixMode(5888);
|
||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.depthFunc(515);
|
||||
GlStateManager.depthFunc(GL11.GL_LEQUAL);
|
||||
GlStateManager.disableBlend();
|
||||
}
|
||||
|
||||
|
@ -207,8 +218,7 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
|
|||
String domain = human.getResourceDomain();
|
||||
String path = human.getResourcePath();
|
||||
if (domain.equals("minecraft")) {
|
||||
// it's a vanilla armor. I provide these.
|
||||
domain = "minelittlepony";
|
||||
domain = "minelittlepony"; // it's a vanilla armor. I provide these.
|
||||
}
|
||||
path = path.replace(".png", "_pony.png");
|
||||
pony = new ResourceLocation(domain, path);
|
||||
|
|
|
@ -25,46 +25,47 @@ public class LayerPonyCape extends AbstractPonyLayer<AbstractClientPlayer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doPonyRender(@Nonnull AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6, float p7, float scale) {
|
||||
public void doPonyRender(@Nonnull AbstractClientPlayer player, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
ModelWrapper model = ((IRenderPony) getRenderer()).getPlayerModel();
|
||||
if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible()
|
||||
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null
|
||||
&& clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() != Items.ELYTRA) {
|
||||
|
||||
if (player.hasPlayerInfo() && !player.isInvisible()
|
||||
&& player.isWearing(EnumPlayerModelParts.CAPE) && player.getLocationCape() != null
|
||||
&& player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() != Items.ELYTRA) {
|
||||
|
||||
pushMatrix();
|
||||
model.getModel().transform(BodyPart.BODY);
|
||||
translate(0, 0.24F, 0);
|
||||
model.getModel().bipedBody.postRender(scale);
|
||||
|
||||
double d = clientPlayer.prevChasingPosX + (clientPlayer.chasingPosX - clientPlayer.prevChasingPosX) * scale - (clientPlayer.prevPosX + (clientPlayer.posX - clientPlayer.prevPosX) * scale);
|
||||
double d1 = clientPlayer.prevChasingPosY + (clientPlayer.chasingPosY - clientPlayer.prevChasingPosY) * scale - (clientPlayer.prevPosY + (clientPlayer.posY - clientPlayer.prevPosY) * scale);
|
||||
double d2 = clientPlayer.prevChasingPosZ + (clientPlayer.chasingPosZ - clientPlayer.prevChasingPosZ) * scale - (clientPlayer.prevPosZ + (clientPlayer.posZ - clientPlayer.prevPosZ) * scale);
|
||||
float f10 = clientPlayer.prevRenderYawOffset + (clientPlayer.renderYawOffset - clientPlayer.prevRenderYawOffset) * scale;
|
||||
double d3 = MathHelper.sin(f10 * PI / 180);
|
||||
double d4 = (-MathHelper.cos(f10 * PI / 180));
|
||||
float f12 = (float) d1 * 10;
|
||||
if (f12 < -6.0F) {
|
||||
f12 = -6.0F;
|
||||
}
|
||||
double capeX = player.prevChasingPosX + (player.chasingPosX - player.prevChasingPosX) * scale - (player.prevPosX + (player.posX - player.prevPosX) * scale);
|
||||
double capeY = player.prevChasingPosY + (player.chasingPosY - player.prevChasingPosY) * scale - (player.prevPosY + (player.posY - player.prevPosY) * scale);
|
||||
double capeZ = player.prevChasingPosZ + (player.chasingPosZ - player.prevChasingPosZ) * scale - (player.prevPosZ + (player.posZ - player.prevPosZ) * scale);
|
||||
|
||||
if (f12 > 32) {
|
||||
f12 = 32;
|
||||
}
|
||||
float motionYaw = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * scale;
|
||||
|
||||
float f13 = (float) (d * d3 + d2 * d4) * 100;
|
||||
float f14 = (float) (d * d4 - d2 * d3) * 100;
|
||||
if (f13 < 0) {
|
||||
f13 = 0;
|
||||
}
|
||||
double sin = MathHelper.sin(motionYaw * PI / 180);
|
||||
double cos = (-MathHelper.cos(motionYaw * PI / 180));
|
||||
|
||||
float f15 = clientPlayer.prevCameraYaw + (clientPlayer.cameraYaw - clientPlayer.prevCameraYaw) * scale;
|
||||
f12 += MathHelper.sin((clientPlayer.prevDistanceWalkedModified + (clientPlayer.distanceWalkedModified - clientPlayer.prevDistanceWalkedModified) * scale) * 6) * 32 * f15;
|
||||
float capeMotionY = (float) capeY * 10;
|
||||
|
||||
rotate(2 + f13 / 12 + f12, 1, 0, 0);
|
||||
rotate(f14 / 2, 0, 0, 1);
|
||||
rotate(-f14 / 2, 0, 1, 0);
|
||||
if (capeMotionY < -6) capeMotionY = -6;
|
||||
if (capeMotionY > 32) capeMotionY = 32;
|
||||
|
||||
float capeMotionX = (float) (capeX * sin + capeZ * cos) * 100;
|
||||
|
||||
float diagMotion = (float) (capeX * cos - capeZ * sin) * 100;
|
||||
|
||||
if (capeMotionX < 0) capeMotionX = 0;
|
||||
|
||||
float camera = player.prevCameraYaw + (player.cameraYaw - player.prevCameraYaw) * scale;
|
||||
capeMotionY += MathHelper.sin((player.prevDistanceWalkedModified + (player.distanceWalkedModified - player.prevDistanceWalkedModified) * scale) * 6) * 32 * camera;
|
||||
|
||||
rotate(2 + capeMotionX / 12 + capeMotionY, 1, 0, 0);
|
||||
rotate( diagMotion / 2, 0, 0, 1);
|
||||
rotate(-diagMotion / 2, 0, 1, 0);
|
||||
rotate(180, 0, 0, 1);
|
||||
rotate(90, 1, 0, 0);
|
||||
this.getRenderer().bindTexture(clientPlayer.getLocationCape());
|
||||
getRenderer().bindTexture(player.getLocationCape());
|
||||
model.getModel().renderCape(0.0625F);
|
||||
popMatrix();
|
||||
}
|
||||
|
|
|
@ -31,33 +31,37 @@ public class LayerPonyCustomHead implements LayerRenderer<EntityLivingBase> {
|
|||
private RenderLivingBase<? extends EntityLivingBase> renderer;
|
||||
|
||||
public LayerPonyCustomHead(RenderLivingBase<? extends EntityLivingBase> renderPony) {
|
||||
this.renderer = renderPony;
|
||||
renderer = renderPony;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float p_177141_3_,
|
||||
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
public void doRenderLayer(EntityLivingBase entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
|
||||
if (!itemstack.isEmpty()) {
|
||||
AbstractPonyModel model = getModel().getModel();
|
||||
Item item = itemstack.getItem();
|
||||
|
||||
pushMatrix();
|
||||
boolean isVillager = entity instanceof EntityVillager || entity instanceof EntityZombieVillager;
|
||||
|
||||
model.transform(BodyPart.HEAD);
|
||||
model.bipedHead.postRender(0.0625f);
|
||||
|
||||
if (model instanceof ModelPlayerPony) {
|
||||
translate(0, 0.2F, 0);
|
||||
} else {
|
||||
translate(0, 0, 0.15F);
|
||||
}
|
||||
|
||||
color(1, 1, 1, 1);
|
||||
|
||||
if (item == Items.SKULL) {
|
||||
renderSkull(itemstack, isVillager, limbSwing);
|
||||
boolean isVillager = entity instanceof EntityVillager || entity instanceof EntityZombieVillager;
|
||||
|
||||
renderSkull(itemstack, isVillager, move);
|
||||
} else if (!(item instanceof ItemArmor) || ((ItemArmor)item).getEquipmentSlot() != EntityEquipmentSlot.HEAD) {
|
||||
renderBlock(entity, itemstack);
|
||||
}
|
||||
|
||||
popMatrix();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ public class LayerPonyElytra extends AbstractPonyLayer<EntityLivingBase> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doPonyRender(@Nonnull EntityLivingBase entity, float swing, float swingAmount, float ticks, float age, float yaw, float head, float scale) {
|
||||
public void doPonyRender(@Nonnull EntityLivingBase entity, float move, float swing, float ticks, float age, float yaw, float head, float scale) {
|
||||
|
||||
AbstractPonyModel model = ((IRenderPony) this.getRenderer()).getPlayerModel().getModel();
|
||||
AbstractPonyModel model = ((IRenderPony) getRenderer()).getPlayerModel().getModel();
|
||||
|
||||
ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
|
||||
|
@ -42,24 +42,24 @@ public class LayerPonyElytra extends AbstractPonyLayer<EntityLivingBase> {
|
|||
|
||||
AbstractClientPlayer player = (AbstractClientPlayer) entity;
|
||||
if (player.isPlayerInfoSet() && player.getLocationElytra() != null) {
|
||||
this.getRenderer().bindTexture(player.getLocationElytra());
|
||||
getRenderer().bindTexture(player.getLocationElytra());
|
||||
} else if (player.hasPlayerInfo() && player.getLocationCape() != null && player.isWearing(EnumPlayerModelParts.CAPE)) {
|
||||
this.getRenderer().bindTexture(player.getLocationCape());
|
||||
getRenderer().bindTexture(player.getLocationCape());
|
||||
} else {
|
||||
this.getRenderer().bindTexture(TEXTURE_ELYTRA);
|
||||
getRenderer().bindTexture(TEXTURE_ELYTRA);
|
||||
}
|
||||
} else {
|
||||
this.getRenderer().bindTexture(TEXTURE_ELYTRA);
|
||||
getRenderer().bindTexture(TEXTURE_ELYTRA);
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0, 0.25F, 0.125F);
|
||||
model.transform(BodyPart.BODY);
|
||||
this.modelElytra.setRotationAngles(swing, swingAmount, age, yaw, head, scale, entity);
|
||||
this.modelElytra.render(entity, swing, swingAmount, age, yaw, head, scale);
|
||||
modelElytra.setRotationAngles(move, swing, age, yaw, head, scale, entity);
|
||||
modelElytra.render(entity, move, swing, age, yaw, head, scale);
|
||||
|
||||
if (itemstack.isItemEnchanted()) {
|
||||
LayerArmorBase.renderEnchantedGlint(this.getRenderer(), entity, this.modelElytra, swing, swingAmount, ticks, age, yaw, head, scale);
|
||||
LayerArmorBase.renderEnchantedGlint(getRenderer(), entity, modelElytra, move, swing, ticks, age, yaw, head, scale);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
|
|
@ -15,18 +15,18 @@ public class LayerPonyStrayOverlay extends LayerOverlayBase<EntityStray> {
|
|||
|
||||
public LayerPonyStrayOverlay(RenderLivingBase<?> render) {
|
||||
super(render);
|
||||
this.overlayModel = new ModelSkeletonPony();
|
||||
this.overlayModel.init(0, 0.25F);
|
||||
overlayModel = new ModelSkeletonPony();
|
||||
overlayModel.init(0, 0.25F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityStray skele, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.renderOverlay(skele, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
public void doRenderLayer(EntityStray entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
renderOverlay(entity, move, swing, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ModelBase getOverlayModel() {
|
||||
return this.overlayModel;
|
||||
return overlayModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,20 +10,20 @@ import javax.annotation.Nonnull;
|
|||
public class ModelPlane extends ModelBox {
|
||||
|
||||
private TexturedQuad quad;
|
||||
|
||||
|
||||
public boolean hidden = false;
|
||||
|
||||
|
||||
public ModelPlane(PlaneRenderer renderer, int textureX, int textureY, float x, float y, float z, int w, int h, int d, float scale, Face face) {
|
||||
super(renderer, textureX, textureY, x, y, z, w, h, d, scale, false);
|
||||
|
||||
float x2 = x + w + scale;
|
||||
float y2 = y + h + scale;
|
||||
float z2 = z + d + scale;
|
||||
|
||||
|
||||
x -= scale;
|
||||
y -= scale;
|
||||
z -= scale;
|
||||
|
||||
|
||||
if (renderer.mirror) {
|
||||
float v = x2;
|
||||
x2 = x;
|
||||
|
@ -79,6 +79,6 @@ public class ModelPlane extends ModelBox {
|
|||
|
||||
@Override
|
||||
public void render(@Nonnull BufferBuilder renderer, float scale) {
|
||||
if (!hidden) this.quad.draw(renderer, scale);
|
||||
if (!hidden) quad.draw(renderer, scale);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,27 +22,27 @@ import net.minecraft.client.renderer.entity.layers.LayerArrow;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony {
|
||||
|
||||
|
||||
protected final boolean smallArms;
|
||||
|
||||
|
||||
private ModelWrapper playerModel;
|
||||
|
||||
|
||||
protected AbstractPonyModel ponyModel;
|
||||
|
||||
|
||||
private Pony pony;
|
||||
|
||||
|
||||
public RenderPonyBase(RenderManager manager, boolean useSmallArms, String id, ModelWrapper model) {
|
||||
super(manager, useSmallArms);
|
||||
smallArms = useSmallArms;
|
||||
|
||||
|
||||
setPlayerModel(model);
|
||||
|
||||
|
||||
layerRenderers.clear();
|
||||
addExtraLayers();
|
||||
|
||||
|
||||
((IRenderManager)manager).addPlayerSkin(id, this);
|
||||
}
|
||||
|
||||
|
||||
protected void addExtraLayers() {
|
||||
addLayer(new LayerPonyArmor(this));
|
||||
addLayer(new LayerHeldPonyItem(this));
|
||||
|
@ -52,7 +52,7 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
addLayer(new LayerPonyElytra(this));
|
||||
addLayer(new LayerEntityOnPonyShoulder(renderManager, this));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void renderLivingAt(AbstractClientPlayer player, double x, double y, double z) {
|
||||
float s = getScaleFactor();
|
||||
|
@ -61,18 +61,18 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doRender(AbstractClientPlayer player, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
public void doRender(AbstractClientPlayer player, double x, double y, double z, float entityYaw, float ticks) {
|
||||
updateModel(player);
|
||||
|
||||
ponyModel.isSneak = player.isSneaking();
|
||||
ponyModel.isSleeping = player.isPlayerSleeping();
|
||||
ponyModel.isFlying = pony.isPegasusFlying(player);
|
||||
|
||||
shadowSize = getPonyShadowScale();
|
||||
|
||||
super.doRender(player, x, y, z, entityYaw, partialTicks);
|
||||
|
||||
shadowSize = getShadowScale();
|
||||
|
||||
super.doRender(player, x, y, z, entityYaw, ticks);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderRightArm(AbstractClientPlayer player) {
|
||||
updateModel(player);
|
||||
|
@ -88,41 +88,41 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
updateModel(player);
|
||||
bindEntityTexture(player);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0.06, -0.37, -0);
|
||||
GlStateManager.translate(0.06, -0.37, 0);
|
||||
super.renderLeftArm(player);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void applyRotations(AbstractClientPlayer player, float yaw, float pitch, float ticks) {
|
||||
super.applyRotations(player, yaw, pitch, ticks);
|
||||
|
||||
|
||||
double motionX = player.posX - player.prevPosX;
|
||||
double motionY = player.onGround ? 0 : player.posY - player.prevPosY;
|
||||
double motionZ = player.posZ - player.prevPosZ;
|
||||
|
||||
|
||||
if (player.isElytraFlying()) {
|
||||
transformElytraFlight(player, motionX, motionY, motionZ, ticks);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (player.isEntityAlive() && player.isPlayerSleeping()) return;
|
||||
|
||||
|
||||
if (((ModelPlayerPony) ponyModel).rainboom) {
|
||||
transformPegasusFlight(player, motionX, motionY, motionZ, yaw, pitch, ticks);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// require arms to be stretched out (sorry mud ponies, no flight skills for you)
|
||||
ponyModel.motionPitch = 0;
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(AbstractClientPlayer entity) {
|
||||
updateModel(entity);
|
||||
|
||||
@Override
|
||||
public ResourceLocation getEntityTexture(AbstractClientPlayer player) {
|
||||
updateModel(player);
|
||||
return pony.getTexture();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ModelWrapper getPlayerModel() {
|
||||
return playerModel;
|
||||
|
@ -132,21 +132,19 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
playerModel = model;
|
||||
mainModel = ponyModel = playerModel.getModel();
|
||||
}
|
||||
|
||||
|
||||
protected void updateModel(AbstractClientPlayer player) {
|
||||
pony = MineLittlePony.getInstance().getManager().getPony(player);
|
||||
playerModel.apply(pony.getMetadata());
|
||||
}
|
||||
|
||||
|
||||
public Pony getPony() {
|
||||
return pony;
|
||||
}
|
||||
|
||||
protected abstract float getPonyShadowScale();
|
||||
|
||||
|
||||
protected abstract float getScaleFactor();
|
||||
|
||||
protected abstract void transformElytraFlight(AbstractClientPlayer player, double motionX, double motionY, double motionZ, float ticks);
|
||||
|
||||
|
||||
protected abstract void transformPegasusFlight(AbstractClientPlayer player, double motionX, double motionY, double motionZ, float yaw, float pitch, float ticks);
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@ public class RenderPonyPlayer extends RenderPonyBase {
|
|||
public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, String id, ModelWrapper model) {
|
||||
super(renderManager, useSmallArms, id, model);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected float getPonyShadowScale() {
|
||||
public float getShadowScale() {
|
||||
if (!MineLittlePony.getConfig().showscale) return .5f;
|
||||
return getPony().getMetadata().getSize().getShadowSize();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected float getScaleFactor() {
|
||||
return getPony().getMetadata().getSize().getScaleFactor();
|
||||
|
@ -34,7 +34,7 @@ public class RenderPonyPlayer extends RenderPonyBase {
|
|||
protected void transformPegasusFlight(AbstractClientPlayer player, double motionX, double motionY, double motionZ, float yaw, float pitch, float ticks) {
|
||||
double dist = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
double angle = Math.atan2(motionY, dist);
|
||||
|
||||
|
||||
if (!player.capabilities.isFlying) {
|
||||
if (angle > 0) {
|
||||
angle = 0;
|
||||
|
@ -45,9 +45,9 @@ public class RenderPonyPlayer extends RenderPonyBase {
|
|||
|
||||
if (angle > Math.PI / 3) angle = Math.PI / 3;
|
||||
if (angle < -Math.PI / 3) angle = -Math.PI / 3;
|
||||
|
||||
|
||||
ponyModel.motionPitch = (float) Math.toDegrees(angle);
|
||||
|
||||
|
||||
GlStateManager.rotate(ponyModel.motionPitch, 1, 0, 0);
|
||||
GlStateManager.rotate(((IPonyAnimationHolder)player).getStrafeAmount(ticks), 0, 0, 1);
|
||||
}
|
||||
|
|
|
@ -17,21 +17,23 @@ public class RenderPonyEvoker extends RenderPonyMob<EntityEvoker> {
|
|||
|
||||
private static final ResourceLocation EVOKER = new ResourceLocation("minelittlepony", "textures/entity/illager/evoker_pony.png");
|
||||
|
||||
public RenderPonyEvoker(RenderManager rendermanagerIn) {
|
||||
super(rendermanagerIn, PMAPI.illager);
|
||||
public RenderPonyEvoker(RenderManager manager) {
|
||||
super(manager, PMAPI.illager);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addLayers() {
|
||||
this.addLayer(new LayerHeldPonyItem(this) {
|
||||
public void doPonyRender(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
if (((EntitySpellcasterIllager) entitylivingbaseIn).isSpellcasting()) {
|
||||
super.doPonyRender(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
addLayer(new LayerHeldPonyItem(this) {
|
||||
@Override
|
||||
public void doPonyRender(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
if (((EntitySpellcasterIllager) entity).isSpellcasting()) {
|
||||
super.doPonyRender(entity, limbSwing, limbSwingAmount, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
}
|
||||
|
||||
protected void translateToHand(EnumHandSide p_191361_1_) {
|
||||
((ModelIllagerPony) this.getRenderer().getMainModel()).getArm(p_191361_1_).postRender(0.0625F);
|
||||
@Override
|
||||
protected void translateToHand(EnumHandSide hand) {
|
||||
((ModelIllagerPony) getRenderer().getMainModel()).getArm(hand).postRender(0.0625F);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -42,8 +44,8 @@ public class RenderPonyEvoker extends RenderPonyMob<EntityEvoker> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityEvoker entitylivingbaseIn, float partialTickTime) {
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
protected void preRenderCallback(EntityEvoker entity, float ticks) {
|
||||
super.preRenderCallback(entity, ticks);
|
||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,24 +19,23 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
|
|||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("minelittlepony", "textures/entity/illager/illusionist_pony.png");
|
||||
|
||||
public RenderPonyIllusionIllager(RenderManager renderManager) {
|
||||
super(renderManager, PMAPI.illager);
|
||||
public RenderPonyIllusionIllager(RenderManager manager) {
|
||||
super(manager, PMAPI.illager);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addLayers() {
|
||||
this.addLayer(new LayerHeldPonyItem(this) {
|
||||
addLayer(new LayerHeldPonyItem(this) {
|
||||
@Override
|
||||
public void doPonyRender(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks,
|
||||
float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
if (((EntityIllusionIllager) entitylivingbaseIn).isSpellcasting() || ((EntityIllusionIllager) entitylivingbaseIn).isAggressive()) {
|
||||
super.doPonyRender(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
public void doPonyRender(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
if (((EntityIllusionIllager) entity).isSpellcasting() || ((EntityIllusionIllager) entity).isAggressive()) {
|
||||
super.doPonyRender(entity, limbSwing, limbSwingAmount, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void translateToHand(EnumHandSide p_191361_1_) {
|
||||
((ModelIllagerPony) this.getRenderer().getMainModel()).getArm(p_191361_1_).postRender(0.0625F);
|
||||
protected void translateToHand(EnumHandSide hand) {
|
||||
((ModelIllagerPony) getRenderer().getMainModel()).getArm(hand).postRender(0.0625F);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -46,26 +45,27 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
|
|||
return TEXTURE;
|
||||
}
|
||||
|
||||
protected void preRenderCallback(EntityIllusionIllager entitylivingbaseIn, float partialTickTime) {
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
@Override
|
||||
protected void preRenderCallback(EntityIllusionIllager entity, float ticks) {
|
||||
super.preRenderCallback(entity, ticks);
|
||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||
}
|
||||
|
||||
@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 ticks) {
|
||||
if (entity.isInvisible()) {
|
||||
Vec3d[] vects = entity.getRenderLocations(partialTicks);
|
||||
float f = this.handleRotationFloat(entity, partialTicks);
|
||||
Vec3d[] vects = entity.getRenderLocations(ticks);
|
||||
float f = handleRotationFloat(entity, ticks);
|
||||
|
||||
for (int i = 0; i < vects.length; ++i) {
|
||||
super.doRender(entity,
|
||||
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);
|
||||
x + vects[i].x + MathHelper.cos(i + f * 0.5F) * 0.025D,
|
||||
y + vects[i].y + MathHelper.cos(i + f * 0.75F) * 0.0125D,
|
||||
z + vects[i].z + MathHelper.cos(i + f * 0.7F) * 0.025D,
|
||||
yaw, ticks);
|
||||
}
|
||||
} else {
|
||||
super.doRender(entity, x, y, z, yaw, partialTicks);
|
||||
super.doRender(entity, x, y, z, yaw, ticks);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ public class RenderPonyPigman extends RenderPonyMob<EntityPigZombie> {
|
|||
|
||||
private static final ResourceLocation PIGMAN = new ResourceLocation("minelittlepony", "textures/entity/zombie/zombie_pigman_pony.png");
|
||||
|
||||
public RenderPonyPigman(RenderManager renderManager) {
|
||||
super(renderManager, PMAPI.pony);
|
||||
public RenderPonyPigman(RenderManager manager) {
|
||||
super(manager, PMAPI.pony);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,11 +25,11 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
|
|||
@Override
|
||||
protected void addLayers() {
|
||||
super.addLayers();
|
||||
this.addLayer(new LayerBipedArmor(this) {
|
||||
addLayer(new LayerBipedArmor(this) {
|
||||
@Override
|
||||
protected void initArmor() {
|
||||
this.modelLeggings = getPlayerModel().getArmor().modelArmor;
|
||||
this.modelArmor = getPlayerModel().getArmor().modelArmorChestplate;
|
||||
modelLeggings = getPlayerModel().getArmor().armour;
|
||||
modelArmor = getPlayerModel().getArmor().chestplate;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
|
|||
|
||||
public Stray(RenderManager rm) {
|
||||
super(rm);
|
||||
this.addLayer(new LayerPonyStrayOverlay(this));
|
||||
addLayer(new LayerPonyStrayOverlay(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,8 +64,8 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityWitherSkeleton skeleton, float partialTicks) {
|
||||
super.preRenderCallback(skeleton, partialTicks);
|
||||
protected void preRenderCallback(EntityWitherSkeleton skeleton, float ticks) {
|
||||
super.preRenderCallback(skeleton, ticks);
|
||||
GlStateManager.scale(1.2F, 1.2F, 1.2F);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ public class RenderPonyVex extends RenderBiped<EntityVex> {
|
|||
private static final ResourceLocation VEX = new ResourceLocation("minelittlepony", "textures/entity/illager/vex_pony.png");
|
||||
private static final ResourceLocation VEX_CHARGING = new ResourceLocation("minelittlepony", "textures/entity/illager/vex_charging_pony.png");
|
||||
|
||||
public RenderPonyVex(RenderManager renderManagerIn) {
|
||||
super(renderManagerIn, new ModelBreezie(), 0.3F);
|
||||
public RenderPonyVex(RenderManager manager) {
|
||||
super(manager, new ModelBreezie(), 0.3F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityVex entitylivingbaseIn, float partialTickTime) {
|
||||
protected void preRenderCallback(EntityVex entity, float ticks) {
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ public class RenderPonyVillager extends RenderPonyMob<EntityVillager> {
|
|||
new ResourceLocation("minelittlepony", "textures/entity/villager/villager_pony.png")
|
||||
};
|
||||
|
||||
public RenderPonyVillager(RenderManager rm) {
|
||||
super(rm, PMAPI.villager);
|
||||
public RenderPonyVillager(RenderManager manager) {
|
||||
super(manager, PMAPI.villager);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityVillager villager, float partialTicks) {
|
||||
super.preRenderCallback(villager, partialTicks);
|
||||
protected void preRenderCallback(EntityVillager villager, float ticks) {
|
||||
super.preRenderCallback(villager, ticks);
|
||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ public class RenderPonyVindicator extends RenderPonyMob<EntityVindicator> {
|
|||
|
||||
private static final ResourceLocation VINDICATOR = new ResourceLocation("minelittlepony", "textures/entity/illager/vindicator_pony.png");
|
||||
|
||||
public RenderPonyVindicator(RenderManager renderManager) {
|
||||
super(renderManager, PMAPI.illager);
|
||||
public RenderPonyVindicator(RenderManager manager) {
|
||||
super(manager, PMAPI.illager);
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,17 +25,15 @@ public class RenderPonyVindicator extends RenderPonyMob<EntityVindicator> {
|
|||
protected void addLayers() {
|
||||
this.addLayer(new LayerHeldPonyItem(this) {
|
||||
@Override
|
||||
public void doPonyRender(EntityLivingBase vindicator, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks,
|
||||
float netHeadYaw, float headPitch, float scale) {
|
||||
|
||||
if (((EntityVindicator) vindicator).isAggressive()) {
|
||||
super.doPonyRender(vindicator, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
public void doPonyRender(EntityLivingBase entity, float move, float swing, float ticks, float age, float headYaw, float headPitch, float scale) {
|
||||
if (((EntityVindicator) entity).isAggressive()) {
|
||||
super.doPonyRender(entity, move, swing, ticks, age, headYaw, headPitch, scale);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void translateToHand(EnumHandSide side) {
|
||||
((ModelIllagerPony) this.getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
|
||||
((ModelIllagerPony) getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -46,8 +44,8 @@ public class RenderPonyVindicator extends RenderPonyMob<EntityVindicator> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityVindicator entitylivingbaseIn, float partialTickTime) {
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
protected void preRenderCallback(EntityVindicator entity, float ticks) {
|
||||
super.preRenderCallback(entity, ticks);
|
||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,48 +15,48 @@ public class RenderPonyZombie<Zombie extends EntityZombie> extends RenderPonyMob
|
|||
private static final ResourceLocation ZOMBIE = new ResourceLocation("minelittlepony", "textures/entity/zombie/zombie_pony.png");
|
||||
private static final ResourceLocation HUSK = new ResourceLocation("minelittlepony", "textures/entity/zombie/husk_pony.png");
|
||||
|
||||
public RenderPonyZombie(RenderManager rendermanager) {
|
||||
super(rendermanager, PMAPI.zombie);
|
||||
public RenderPonyZombie(RenderManager manager) {
|
||||
super(manager, PMAPI.zombie);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getTexture(Zombie zombie) {
|
||||
protected ResourceLocation getTexture(Zombie entity) {
|
||||
return ZOMBIE;
|
||||
}
|
||||
|
||||
public static class Husk extends RenderPonyZombie<EntityHusk> {
|
||||
|
||||
public Husk(RenderManager rendermanager) {
|
||||
super(rendermanager);
|
||||
public Husk(RenderManager manager) {
|
||||
super(manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityHusk entitylivingbaseIn, float partialTickTime) {
|
||||
protected void preRenderCallback(EntityHusk entity, float ticks) {
|
||||
GlStateManager.scale(1.0625F, 1.0625F, 1.0625F);
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
super.preRenderCallback(entity, ticks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getTexture(EntityHusk zombie) {
|
||||
protected ResourceLocation getTexture(EntityHusk entity) {
|
||||
return HUSK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class Giant extends RenderPonyMob<EntityGiantZombie> {
|
||||
|
||||
public Giant(RenderManager renderManager) {
|
||||
super(renderManager, PMAPI.zombie);
|
||||
public Giant(RenderManager manager) {
|
||||
super(manager, PMAPI.zombie);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityGiantZombie entitylivingbaseIn, float partialTickTime) {
|
||||
protected void preRenderCallback(EntityGiantZombie entity, float ticks) {
|
||||
GlStateManager.scale(3, 3, 3);
|
||||
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
|
||||
super.preRenderCallback(entity, ticks);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getTexture(EntityGiantZombie zombie) {
|
||||
protected ResourceLocation getTexture(EntityGiantZombie entity) {
|
||||
return ZOMBIE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,21 +18,21 @@ public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager
|
|||
new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png")
|
||||
};
|
||||
|
||||
public RenderPonyZombieVillager(RenderManager renderManager) {
|
||||
super(renderManager, PMAPI.villager);
|
||||
public RenderPonyZombieVillager(RenderManager manager) {
|
||||
super(manager, PMAPI.villager);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getTexture(EntityZombieVillager villager) {
|
||||
return PROFESSIONS[villager.getProfession()];
|
||||
protected ResourceLocation getTexture(EntityZombieVillager entity) {
|
||||
return PROFESSIONS[entity.getProfession()];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyRotations(EntityZombieVillager villager, float p_77043_2_, float p_77043_3_, float partialTicks) {
|
||||
if (villager.isConverting()) {
|
||||
p_77043_3_ += (float) (Math.cos(villager.ticksExisted * 3.25D) * Math.PI * 0.25D);
|
||||
protected void applyRotations(EntityZombieVillager entity, float move, float rotationYaw, float ticks) {
|
||||
if (entity.isConverting()) {
|
||||
rotationYaw += (float) (Math.cos(entity.ticksExisted * 3.25D) * (Math.PI / 4));
|
||||
}
|
||||
|
||||
super.applyRotations(villager, p_77043_2_, p_77043_3_, partialTicks);
|
||||
super.applyRotations(entity, move, rotationYaw, ticks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Chris Albers
|
||||
*
|
||||
*/
|
||||
package com.minelittlepony.render.ponies;
|
Loading…
Reference in a new issue