Backport to 1.10.2

This commit is contained in:
Matthew Messinger 2016-12-24 04:04:22 -05:00
parent cccfbbded7
commit 9fc2650f44
23 changed files with 88 additions and 804 deletions

View file

@ -23,19 +23,17 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.liteloader' apply plugin: 'net.minecraftforge.gradle.liteloader'
apply plugin: 'org.spongepowered.mixin' apply plugin: 'org.spongepowered.mixin'
apply plugin: 'mnm.gradle.ap-ide'
group = 'com.minelittlepony' group = 'com.minelittlepony'
version = '1.11.0.3-beta2' version = '1.10.2.7'
description = 'Mine Little Pony' description = 'Mine Little Pony'
targetCompatibility = 1.8 targetCompatibility = 1.8
sourceCompatibility = 1.8 sourceCompatibility = 1.8
minecraft { minecraft {
version = "1.11" version = "1.10.2"
// first snapshot for 1.11. Change to stable when possible. mappings = 'stable_29'
mappings = 'snapshot_20161120'
runDir = 'run' runDir = 'run'
replace '@VERSION@',project.version replace '@VERSION@',project.version
} }
@ -73,22 +71,6 @@ litemod.json {
] ]
} }
afterEvaluate {
dependencies {
// add mixin to the factory path
// use same version as liteloader
def liteloader = project.plugins['net.minecraftforge.gradle.liteloader']
def artifact = liteloader.artifact.libraries
.collect {it.name}
.find {it.contains 'mixin'}
factory artifact
}
processor {
// tell the processor where the reobf file is
options.reobfSrgFile = mixin.reobfSrgFile
}
}
jar { jar {
from sourceSets.hdskins.output from sourceSets.hdskins.output
from litemod.outputs from litemod.outputs

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Wed Dec 21 13:27:40 EST 2016 #Sat Dec 24 04:03:46 EST 2016
build.number=294 build.number=296

@ -1 +1 @@
Subproject commit f4a8929efc6ecd2f797ddad1f28c48b2c3745104 Subproject commit 7f6a9b2e44fc9496be253f1595b8585958e04c01

View file

@ -1,6 +1,5 @@
package com.voxelmodpack.hdskins.gui; package com.voxelmodpack.hdskins.gui;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
@ -30,13 +29,7 @@ public class EntityPlayerModel extends EntityLivingBase {
public static final ResourceLocation NO_SKIN = new ResourceLocation("hdskins", "textures/mob/noskin.png"); public static final ResourceLocation NO_SKIN = new ResourceLocation("hdskins", "textures/mob/noskin.png");
public static final ResourceLocation NO_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); public static final ResourceLocation NO_ELYTRA = new ResourceLocation("textures/entity/elytra.png");
private Map<EntityEquipmentSlot, ItemStack> armors = Maps.newEnumMap(ImmutableMap.of( private Map<EntityEquipmentSlot, ItemStack> armors = Maps.newEnumMap(EntityEquipmentSlot.class);
EntityEquipmentSlot.HEAD, ItemStack.EMPTY,
EntityEquipmentSlot.CHEST, ItemStack.EMPTY,
EntityEquipmentSlot.LEGS, ItemStack.EMPTY,
EntityEquipmentSlot.FEET, ItemStack.EMPTY,
EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY
));
private PreviewTexture remoteSkinTexture; private PreviewTexture remoteSkinTexture;
private ResourceLocation remoteSkinResource; private ResourceLocation remoteSkinResource;

View file

@ -321,7 +321,7 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe
if (guiButton.id == this.btnModeSkin.id) { if (guiButton.id == this.btnModeSkin.id) {
this.textureType = SKIN; this.textureType = SKIN;
this.btnModeElytra.enabled = true; this.btnModeElytra.enabled = true;
stack = ItemStack.EMPTY; stack = null;
} else { } else {
this.textureType = ELYTRA; this.textureType = ELYTRA;
this.btnModeSkin.enabled = true; this.btnModeSkin.enabled = true;

View file

@ -1,6 +1,6 @@
{ {
"required": true, "required": true,
"minVersion": "0.6", "minVersion": "0.5.7",
"package": "com.voxelmodpack.hdskins.mixin", "package": "com.voxelmodpack.hdskins.mixin",
"refmap": "mixin.hdskins.refmap.json", "refmap": "mixin.hdskins.refmap.json",
"mixins": [ "mixins": [

View file

@ -5,14 +5,10 @@ import com.minelittlepony.gui.PonySettingPanel;
import com.minelittlepony.hdskins.gui.EntityPonyModel; import com.minelittlepony.hdskins.gui.EntityPonyModel;
import com.minelittlepony.hdskins.gui.GuiSkinsMineLP; import com.minelittlepony.hdskins.gui.GuiSkinsMineLP;
import com.minelittlepony.hdskins.gui.RenderPonyModel; import com.minelittlepony.hdskins.gui.RenderPonyModel;
import com.minelittlepony.renderer.RenderPonyEvoker;
import com.minelittlepony.renderer.RenderPonyPigman; import com.minelittlepony.renderer.RenderPonyPigman;
import com.minelittlepony.renderer.RenderPonySkeleton; import com.minelittlepony.renderer.RenderPonySkeleton;
import com.minelittlepony.renderer.RenderPonyVex;
import com.minelittlepony.renderer.RenderPonyVillager; import com.minelittlepony.renderer.RenderPonyVillager;
import com.minelittlepony.renderer.RenderPonyVindicator;
import com.minelittlepony.renderer.RenderPonyZombie; import com.minelittlepony.renderer.RenderPonyZombie;
import com.minelittlepony.renderer.RenderPonyZombieVillager;
import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.core.LiteLoader;
import com.mumfrey.liteloader.util.ModUtilities; import com.mumfrey.liteloader.util.ModUtilities;
import com.voxelmodpack.hdskins.HDSkinManager; import com.voxelmodpack.hdskins.HDSkinManager;
@ -24,16 +20,9 @@ import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraft.client.resources.data.MetadataSerializer; import net.minecraft.client.resources.data.MetadataSerializer;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityEvoker;
import net.minecraft.entity.monster.EntityHusk;
import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityStray;
import net.minecraft.entity.monster.EntityVex;
import net.minecraft.entity.monster.EntityVindicator;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.EntityZombieVillager;
import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -100,20 +89,12 @@ public class MineLittlePony {
private void saveCurrentRenderers(RenderManager rm) { private void saveCurrentRenderers(RenderManager rm) {
// villagers // villagers
this.renderMap.put(EntityVillager.class, rm.getEntityClassRenderObject(EntityVillager.class)); this.renderMap.put(EntityVillager.class, rm.getEntityClassRenderObject(EntityVillager.class));
this.renderMap.put(EntityZombieVillager.class, rm.getEntityClassRenderObject(EntityZombieVillager.class));
// zombies // zombies
this.renderMap.put(EntityZombie.class, rm.getEntityClassRenderObject(EntityZombie.class)); this.renderMap.put(EntityZombie.class, rm.getEntityClassRenderObject(EntityZombie.class));
this.renderMap.put(EntityHusk.class, rm.getEntityClassRenderObject(EntityHusk.class));
// pig zombie // pig zombie
this.renderMap.put(EntityPigZombie.class, rm.getEntityClassRenderObject(EntityPigZombie.class)); this.renderMap.put(EntityPigZombie.class, rm.getEntityClassRenderObject(EntityPigZombie.class));
// skeletons // skeletons
this.renderMap.put(EntitySkeleton.class, rm.getEntityClassRenderObject(EntitySkeleton.class)); this.renderMap.put(EntitySkeleton.class, rm.getEntityClassRenderObject(EntitySkeleton.class));
this.renderMap.put(EntityStray.class, rm.getEntityClassRenderObject(EntityStray.class));
this.renderMap.put(EntityWitherSkeleton.class, rm.getEntityClassRenderObject(EntityWitherSkeleton.class));
// illagers
this.renderMap.put(EntityVex.class, rm.getEntityClassRenderObject(EntityVex.class));
this.renderMap.put(EntityEvoker.class, rm.getEntityClassRenderObject(EntityEvoker.class));
this.renderMap.put(EntityVindicator.class, rm.getEntityClassRenderObject(EntityVindicator.class));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -127,20 +108,16 @@ public class MineLittlePony {
public void initializeMobRenderers(RenderManager rm) { public void initializeMobRenderers(RenderManager rm) {
if (this.config.villagers) { if (this.config.villagers) {
ModUtilities.addRenderer(EntityVillager.class, new RenderPonyVillager(rm)); ModUtilities.addRenderer(EntityVillager.class, new RenderPonyVillager(rm));
ModUtilities.addRenderer(EntityZombieVillager.class, new RenderPonyZombieVillager(rm));
logger.info("Villagers are now ponies."); logger.info("Villagers are now ponies.");
} else { } else {
ModUtilities.addRenderer(EntityVillager.class, getRenderer(EntityVillager.class)); ModUtilities.addRenderer(EntityVillager.class, getRenderer(EntityVillager.class));
ModUtilities.addRenderer(EntityZombieVillager.class, getRenderer(EntityZombieVillager.class));
} }
if (this.config.zombies) { if (this.config.zombies) {
ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie<>(rm)); ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie<>(rm));
ModUtilities.addRenderer(EntityHusk.class, new RenderPonyZombie.Husk(rm));
logger.info("Zombies are now ponies."); logger.info("Zombies are now ponies.");
} else { } else {
ModUtilities.addRenderer(EntityZombie.class, getRenderer(EntityZombie.class)); ModUtilities.addRenderer(EntityZombie.class, getRenderer(EntityZombie.class));
ModUtilities.addRenderer(EntityHusk.class, getRenderer(EntityHusk.class));
} }
if (this.config.pigzombies) { if (this.config.pigzombies) {
@ -152,25 +129,11 @@ public class MineLittlePony {
if (this.config.skeletons) { if (this.config.skeletons) {
ModUtilities.addRenderer(EntitySkeleton.class, new RenderPonySkeleton<>(rm)); ModUtilities.addRenderer(EntitySkeleton.class, new RenderPonySkeleton<>(rm));
ModUtilities.addRenderer(EntityStray.class, new RenderPonySkeleton.Stray(rm));
ModUtilities.addRenderer(EntityWitherSkeleton.class, new RenderPonySkeleton.Wither(rm));
logger.info("Skeletons are now ponies."); logger.info("Skeletons are now ponies.");
} else { } else {
ModUtilities.addRenderer(EntitySkeleton.class, getRenderer(EntitySkeleton.class)); ModUtilities.addRenderer(EntitySkeleton.class, getRenderer(EntitySkeleton.class));
ModUtilities.addRenderer(EntityStray.class, getRenderer(EntityStray.class));
ModUtilities.addRenderer(EntityWitherSkeleton.class, getRenderer(EntityWitherSkeleton.class));
} }
if (this.config.illagers) {
ModUtilities.addRenderer(EntityVex.class, new RenderPonyVex(rm));
ModUtilities.addRenderer(EntityEvoker.class, new RenderPonyEvoker(rm));
ModUtilities.addRenderer(EntityVindicator.class, new RenderPonyVindicator(rm));
logger.info("Illagers are now ponies.");
} else {
ModUtilities.addRenderer(EntityVex.class, getRenderer(EntityVex.class));
ModUtilities.addRenderer(EntityEvoker.class, getRenderer(EntityEvoker.class));
ModUtilities.addRenderer(EntityVindicator.class, getRenderer(EntityVindicator.class));
}
} }
void onTick(Minecraft minecraft, boolean inGame) { void onTick(Minecraft minecraft, boolean inGame) {

View file

@ -26,8 +26,6 @@ public class PonyConfig implements Exposable {
public boolean pigzombies = true; public boolean pigzombies = true;
@Expose @Expose
public boolean skeletons = true; public boolean skeletons = true;
@Expose
public boolean illagers = true;
public PonyLevel getPonyLevel() { public PonyLevel getPonyLevel() {
if (ponylevel == null) if (ponylevel == null)

View file

@ -32,7 +32,6 @@ public class PonySettingPanel extends GuiScreen {
private static final String ZOMBIES = MOB_PREFIX + "zombies"; private static final String ZOMBIES = MOB_PREFIX + "zombies";
private static final String ZOMBIE_PIGMEN = MOB_PREFIX + "zombiepigmen"; private static final String ZOMBIE_PIGMEN = MOB_PREFIX + "zombiepigmen";
private static final String SKELETONS = MOB_PREFIX + "skeletons"; private static final String SKELETONS = MOB_PREFIX + "skeletons";
private static final String ILLAGERS = MOB_PREFIX + "illagers";
private static final int PONY_ID = 0; private static final int PONY_ID = 0;
private static final int HUMAN_ID = 1; private static final int HUMAN_ID = 1;
@ -46,7 +45,6 @@ public class PonySettingPanel extends GuiScreen {
private static final int ZOMBIES_ID = 8; private static final int ZOMBIES_ID = 8;
private static final int ZOMBIE_PIGMEN_ID = 9; private static final int ZOMBIE_PIGMEN_ID = 9;
private static final int SKELETONS_ID = 10; private static final int SKELETONS_ID = 10;
private static final int ILLAGER_ID = 11;
private PonyConfig config; private PonyConfig config;
@ -62,7 +60,7 @@ public class PonySettingPanel extends GuiScreen {
@Override @Override
public void initGui() { public void initGui() {
final int LEFT = width / 10 + 16; final int LEFT = width / 10 + 16;
GuiCheckbox pony, human, both, hd, sizes, snuzzles, showscale, villager, zombie, pigmen, skeleton, illager; GuiCheckbox pony, human, both, hd, sizes, snuzzles, showscale, villager, zombie, pigmen, skeleton;
int row = 32; int row = 32;
this.buttonList.add(pony = ponies = new GuiCheckbox(PONY_ID, LEFT, row += 15, I18n.format(PONY))); 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(human = humans = new GuiCheckbox(HUMAN_ID, LEFT, row += 15, I18n.format(HUMAN)));
@ -79,7 +77,6 @@ public class PonySettingPanel extends GuiScreen {
this.buttonList.add(zombie = new GuiCheckbox(ZOMBIES_ID, RIGHT, row += 15, I18n.format(ZOMBIES))); 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(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(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)));
switch (config.getPonyLevel()) { switch (config.getPonyLevel()) {
default: default:
@ -101,7 +98,6 @@ public class PonySettingPanel extends GuiScreen {
zombie.checked = config.zombies; zombie.checked = config.zombies;
pigmen.checked = config.pigzombies; pigmen.checked = config.pigzombies;
skeleton.checked = config.skeletons; skeleton.checked = config.skeletons;
illager.checked = config.illagers;
} }
@Override @Override
@ -167,9 +163,6 @@ public class PonySettingPanel extends GuiScreen {
case SKELETONS_ID: case SKELETONS_ID:
config.skeletons = checked; config.skeletons = checked;
break; break;
case ILLAGER_ID:
config.illagers = checked;
break;
} }
} }
} }

View file

@ -1,199 +0,0 @@
package com.minelittlepony.model.pony;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
public class ModelBreezie extends ModelBiped {
ModelRenderer neck;
ModelRenderer tail;
ModelRenderer tailStub;
ModelRenderer leftWing;
ModelRenderer rightWing;
public ModelBreezie() {
textureWidth = 64;
textureHeight = 64;
this.bipedHeadwear.showModel = false;
bipedHead = new ModelRenderer(this, 0, 0);
bipedHead.setRotationPoint(0, 0, -4);
bipedHead.addBox(-3, -6, -3F, 6, 6, 6);
bipedHead.setTextureOffset(28, 0).addBox(2F, -7F, 1F, 1, 1, 1);
bipedHead.setTextureOffset(24, 0).addBox(-3F, -7F, 1F, 1, 1, 1);
bipedHead.setTextureOffset(24, 9).addBox(-1F, -2F, -4F, 2, 2, 1);
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);
this.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);
bipedRightArm = new ModelRenderer(this, 36, 12);
bipedRightArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 8F, -5F);
bipedLeftArm = new ModelRenderer(this, 28, 12);
bipedLeftArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 8F, -5F);
bipedLeftLeg = new ModelRenderer(this, 8, 12);
bipedLeftLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 12F, 3F);
bipedRightLeg = new ModelRenderer(this, 0, 12);
bipedRightLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 12F, 3F);
neck = new ModelRenderer(this, 40, 0);
neck.addBox(0F, 0F, 0F, 2, 5, 2).setRotationPoint(-1F, -2F, -4F);
setRotation(neck, 0.0872665F, 0F, 0F);
tailStub = new ModelRenderer(this, 40, 7);
tailStub.addBox(0F, 0F, 0F, 1, 1, 3).setRotationPoint(-0.5F, 8F, 8F);
tail = new ModelRenderer(this, 32, 0);
tail.addBox(0F, 0F, 1F, 2, 9, 2).setRotationPoint(-1F, 7F, 10F);
leftWing = new ModelRenderer(this, 0, 40);
leftWing.addBox(0F, -12F, 0F, 24, 24, 0);
leftWing.setRotationPoint(2F, 3F, 1F);
leftWing.setTextureSize(64, 32);
setRotation(leftWing, 0F, -0.6981317F, 0F);
rightWing = new ModelRenderer(this, 0, 40);
rightWing.addBox(-24F, -12F, 0F, 24, 24, 0, true);
rightWing.setRotationPoint(-2F, 3F, 1F);
rightWing.setTextureSize(64, 32);
setRotation(rightWing, 0F, 0.6981317F, 0F);
}
@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);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@SuppressWarnings("incomplete-switch")
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
this.bipedHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.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;
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;
}
this.bipedRightArm.rotateAngleY = 0;
this.bipedRightArm.rotateAngleZ = 0F;
switch (this.leftArmPose) {
case EMPTY:
this.bipedLeftArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedLeftArm.rotateAngleY = 0.5235988F;
break;
case ITEM:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
this.bipedLeftArm.rotateAngleY = 0.0F;
}
switch (this.rightArmPose) {
case EMPTY:
this.bipedRightArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedRightArm.rotateAngleY = -0.5235988F;
break;
case ITEM:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
this.bipedRightArm.rotateAngleY = 0.0F;
}
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 (enumhandside == EnumHandSide.LEFT) {
this.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;
//noinspection SuspiciousNameCombination
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
f1 = 1.0F - this.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;
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;
}
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;
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;
}
}
}

View file

@ -1,55 +0,0 @@
package com.minelittlepony.model.pony;
import com.minelittlepony.renderer.HornGlowRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityEvoker;
import org.lwjgl.opengl.GL11;
import static net.minecraft.client.renderer.GlStateManager.*;
public class ModelEvokerPony extends ModelIllagerPony {
private HornGlowRenderer[] hornglow;
public ModelEvokerPony() {
hornglow = new HornGlowRenderer[2];
for (int i = 0; i < hornglow.length; i++) {
hornglow[i] = new HornGlowRenderer(this, 60, 3);
hornglow[i].setRotationPoint(0F, 1F, -5F);
}
hornglow[0].addBox(-0.5F, -12.0F, 3F, 1, 4, 1, 0.5F);
hornglow[1].addBox(-0.5F, -12.0F, 3F, 1, 3, 1, 0.8F);
}
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
EntityEvoker evoker = (EntityEvoker) entityIn;
if (isUnicorn && evoker.isCastingSpell()) {
GL11.glPushAttrib(24577);
disableTexture2D();
disableLighting();
enableBlend();
float red = (glowColor >> 16 & 255) / 255.0F;
float green = (glowColor >> 8 & 255) / 255.0F;
float blue = (glowColor & 255) / 255.0F;
blendFunc(GL11.GL_SRC_ALPHA, 1);
this.illagerHead.postRender(scale);
this.horn.postRender(scale);
color(red, green, blue, 0.4F);
this.hornglow[0].render(scale);
color(red, green, blue, 0.2F);
this.hornglow[1].render(scale);
enableTexture2D();
enableLighting();
disableBlend();
popAttrib();
}
}
}

View file

@ -1,171 +0,0 @@
package com.minelittlepony.model.pony;
import com.minelittlepony.model.PonyModelConstants;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
public abstract class ModelIllagerPony extends ModelBase {
public boolean isUnicorn;
public int glowColor;
public ModelRenderer illagerHead;
public ModelRenderer illagerBody;
public ModelRenderer leftForeLeg;
public ModelRenderer rightForeLeg;
public ModelRenderer leftHindLeg;
public ModelRenderer rightHindLeg;
public ModelRenderer tail;
public ModelRenderer horn;
ModelIllagerPony() {
textureWidth = 64;
textureHeight = 64;
this.setTextureOffset("head.ear1", 24, 4);
this.setTextureOffset("head.ear2", 0, 4);
this.setTextureOffset("head.snuzzle.mare1", 48, 21);
this.setTextureOffset("head.snuzzle.mare2", 49, 20);
this.setTextureOffset("head.snuzzle.stallion", 48, 16);
illagerHead = new ModelRenderer(this, "head");
illagerHead.setRotationPoint(0F, 1F, -5F);
illagerHead.setTextureOffset(0, 0).addBox(-4F, -6F, -5F, 8, 8, 8);
// headwear
illagerHead.setTextureOffset(32, 0).addBox(-4F, -6F, -5F, 8, 8, 8, 0.5F);
illagerHead.addBox("ear1", 2F, -8F, 0F, 2, 2, 2);
illagerHead.addBox("ear2", -4F, -8F, 0F, 2, 2, 2);
illagerHead.addBox("snuzzle.mare1", -2F, -0F, -6F, 4, 2, 1);
illagerHead.addBox("snuzzle.mare2", -1F, -1F, -6F, 2, 1, 1);
illagerHead.addBox("snuzzle.stallion", -2F, -1F, -6F, 4, 3, 1);
horn = new ModelRenderer(this, 60, 3);
horn.addBox(-0.5F, -11.0F, -2F, 1, 4, 1);
horn.rotateAngleX = 0.5F;
this.illagerHead.addChild(horn);
ModelRenderer illagerNeck = new ModelRenderer(this, 0, 40);
illagerNeck.addBox(-2F, 0F, -6F, 4, 4, 4);
illagerNeck.rotateAngleX = PonyModelConstants.NECK_ROT_X;
illagerBody = new ModelRenderer(this);
illagerBody.setTextureOffset(0, 16).addBox(-4F, 4F, -5F, 8, 8, 16);
illagerBody.addChild(illagerNeck);
leftForeLeg = new ModelRenderer(this, 32, 16);
leftForeLeg.addBox(0F, 0F, -2F, 4, 12, 4).setRotationPoint(0F, 12F, -3F);
rightForeLeg = new ModelRenderer(this, 32, 48);
rightForeLeg.addBox(-2F, 0F, -2F, 4, 12, 4).setRotationPoint(-2F, 12F, -3F);
leftHindLeg = new ModelRenderer(this, 0, 16);
leftHindLeg.addBox(-2F, 0F, -2F, 4, 12, 4).setRotationPoint(2F, 12F, 8F);
rightHindLeg = new ModelRenderer(this, 0, 48);
rightHindLeg.addBox(-2F, 0F, -2F, 4, 12, 4).setRotationPoint(-2F, 12F, 8F);
ModelRenderer tailStub = new ModelRenderer(this, 52, 24);
tailStub.addBox(-0.5F, -1F, -0.5F, 2, 4, 2).setRotationPoint(0F, 0F, 2F);
tailStub.rotateAngleX = (float) Math.PI / -3;
this.setTextureOffset("tail.1qtr", 48, 24);
this.setTextureOffset("tail.half", 48, 32);
this.setTextureOffset("tail.3qtr", 48, 40);
this.setTextureOffset("tail.full", 48, 48);
tail = new ModelRenderer(this, "tail");
tail.setRotationPoint(0F, 4F, 11F);
tail.addBox("1qtr", -1.5F, -2F, 2F, 4, 4, 4);
tail.addBox("half", -1.5F, 2F, 2F, 4, 4, 4);
tail.addBox("3qtr", -1.5F, 6F, 2F, 4, 4, 4);
tail.addBox("full", -1.5F, 10F, 2F, 4, 4, 4);
tail.addChild(tailStub);
}
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
illagerHead.render(scale);
illagerBody.render(scale);
leftForeLeg.render(scale);
rightForeLeg.render(scale);
leftHindLeg.render(scale);
rightHindLeg.render(scale);
tail.render(scale);
// mr.render(scale);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
final float PI = (float) Math.PI;
float headRotateAngleY = netHeadYaw * PI / 180;
float headRotateAngleX = headPitch * PI / 180;
final float max = 0.5f;
final float min = -1.25f;
headRotateAngleX = Math.min(headRotateAngleX, max);
headRotateAngleX = Math.max(headRotateAngleX, min);
this.illagerHead.rotateAngleY = headRotateAngleY;
this.illagerHead.rotateAngleX = headRotateAngleX;
this.tail.rotateAngleZ = MathHelper.cos(limbSwing * 0.8F) * 0.2F * limbSwingAmount;
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(this.swingProgress) * PI * 2.0F) * 0.2F;
}
this.illagerBody.rotateAngleY = bodySwingRotation * 0.2F;
this.illagerBody.rotateAngleY = bodySwingRotation * 0.2F;
this.tail.rotateAngleY = bodySwingRotation;
this.setLegs(limbSwing, limbSwingAmount);
this.tail.rotateAngleX = 0.5F * limbSwingAmount;
this.tail.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
private void setLegs(float move, float swing) {
this.rotateLegs(move, swing);
// this.adjustLegs();
}
private void rotateLegs(float move, float swing) {
final float PI = (float) Math.PI;
float swag = (float) Math.pow(swing, 16.0D);
float raQuad = PI * swag * 0.5F;
float laQuad = PI * swag;
float rlQuad = PI * swag * 0.2F;
float llQuad = PI * swag * -0.4F;
this.rightForeLeg.rotateAngleX = MathHelper.cos(move * 0.6662F + (float) Math.PI + raQuad) * 0.45F * swing;
this.leftForeLeg.rotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
this.rightHindLeg.rotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
this.leftHindLeg.rotateAngleX = MathHelper.cos(move * 0.6662F + PI + llQuad) * 0.45F * swing;
this.rightForeLeg.rotateAngleZ = 0.0F;
this.leftForeLeg.rotateAngleZ = 0.0F;
}
public ModelRenderer getArm(EnumHandSide side) {
return side == EnumHandSide.LEFT ? this.leftForeLeg : this.rightForeLeg;
}
}

View file

@ -1,41 +0,0 @@
package com.minelittlepony.model.pony;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityVindicator;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
public class ModelVindicatorPony extends ModelIllagerPony {
@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);
EntityVindicator vindicator = (EntityVindicator) entityIn;
if (vindicator.isAggressive()) {
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.rightForeLeg.rotateAngleZ = 0.0F;
this.leftForeLeg.rotateAngleZ = 0.0F;
if (((EntityLivingBase) entityIn).getPrimaryHand() == EnumHandSide.RIGHT) {
this.rightForeLeg.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
// this.leftForeLeg.rotateAngleX = -0.0F + MathHelper.cos(ageInTicks * 0.19F) * 0.5F;
this.rightForeLeg.rotateAngleX += f * 2.2F - f1 * 0.4F;
// this.leftForeLeg.rotateAngleX += f * 1.2F - f1 * 0.4F;
} else {
// this.rightForeLeg.rotateAngleX = -0.0F + MathHelper.cos(ageInTicks * 0.19F) * 0.5F;
this.leftForeLeg.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
// this.rightForeLeg.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.leftForeLeg.rotateAngleX += f * 2.2F - f1 * 0.4F;
}
this.rightForeLeg.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.leftForeLeg.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.rightForeLeg.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.leftForeLeg.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
}
}

View file

@ -1,60 +0,0 @@
package com.minelittlepony.renderer;
import com.minelittlepony.PonyData;
import com.minelittlepony.PonyDataSerialzier;
import com.minelittlepony.model.pony.ModelEvokerPony;
import com.minelittlepony.model.pony.ModelIllagerPony;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.entity.monster.EntityEvoker;
import net.minecraft.util.ResourceLocation;
import java.io.IOException;
public class RenderPonyEvoker extends RenderLiving<EntityEvoker> {
private static final ResourceLocation EVOKER = new ResourceLocation("minelittlepony", "textures/entity/illager/evoker_pony.png");
public RenderPonyEvoker(RenderManager rendermanagerIn) {
super(rendermanagerIn, new ModelEvokerPony(), 0.5F);
}
@Override
public void doRender(EntityEvoker entity, double x, double y, double z, float entityYaw, float partialTicks) {
ModelIllagerPony model = (ModelIllagerPony) this.getMainModel();
IResourceManager resources = Minecraft.getMinecraft().getResourceManager();
try {
model.glowColor = 0x4444aa;
model.isUnicorn = false;
IResource resource = resources.getResource(EVOKER);
if (resource.hasMetadata()) {
PonyData meta = resource.getMetadata(PonyDataSerialzier.NAME);
if (meta != null) {
model.isUnicorn = meta.hasMagic();
model.glowColor = meta.getGlowColor();
}
}
} catch (IOException e) {
e.printStackTrace();
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
@Override
protected ResourceLocation getEntityTexture(EntityEvoker entity) {
return EVOKER;
}
@Override
protected void preRenderCallback(EntityEvoker entitylivingbaseIn, float partialTickTime) {
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
}
}

View file

@ -9,14 +9,13 @@ import com.minelittlepony.renderer.layer.LayerPonyStrayOverlay;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
import net.minecraft.entity.monster.AbstractSkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityStray; import net.minecraft.entity.monster.SkeletonType;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import java.util.Random; import java.util.Random;
public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends RenderPonyMob<Skeleton> { public class RenderPonySkeleton<Skeleton extends EntitySkeleton> extends RenderPonyMob<Skeleton> {
private static final ResourceLocation SKELETON = new ResourceLocation("minelittlepony", "textures/entity/skeleton/skeleton_pony.png"); private static final ResourceLocation SKELETON = new ResourceLocation("minelittlepony", "textures/entity/skeleton/skeleton_pony.png");
private static final ResourceLocation WITHER = new ResourceLocation("minelittlepony", "textures/entity/skeleton/skeleton_wither_pony.png"); private static final ResourceLocation WITHER = new ResourceLocation("minelittlepony", "textures/entity/skeleton/skeleton_wither_pony.png");
@ -31,6 +30,7 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
this.modelArmor = PMAPI.skeleton.getArmor().modelArmorChestplate; this.modelArmor = PMAPI.skeleton.getArmor().modelArmorChestplate;
} }
}); });
this.addLayer(new LayerPonyStrayOverlay(this));
} }
@Override @Override
@ -55,43 +55,27 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
this.playerModel.getModel().metadata.setSize(size == PonySize.FOAL ? PonySize.NORMAL : size); this.playerModel.getModel().metadata.setSize(size == PonySize.FOAL ? PonySize.NORMAL : size);
this.playerModel.getModel().metadata.setTail(TailLengths.STUB); this.playerModel.getModel().metadata.setTail(TailLengths.STUB);
this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); this.playerModel.getModel().metadata.setGlowColor(rand.nextInt());
if (skeleton.getSkeletonType() == SkeletonType.WITHER) {
GlStateManager.scale(1.2F, 1.2F, 1.2F);
}
} }
@Override @Override
protected ResourceLocation getEntityTexture(Skeleton entity) { protected ResourceLocation getEntityTexture(Skeleton entity) {
return getTexture(SKELETON); return getTexture(getResource(entity));
} }
public static class Stray extends RenderPonySkeleton<EntityStray> { private ResourceLocation getResource(Skeleton entity) {
switch (entity.getSkeletonType()) {
public Stray(RenderManager rm) { case WITHER:
super(rm); return WITHER;
this.addLayer(new LayerPonyStrayOverlay(this)); case STRAY:
return STRAY;
case NORMAL:
default:
return SKELETON;
} }
@Override
protected ResourceLocation getEntityTexture(EntityStray entity) {
return getTexture(STRAY);
}
}
public static class Wither extends RenderPonySkeleton<EntityWitherSkeleton> {
public Wither(RenderManager rm) {
super(rm);
}
@Override
protected ResourceLocation getEntityTexture(EntityWitherSkeleton entity) {
return getTexture(WITHER);
}
@Override
protected void preRenderCallback(EntityWitherSkeleton skeleton, float partialTicks) {
super.preRenderCallback(skeleton, partialTicks);
GlStateManager.scale(1.2F, 1.2F, 1.2F);
}
} }
} }

