diff --git a/build.gradle b/build.gradle index 823c938f..a494bdd2 100644 --- a/build.gradle +++ b/build.gradle @@ -23,19 +23,17 @@ buildscript { apply plugin: 'net.minecraftforge.gradle.liteloader' apply plugin: 'org.spongepowered.mixin' -apply plugin: 'mnm.gradle.ap-ide' group = 'com.minelittlepony' -version = '1.11.0.3-beta2' +version = '1.10.2.7' description = 'Mine Little Pony' targetCompatibility = 1.8 sourceCompatibility = 1.8 minecraft { - version = "1.11" - // first snapshot for 1.11. Change to stable when possible. - mappings = 'snapshot_20161120' + version = "1.10.2" + mappings = 'stable_29' runDir = 'run' 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 { from sourceSets.hdskins.output from litemod.outputs diff --git a/build.number b/build.number index 819d4323..6b30bf83 100644 --- a/build.number +++ b/build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Wed Dec 21 13:27:40 EST 2016 -build.number=294 +#Sat Dec 24 04:03:46 EST 2016 +build.number=296 diff --git a/buildSrc b/buildSrc index f4a8929e..7f6a9b2e 160000 --- a/buildSrc +++ b/buildSrc @@ -1 +1 @@ -Subproject commit f4a8929efc6ecd2f797ddad1f28c48b2c3745104 +Subproject commit 7f6a9b2e44fc9496be253f1595b8585958e04c01 diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/gui/EntityPlayerModel.java b/src/hdskins/java/com/voxelmodpack/hdskins/gui/EntityPlayerModel.java index 305cd47e..4c350e11 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/gui/EntityPlayerModel.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/gui/EntityPlayerModel.java @@ -1,6 +1,5 @@ package com.voxelmodpack.hdskins.gui; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import com.mojang.authlib.GameProfile; 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_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); - private Map armors = Maps.newEnumMap(ImmutableMap.of( - EntityEquipmentSlot.HEAD, ItemStack.EMPTY, - EntityEquipmentSlot.CHEST, ItemStack.EMPTY, - EntityEquipmentSlot.LEGS, ItemStack.EMPTY, - EntityEquipmentSlot.FEET, ItemStack.EMPTY, - EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY - )); + private Map armors = Maps.newEnumMap(EntityEquipmentSlot.class); private PreviewTexture remoteSkinTexture; private ResourceLocation remoteSkinResource; diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java b/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java index 69b89d10..ecbe8862 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java @@ -321,7 +321,7 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe if (guiButton.id == this.btnModeSkin.id) { this.textureType = SKIN; this.btnModeElytra.enabled = true; - stack = ItemStack.EMPTY; + stack = null; } else { this.textureType = ELYTRA; this.btnModeSkin.enabled = true; diff --git a/src/hdskins/resources/mixin.hdskins.json b/src/hdskins/resources/mixin.hdskins.json index 50424bac..429487d2 100644 --- a/src/hdskins/resources/mixin.hdskins.json +++ b/src/hdskins/resources/mixin.hdskins.json @@ -1,6 +1,6 @@ { "required": true, - "minVersion": "0.6", + "minVersion": "0.5.7", "package": "com.voxelmodpack.hdskins.mixin", "refmap": "mixin.hdskins.refmap.json", "mixins": [ diff --git a/src/main/java/com/minelittlepony/MineLittlePony.java b/src/main/java/com/minelittlepony/MineLittlePony.java index 9e7e8f19..1cfccd93 100644 --- a/src/main/java/com/minelittlepony/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/MineLittlePony.java @@ -5,14 +5,10 @@ import com.minelittlepony.gui.PonySettingPanel; import com.minelittlepony.hdskins.gui.EntityPonyModel; import com.minelittlepony.hdskins.gui.GuiSkinsMineLP; import com.minelittlepony.hdskins.gui.RenderPonyModel; -import com.minelittlepony.renderer.RenderPonyEvoker; import com.minelittlepony.renderer.RenderPonyPigman; import com.minelittlepony.renderer.RenderPonySkeleton; -import com.minelittlepony.renderer.RenderPonyVex; import com.minelittlepony.renderer.RenderPonyVillager; -import com.minelittlepony.renderer.RenderPonyVindicator; import com.minelittlepony.renderer.RenderPonyZombie; -import com.minelittlepony.renderer.RenderPonyZombieVillager; import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.util.ModUtilities; 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.settings.KeyBinding; 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.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.EntityZombieVillager; import net.minecraft.entity.passive.EntityVillager; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -100,20 +89,12 @@ public class MineLittlePony { private void saveCurrentRenderers(RenderManager rm) { // villagers this.renderMap.put(EntityVillager.class, rm.getEntityClassRenderObject(EntityVillager.class)); - this.renderMap.put(EntityZombieVillager.class, rm.getEntityClassRenderObject(EntityZombieVillager.class)); // zombies this.renderMap.put(EntityZombie.class, rm.getEntityClassRenderObject(EntityZombie.class)); - this.renderMap.put(EntityHusk.class, rm.getEntityClassRenderObject(EntityHusk.class)); // pig zombie this.renderMap.put(EntityPigZombie.class, rm.getEntityClassRenderObject(EntityPigZombie.class)); // skeletons 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") @@ -127,20 +108,16 @@ public class MineLittlePony { public void initializeMobRenderers(RenderManager rm) { if (this.config.villagers) { ModUtilities.addRenderer(EntityVillager.class, new RenderPonyVillager(rm)); - ModUtilities.addRenderer(EntityZombieVillager.class, new RenderPonyZombieVillager(rm)); logger.info("Villagers are now ponies."); } else { ModUtilities.addRenderer(EntityVillager.class, getRenderer(EntityVillager.class)); - ModUtilities.addRenderer(EntityZombieVillager.class, getRenderer(EntityZombieVillager.class)); } if (this.config.zombies) { ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie<>(rm)); - ModUtilities.addRenderer(EntityHusk.class, new RenderPonyZombie.Husk(rm)); logger.info("Zombies are now ponies."); } else { ModUtilities.addRenderer(EntityZombie.class, getRenderer(EntityZombie.class)); - ModUtilities.addRenderer(EntityHusk.class, getRenderer(EntityHusk.class)); } if (this.config.pigzombies) { @@ -152,25 +129,11 @@ public class MineLittlePony { if (this.config.skeletons) { 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."); } else { 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) { diff --git a/src/main/java/com/minelittlepony/PonyConfig.java b/src/main/java/com/minelittlepony/PonyConfig.java index 39a3f159..94276322 100644 --- a/src/main/java/com/minelittlepony/PonyConfig.java +++ b/src/main/java/com/minelittlepony/PonyConfig.java @@ -26,8 +26,6 @@ public class PonyConfig implements Exposable { public boolean pigzombies = true; @Expose public boolean skeletons = true; - @Expose - public boolean illagers = true; public PonyLevel getPonyLevel() { if (ponylevel == null) diff --git a/src/main/java/com/minelittlepony/gui/PonySettingPanel.java b/src/main/java/com/minelittlepony/gui/PonySettingPanel.java index 8c7fecc0..522aeb1d 100644 --- a/src/main/java/com/minelittlepony/gui/PonySettingPanel.java +++ b/src/main/java/com/minelittlepony/gui/PonySettingPanel.java @@ -32,7 +32,6 @@ public class PonySettingPanel extends GuiScreen { private static final String ZOMBIES = MOB_PREFIX + "zombies"; private static final String ZOMBIE_PIGMEN = MOB_PREFIX + "zombiepigmen"; 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 HUMAN_ID = 1; @@ -46,7 +45,6 @@ public class PonySettingPanel extends GuiScreen { private static final int ZOMBIES_ID = 8; private static final int ZOMBIE_PIGMEN_ID = 9; private static final int SKELETONS_ID = 10; - private static final int ILLAGER_ID = 11; private PonyConfig config; @@ -62,7 +60,7 @@ public class PonySettingPanel extends GuiScreen { @Override public void initGui() { 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; 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))); @@ -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(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))); switch (config.getPonyLevel()) { default: @@ -101,7 +98,6 @@ public class PonySettingPanel extends GuiScreen { zombie.checked = config.zombies; pigmen.checked = config.pigzombies; skeleton.checked = config.skeletons; - illager.checked = config.illagers; } @Override @@ -167,9 +163,6 @@ public class PonySettingPanel extends GuiScreen { case SKELETONS_ID: config.skeletons = checked; break; - case ILLAGER_ID: - config.illagers = checked; - break; } } } diff --git a/src/main/java/com/minelittlepony/model/pony/ModelBreezie.java b/src/main/java/com/minelittlepony/model/pony/ModelBreezie.java deleted file mode 100644 index 7ec7991e..00000000 --- a/src/main/java/com/minelittlepony/model/pony/ModelBreezie.java +++ /dev/null @@ -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; - } - - } - -} diff --git a/src/main/java/com/minelittlepony/model/pony/ModelEvokerPony.java b/src/main/java/com/minelittlepony/model/pony/ModelEvokerPony.java deleted file mode 100644 index 57447e72..00000000 --- a/src/main/java/com/minelittlepony/model/pony/ModelEvokerPony.java +++ /dev/null @@ -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(); - } - } - -} diff --git a/src/main/java/com/minelittlepony/model/pony/ModelIllagerPony.java b/src/main/java/com/minelittlepony/model/pony/ModelIllagerPony.java deleted file mode 100644 index 6661dfe8..00000000 --- a/src/main/java/com/minelittlepony/model/pony/ModelIllagerPony.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/minelittlepony/model/pony/ModelVindicatorPony.java b/src/main/java/com/minelittlepony/model/pony/ModelVindicatorPony.java deleted file mode 100644 index 3533c0fd..00000000 --- a/src/main/java/com/minelittlepony/model/pony/ModelVindicatorPony.java +++ /dev/null @@ -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; - } - } - -} diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyEvoker.java b/src/main/java/com/minelittlepony/renderer/RenderPonyEvoker.java deleted file mode 100644 index edc09a53..00000000 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyEvoker.java +++ /dev/null @@ -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 { - - 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); - } - -} diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonySkeleton.java b/src/main/java/com/minelittlepony/renderer/RenderPonySkeleton.java index c7945d9d..4f5259df 100644 --- a/src/main/java/com/minelittlepony/renderer/RenderPonySkeleton.java +++ b/src/main/java/com/minelittlepony/renderer/RenderPonySkeleton.java @@ -9,14 +9,13 @@ import com.minelittlepony.renderer.layer.LayerPonyStrayOverlay; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; -import net.minecraft.entity.monster.AbstractSkeleton; -import net.minecraft.entity.monster.EntityStray; -import net.minecraft.entity.monster.EntityWitherSkeleton; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.SkeletonType; import net.minecraft.util.ResourceLocation; import java.util.Random; -public class RenderPonySkeleton extends RenderPonyMob { +public class RenderPonySkeleton extends RenderPonyMob { 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"); @@ -31,6 +30,7 @@ public class RenderPonySkeleton extends Rende this.modelArmor = PMAPI.skeleton.getArmor().modelArmorChestplate; } }); + this.addLayer(new LayerPonyStrayOverlay(this)); } @Override @@ -55,43 +55,27 @@ public class RenderPonySkeleton extends Rende this.playerModel.getModel().metadata.setSize(size == PonySize.FOAL ? PonySize.NORMAL : size); this.playerModel.getModel().metadata.setTail(TailLengths.STUB); this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); + + if (skeleton.getSkeletonType() == SkeletonType.WITHER) { + GlStateManager.scale(1.2F, 1.2F, 1.2F); + } } @Override protected ResourceLocation getEntityTexture(Skeleton entity) { - return getTexture(SKELETON); + return getTexture(getResource(entity)); } - public static class Stray extends RenderPonySkeleton { - - public Stray(RenderManager rm) { - super(rm); - this.addLayer(new LayerPonyStrayOverlay(this)); + private ResourceLocation getResource(Skeleton entity) { + switch (entity.getSkeletonType()) { + case WITHER: + return WITHER; + case STRAY: + return STRAY; + case NORMAL: + default: + return SKELETON; } - - @Override - protected ResourceLocation getEntityTexture(EntityStray entity) { - return getTexture(STRAY); - } - } - - public static class Wither extends RenderPonySkeleton { - - 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); - } - } } diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyVex.java b/src/main/java/com/minelittlepony/renderer/RenderPonyVex.java deleted file mode 100644 index a3126bb3..00000000 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyVex.java +++ /dev/null @@ -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 { - - 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; - } - -} diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyVindicator.java b/src/main/java/com/minelittlepony/renderer/RenderPonyVindicator.java deleted file mode 100644 index 9f996fa7..00000000 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyVindicator.java +++ /dev/null @@ -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 { - - 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); - } - -} diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java b/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java index af2ef418..772c2f46 100644 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java +++ b/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java @@ -7,8 +7,8 @@ import com.minelittlepony.TailLengths; import com.minelittlepony.model.PMAPI; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.monster.EntityHusk; import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.ZombieType; import net.minecraft.util.ResourceLocation; import java.util.Random; @@ -18,6 +18,13 @@ public class RenderPonyZombie 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"); + 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) { super(rendermanager, PMAPI.zombie); } @@ -59,6 +66,17 @@ public class RenderPonyZombie extends RenderPonyMob // glow 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 randEnum(Random rand, Class en) { @@ -68,26 +86,30 @@ public class RenderPonyZombie extends RenderPonyMob @Override protected ResourceLocation getEntityTexture(Zombie zombie) { - return getTexture(ZOMBIE); + + return getTexture(getResource(zombie)); } - public static class Husk extends RenderPonyZombie { + 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); - } - } } diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyZombieVillager.java b/src/main/java/com/minelittlepony/renderer/RenderPonyZombieVillager.java deleted file mode 100644 index 47c8665a..00000000 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyZombieVillager.java +++ /dev/null @@ -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 { - - 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); - } -} diff --git a/src/main/java/com/minelittlepony/renderer/layer/LayerHeldPonyItem.java b/src/main/java/com/minelittlepony/renderer/layer/LayerHeldPonyItem.java index 8ce6d503..7c6c3804 100644 --- a/src/main/java/com/minelittlepony/renderer/layer/LayerHeldPonyItem.java +++ b/src/main/java/com/minelittlepony/renderer/layer/LayerHeldPonyItem.java @@ -22,6 +22,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHandSide; import org.lwjgl.opengl.GL14; +import javax.annotation.Nonnull; + import static net.minecraft.client.renderer.GlStateManager.*; public class LayerHeldPonyItem implements LayerRenderer { @@ -35,7 +37,7 @@ public class LayerHeldPonyItem implements LayerRenderer { } @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) { ModelBase model = livingPonyEntity.getMainModel(); if (model instanceof ModelHumanPlayer) { @@ -49,7 +51,7 @@ public class LayerHeldPonyItem implements LayerRenderer { ItemStack left = mainRight ? itemOff : itemMain; ItemStack right = mainRight ? itemMain : itemOff; - if (!left.isEmpty() || !right.isEmpty()) { + if (left != null || right != null) { pushMatrix(); if (model instanceof AbstractPonyModel) { ((AbstractPonyModel) model).transform(BodyPart.LEGS); @@ -69,7 +71,7 @@ public class LayerHeldPonyItem implements LayerRenderer { } private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) { - if (!drop.isEmpty()) { + if (drop != null) { GlStateManager.pushMatrix(); translateToHand(hand); @@ -129,7 +131,7 @@ public class LayerHeldPonyItem implements LayerRenderer { GL14.glBlendColor(red, green, blue, alpha); RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); - ((IRenderItem)renderItem).useTransparency(true); + ((IRenderItem) renderItem).useTransparency(true); scale(1.1, 1.1, 1.1); @@ -138,7 +140,7 @@ public class LayerHeldPonyItem implements LayerRenderer { translate(.01, -.01, -.02); renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT); - ((IRenderItem)renderItem).useTransparency(false); + ((IRenderItem) renderItem).useTransparency(false); enableLighting(); popMatrix(); diff --git a/src/main/java/com/minelittlepony/renderer/layer/LayerPonySkull.java b/src/main/java/com/minelittlepony/renderer/layer/LayerPonySkull.java index 1dc03b9e..d2981e64 100644 --- a/src/main/java/com/minelittlepony/renderer/layer/LayerPonySkull.java +++ b/src/main/java/com/minelittlepony/renderer/layer/LayerPonySkull.java @@ -12,7 +12,7 @@ import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; 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.init.Items; import net.minecraft.inventory.EntityEquipmentSlot; @@ -24,6 +24,8 @@ import net.minecraft.nbt.NBTUtil; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.EnumFacing; +import javax.annotation.Nonnull; + import static net.minecraft.client.renderer.GlStateManager.*; public class LayerPonySkull implements LayerRenderer { @@ -35,15 +37,15 @@ public class LayerPonySkull implements LayerRenderer { } @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) { ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD); - if (itemstack != null && itemstack.getItem() != null) { + if (itemstack != null) { AbstractPonyModel model = getModel().getModel(); Item item = itemstack.getItem(); 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.bipedHead.postRender(0.0625f); diff --git a/src/main/java/com/minelittlepony/renderer/layer/LayerPonyStrayOverlay.java b/src/main/java/com/minelittlepony/renderer/layer/LayerPonyStrayOverlay.java index afc39a40..ab7e95d9 100644 --- a/src/main/java/com/minelittlepony/renderer/layer/LayerPonyStrayOverlay.java +++ b/src/main/java/com/minelittlepony/renderer/layer/LayerPonyStrayOverlay.java @@ -3,10 +3,11 @@ package com.minelittlepony.renderer.layer; import com.minelittlepony.model.pony.ModelSkeletonPony; import net.minecraft.client.model.ModelBase; 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; -public class LayerPonyStrayOverlay extends LayerOverlayBase { +public class LayerPonyStrayOverlay extends LayerOverlayBase { public static final ResourceLocation STRAY_SKELETON_OVERLAY = new ResourceLocation("minelittlepony", "textures/entity/skeleton/stray_pony_overlay.png"); @@ -19,8 +20,10 @@ public class LayerPonyStrayOverlay extends LayerOverlayBase { } @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(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); + } } @Override diff --git a/src/main/resources/mixin.minelp.json b/src/main/resources/mixin.minelp.json index f7d6fedb..b49b7f1e 100644 --- a/src/main/resources/mixin.minelp.json +++ b/src/main/resources/mixin.minelp.json @@ -1,6 +1,6 @@ { "required": true, - "minVersion": "0.6", + "minVersion": "0.5.7", "package": "com.minelittlepony.mixin", "refmap": "mixin.minelp.refmap.json", "compatibilityLevel": "JAVA_8",