View file

@ -1,32 +0,0 @@
package com.minelittlepony.renderer;
import com.minelittlepony.model.pony.ModelBreezie;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityVex;
import net.minecraft.util.ResourceLocation;
/**
* AKA a breezie :D
*/
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);
}
@Override
protected void preRenderCallback(EntityVex entitylivingbaseIn, float partialTickTime) {
GlStateManager.scale(0.4F, 0.4F, 0.4F);
}
@Override
protected ResourceLocation getEntityTexture(EntityVex entity) {
return entity.isCharging() ? VEX_CHARGING : VEX;
}
}

View file

@ -1,47 +0,0 @@
package com.minelittlepony.renderer;
import com.minelittlepony.model.pony.ModelIllagerPony;
import com.minelittlepony.model.pony.ModelVindicatorPony;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityVindicator;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.ResourceLocation;
public class RenderPonyVindicator extends RenderLiving<EntityVindicator> {
private static final ResourceLocation VINDICATOR = new ResourceLocation("minelittlepony", "textures/entity/illager/vindicator_pony.png");
public RenderPonyVindicator(RenderManager renderManager) {
super(renderManager, new ModelVindicatorPony(), 0.5F);
this.addLayer(new LayerHeldPonyItem(this) {
@Override
public void doRenderLayer(EntityLivingBase vindicator, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (((EntityVindicator) vindicator).isAggressive()) {
super.doRenderLayer(vindicator, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
@Override
protected void translateToHand(EnumHandSide side) {
((ModelIllagerPony) this.livingPonyEntity.getMainModel()).getArm(side).postRender(0.0625F);
}
});
}
@Override
protected ResourceLocation getEntityTexture(EntityVindicator entity) {
return VINDICATOR;
}
@Override
protected void preRenderCallback(EntityVindicator entitylivingbaseIn, float partialTickTime) {
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
}
}

View file

@ -7,8 +7,8 @@ import com.minelittlepony.TailLengths;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityHusk;
import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.ZombieType;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import java.util.Random; import java.util.Random;
@ -18,6 +18,13 @@ 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 ZOMBIE = new ResourceLocation("minelittlepony", "textures/entity/zombie/zombie_pony.png");
private static final ResourceLocation HUSK = new ResourceLocation("minelittlepony", "textures/entity/zombie/husk_pony.png"); private static final ResourceLocation HUSK = new ResourceLocation("minelittlepony", "textures/entity/zombie/husk_pony.png");
private static final ResourceLocation GENERIC = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png");
private static final ResourceLocation FARMER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_farmer_pony.png");
private static final ResourceLocation LIBRARIAN = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_librarian_pony.png");
private static final ResourceLocation PRIEST = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_priest_pony.png");
private static final ResourceLocation SMITH = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_smith_pony.png");
private static final ResourceLocation BUTCHER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_butcher_pony.png");
public RenderPonyZombie(RenderManager rendermanager) { public RenderPonyZombie(RenderManager rendermanager) {
super(rendermanager, PMAPI.zombie); super(rendermanager, PMAPI.zombie);
} }
@ -59,6 +66,17 @@ public class RenderPonyZombie<Zombie extends EntityZombie> extends RenderPonyMob
// glow // glow
this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); this.playerModel.getModel().metadata.setGlowColor(rand.nextInt());
if (entity.getZombieType() == ZombieType.HUSK) {
GlStateManager.scale(1.0625F, 1.0625F, 1.0625F);
}
}
@Override
protected void applyRotations(Zombie zombie, float p_77043_2_, float p_77043_3_, float partialTicks) {
if (zombie.isConverting()) {
p_77043_3_ += (float) (Math.cos(zombie.ticksExisted * 3.25D) * Math.PI * 0.25D);
}
super.applyRotations(zombie, p_77043_2_, p_77043_3_, partialTicks);
} }
private static <T extends Enum<T>> T randEnum(Random rand, Class<T> en) { private static <T extends Enum<T>> T randEnum(Random rand, Class<T> en) {
@ -68,26 +86,30 @@ public class RenderPonyZombie<Zombie extends EntityZombie> extends RenderPonyMob
@Override @Override
protected ResourceLocation getEntityTexture(Zombie zombie) { protected ResourceLocation getEntityTexture(Zombie zombie) {
return getTexture(ZOMBIE);
return getTexture(getResource(zombie));
} }
public static class Husk extends RenderPonyZombie<EntityHusk> { private ResourceLocation getResource(Zombie zombie) {
switch (zombie.getZombieType()) {
case VILLAGER_FARMER:
return FARMER;
case VILLAGER_LIBRARIAN:
return LIBRARIAN;
case VILLAGER_PRIEST:
return PRIEST;
case VILLAGER_SMITH:
return SMITH;
case VILLAGER_BUTCHER:
return BUTCHER;
case HUSK:
return HUSK;
case NORMAL:
default:
return ZOMBIE;
public Husk(RenderManager rendermanager) {
super(rendermanager);
} }
@Override
protected void preRenderCallback(EntityHusk entitylivingbaseIn, float partialTickTime) {
GlStateManager.scale(1.0625F, 1.0625F, 1.0625F);
super.preRenderCallback(entitylivingbaseIn, partialTickTime);
}
@Override
protected ResourceLocation getEntityTexture(EntityHusk zombie) {
return getTexture(HUSK);
}
} }
} }

View file

@ -1,53 +0,0 @@
package com.minelittlepony.renderer;
import com.minelittlepony.model.PMAPI;
import com.minelittlepony.util.Villagers;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityZombieVillager;
import net.minecraft.util.ResourceLocation;
public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager> {
private static final ResourceLocation GENERIC = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png");
private static final ResourceLocation FARMER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_farmer_pony.png");
private static final ResourceLocation LIBRARIAN = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_librarian_pony.png");
private static final ResourceLocation PRIEST = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_priest_pony.png");
private static final ResourceLocation SMITH = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_smith_pony.png");
private static final ResourceLocation BUTCHER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_butcher_pony.png");
public RenderPonyZombieVillager(RenderManager renderManager) {
super(renderManager, PMAPI.villager);
}
@Override
protected ResourceLocation getEntityTexture(EntityZombieVillager villager) {
return getTexture(getTextureForVillager(villager));
}
private ResourceLocation getTextureForVillager(EntityZombieVillager villager) {
switch (villager.getProfession()) { // getProfession
case Villagers.FARMER:
return FARMER; // applejack
case Villagers.LIBRARIAN:
return LIBRARIAN; // twilight sparkle
case Villagers.PRIEST:
return PRIEST; // fluttershy
case Villagers.BLACKSMITH:
return SMITH; // rarity
case Villagers.BUTCHER:
return BUTCHER; // rainbow dash
case Villagers.GENERIC:
default:
return GENERIC; // pinkie pie
}
}
@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);
}
super.applyRotations(villager, p_77043_2_, p_77043_3_, partialTicks);
}
}

View file

@ -22,6 +22,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHandSide; import net.minecraft.util.EnumHandSide;
import org.lwjgl.opengl.GL14; import org.lwjgl.opengl.GL14;
import javax.annotation.Nonnull;
import static net.minecraft.client.renderer.GlStateManager.*; import static net.minecraft.client.renderer.GlStateManager.*;
public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> { public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
@ -35,7 +37,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
} }
@Override @Override
public void doRenderLayer(EntityLivingBase entity, float p_177141_2_, float p_177141_3_, public void doRenderLayer(@Nonnull EntityLivingBase entity, float p_177141_2_, float p_177141_3_,
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
ModelBase model = livingPonyEntity.getMainModel(); ModelBase model = livingPonyEntity.getMainModel();
if (model instanceof ModelHumanPlayer) { if (model instanceof ModelHumanPlayer) {
@ -49,7 +51,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
ItemStack left = mainRight ? itemOff : itemMain; ItemStack left = mainRight ? itemOff : itemMain;
ItemStack right = mainRight ? itemMain : itemOff; ItemStack right = mainRight ? itemMain : itemOff;
if (!left.isEmpty() || !right.isEmpty()) { if (left != null || right != null) {
pushMatrix(); pushMatrix();
if (model instanceof AbstractPonyModel) { if (model instanceof AbstractPonyModel) {
((AbstractPonyModel) model).transform(BodyPart.LEGS); ((AbstractPonyModel) model).transform(BodyPart.LEGS);
@ -69,7 +71,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
} }
private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) { private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) {
if (!drop.isEmpty()) { if (drop != null) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
translateToHand(hand); translateToHand(hand);
@ -129,7 +131,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
GL14.glBlendColor(red, green, blue, alpha); GL14.glBlendColor(red, green, blue, alpha);
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
((IRenderItem)renderItem).useTransparency(true); ((IRenderItem) renderItem).useTransparency(true);
scale(1.1, 1.1, 1.1); scale(1.1, 1.1, 1.1);
@ -138,7 +140,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
translate(.01, -.01, -.02); translate(.01, -.01, -.02);
renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT); renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT);
((IRenderItem)renderItem).useTransparency(false); ((IRenderItem) renderItem).useTransparency(false);
enableLighting(); enableLighting();
popMatrix(); popMatrix();

View file

@ -12,7 +12,7 @@ import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityZombieVillager; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.EntityEquipmentSlot;
@ -24,6 +24,8 @@ import net.minecraft.nbt.NBTUtil;
import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import javax.annotation.Nonnull;
import static net.minecraft.client.renderer.GlStateManager.*; import static net.minecraft.client.renderer.GlStateManager.*;
public class LayerPonySkull implements LayerRenderer<EntityLivingBase> { public class LayerPonySkull implements LayerRenderer<EntityLivingBase> {
@ -35,15 +37,15 @@ public class LayerPonySkull implements LayerRenderer<EntityLivingBase> {
} }
@Override @Override
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float p_177141_3_, public void doRenderLayer(@Nonnull EntityLivingBase entity, float limbSwing, float p_177141_3_,
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD); ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (itemstack != null && itemstack.getItem() != null) { if (itemstack != null) {
AbstractPonyModel model = getModel().getModel(); AbstractPonyModel model = getModel().getModel();
Item item = itemstack.getItem(); Item item = itemstack.getItem();
pushMatrix(); pushMatrix();
boolean isVillager = entity instanceof EntityVillager || entity instanceof EntityZombieVillager; boolean isVillager = entity instanceof EntityVillager || (entity instanceof EntityZombie && ((EntityZombie) entity).isVillager());
model.transform(BodyPart.HEAD); model.transform(BodyPart.HEAD);
model.bipedHead.postRender(0.0625f); model.bipedHead.postRender(0.0625f);

View file

@ -3,10 +3,11 @@ package com.minelittlepony.renderer.layer;
import com.minelittlepony.model.pony.ModelSkeletonPony; import com.minelittlepony.model.pony.ModelSkeletonPony;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.entity.monster.EntityStray; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.SkeletonType;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class LayerPonyStrayOverlay extends LayerOverlayBase<EntityStray> { public class LayerPonyStrayOverlay extends LayerOverlayBase<EntitySkeleton> {
public static final ResourceLocation STRAY_SKELETON_OVERLAY = new ResourceLocation("minelittlepony", "textures/entity/skeleton/stray_pony_overlay.png"); public static final ResourceLocation STRAY_SKELETON_OVERLAY = new ResourceLocation("minelittlepony", "textures/entity/skeleton/stray_pony_overlay.png");
@ -19,9 +20,11 @@ public class LayerPonyStrayOverlay extends LayerOverlayBase<EntityStray> {
} }
@Override @Override
public void doRenderLayer(EntityStray skele, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { public void doRenderLayer(EntitySkeleton skele, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (skele.getSkeletonType() == SkeletonType.STRAY) {
this.renderOverlay(skele, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale); this.renderOverlay(skele, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
} }
}
@Override @Override
protected ModelBase getOverlayModel() { protected ModelBase getOverlayModel() {

View file

@ -1,6 +1,6 @@
{ {
"required": true, "required": true,
"minVersion": "0.6", "minVersion": "0.5.7",
"package": "com.minelittlepony.mixin", "package": "com.minelittlepony.mixin",
"refmap": "mixin.minelp.refmap.json", "refmap": "mixin.minelp.refmap.json",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_8",