mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Initial update for 1.8.9
- liteloader doesn't work yet so can't test.
This commit is contained in:
parent
4f448be9b6
commit
53be604f85
16 changed files with 95 additions and 132 deletions
22
build.gradle
22
build.gradle
|
@ -11,30 +11,27 @@ buildscript {
|
|||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.0-SNAPSHOT'
|
||||
classpath 'org.spongepowered:mixingradle:0.3-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||
classpath 'org.spongepowered:mixingradle:0.4-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
id 'mnm.gradle.ap-ide' version '1.0.2'
|
||||
}
|
||||
|
||||
ext.revision = 200
|
||||
ext.revision = 210
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.tweaker-client'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
|
||||
archivesBaseName = "MineLittlePony"
|
||||
group = 'com.brohoof.minelp'
|
||||
version = '1.8'
|
||||
version = '1.8.9'
|
||||
|
||||
ext.startClass = 'com.mumfrey.liteloader.debug.Start'
|
||||
minecraft {
|
||||
version = "1.8"
|
||||
mappings = 'stable_18'
|
||||
version = "1.8.9"
|
||||
mappings = 'stable_20'
|
||||
runDir = 'run'
|
||||
replace '@VERSION@',project.version
|
||||
tweakClass = 'com.mumfrey.liteloader.launch.LiteLoaderTweaker'
|
||||
tweakClass = 'com.mumfrey.liteloader.launch.LiteLoaderTweaker'
|
||||
}
|
||||
sourceSets {
|
||||
def deps = [
|
||||
|
@ -88,8 +85,8 @@ repositories{
|
|||
|
||||
dependencies {
|
||||
// compile project('LiteLoader')
|
||||
deobfCompile '1:liteloader:1.8-SNAPSHOT'
|
||||
compile 'org.spongepowered:mixin:0.5.2-SNAPSHOT'
|
||||
// deobfCompile '1:liteloader:1.8.9-SNAPSHOT'
|
||||
compile 'org.spongepowered:mixin:0.5.3-SNAPSHOT'
|
||||
compile 'org.ow2.asm:asm-debug-all:5.0.3'
|
||||
compile 'net.minecraft:launchwrapper:1.12'
|
||||
}
|
||||
|
@ -98,6 +95,7 @@ jar {
|
|||
from sourceSets.findAll { it.name != 'api' }*.output
|
||||
|
||||
extension 'litemod'
|
||||
appendix "mc$minecraft.version"
|
||||
}
|
||||
mixin {
|
||||
defaultObfuscationEnv notch
|
||||
|
|
|
@ -78,6 +78,7 @@ import net.minecraft.client.renderer.Tessellator;
|
|||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
@ -479,12 +480,12 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe
|
|||
}
|
||||
|
||||
this.mc.getTextureManager().bindTexture(cubemapTextures[cubeSide]);
|
||||
wr.startDrawingQuads();
|
||||
wr.setColorRGBA_I(0xffffff, 255 / (blendPass + 1));
|
||||
wr.addVertexWithUV(-1.0D, -1.0D, 1.0D, 0.0D, 0.0D);
|
||||
wr.addVertexWithUV(1.0D, -1.0D, 1.0D, 1.0D, 0.0D);
|
||||
wr.addVertexWithUV(1.0D, 1.0D, 1.0D, 1.0D, 1.0D);
|
||||
wr.addVertexWithUV(-1.0D, 1.0D, 1.0D, 0.0D, 1.0D);
|
||||
// wr.setColorRGBA_I(0xffffff, 255 / (blendPass + 1));
|
||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
wr.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).endVertex();
|
||||
wr.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).endVertex();
|
||||
wr.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).endVertex();
|
||||
wr.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).endVertex();
|
||||
tessellator.draw();
|
||||
popMatrix();
|
||||
}
|
||||
|
@ -510,16 +511,16 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe
|
|||
colorMask(true, true, true, false);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer wr = tessellator.getWorldRenderer();
|
||||
wr.startDrawingQuads();
|
||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
byte blurPasses = 4;
|
||||
|
||||
for (int blurPass = 0; blurPass < blurPasses; ++blurPass) {
|
||||
wr.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (blurPass + 1));
|
||||
// wr.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (blurPass + 1));
|
||||
float var7 = (blurPass - blurPasses / 2) / 256.0F;
|
||||
wr.addVertexWithUV(this.width, this.height, this.zLevel, 0.0F + var7, 0.0D);
|
||||
wr.addVertexWithUV(this.width, 0.0D, this.zLevel, 1.0F + var7, 0.0D);
|
||||
wr.addVertexWithUV(0.0D, 0.0D, this.zLevel, 1.0F + var7, 1.0D);
|
||||
wr.addVertexWithUV(0.0D, this.height, this.zLevel, 0.0F + var7, 1.0D);
|
||||
wr.pos(this.width, this.height, this.zLevel).tex(0.0F + var7, 0.0D).endVertex();
|
||||
wr.pos(this.width, 0.0D, this.zLevel).tex(1.0F + var7, 0.0D).endVertex();
|
||||
wr.pos(0.0D, 0.0D, this.zLevel).tex(1.0F + var7, 1.0D).endVertex();
|
||||
wr.pos(0.0D, this.height, this.zLevel).tex(0.0F + var7, 1.0D).endVertex();
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
|
@ -541,17 +542,17 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe
|
|||
viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer wr = tessellator.getWorldRenderer();
|
||||
wr.startDrawingQuads();
|
||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
float aspect = this.width > this.height ? 120.0F / this.width : 120.0F / this.height;
|
||||
float uSample = this.height * aspect / 256.0F;
|
||||
float vSample = this.width * aspect / 256.0F;
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
||||
wr.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
wr.addVertexWithUV(0.0D, this.height, this.zLevel, 0.5F - uSample, 0.5F + vSample);
|
||||
wr.addVertexWithUV(this.width, this.height, this.zLevel, 0.5F - uSample, 0.5F - vSample);
|
||||
wr.addVertexWithUV(this.width, 0.0D, this.zLevel, 0.5F + uSample, 0.5F - vSample);
|
||||
wr.addVertexWithUV(0.0D, 0.0D, this.zLevel, 0.5F + uSample, 0.5F + vSample);
|
||||
// wr.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
wr.pos(0.0D, this.height, this.zLevel).tex(0.5F - uSample, 0.5F + vSample).endVertex();
|
||||
wr.pos(this.width, this.height, this.zLevel).tex(0.5F - uSample, 0.5F - vSample).endVertex();
|
||||
wr.pos(this.width, 0.0D, this.zLevel).tex(0.5F + uSample, 0.5F - vSample).endVertex();
|
||||
wr.pos(0.0D, 0.0D, this.zLevel).tex(0.5F + uSample, 0.5F + vSample).endVertex();
|
||||
tessellator.draw();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.voxelmodpack.hdskins.gui;
|
||||
|
||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||
import static net.minecraft.client.renderer.GlStateManager.popAttrib;
|
||||
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.scale;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -8,24 +11,21 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.model.ModelPlayer;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderPlayerModel extends RenderLiving {
|
||||
public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving<M> {
|
||||
|
||||
public RenderPlayerModel(RenderManager renderer) {
|
||||
super(renderer, new ModelPlayer(0, false), 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity var1) {
|
||||
return ((EntityPlayerModel) var1).getSkinTexture();
|
||||
protected ResourceLocation getEntityTexture(M var1) {
|
||||
return var1.getSkinTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canRenderName(EntityLivingBase targetEntity) {
|
||||
protected boolean canRenderName(M targetEntity) {
|
||||
if (Minecraft.getMinecraft().thePlayer != null) {
|
||||
return super.canRenderName(targetEntity);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class RenderPlayerModel extends RenderLiving {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean setBrightness(EntityLivingBase entitylivingbaseIn, float partialTicks, boolean p_177092_3_) {
|
||||
protected boolean setBrightness(M entitylivingbaseIn, float partialTicks, boolean p_177092_3_) {
|
||||
if (Minecraft.getMinecraft().theWorld != null) {
|
||||
return super.setBrightness(entitylivingbaseIn, partialTicks, p_177092_3_);
|
||||
}
|
||||
|
@ -41,24 +41,24 @@ public class RenderPlayerModel extends RenderLiving {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void doRender(EntityPlayerModel par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
this.doRender((EntityLiving) par1Entity, par2, par4, par6, par8, par9);
|
||||
this.doRender(par1Entity, par2, par4, par6, par8, par9);
|
||||
popAttrib();
|
||||
pushMatrix();
|
||||
scale(1.0F, -1.0F, 1.0F);
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
this.doRender((EntityLiving) par1Entity, par2, par4, par6, par8, par9);
|
||||
this.doRender(par1Entity, par2, par4, par6, par8, par9);
|
||||
popAttrib();
|
||||
popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityLivingBase par1EntityLiving, float par2) {
|
||||
this.renderCloak((EntityPlayerModel) par1EntityLiving, par2);
|
||||
protected void preRenderCallback(M par1EntityLiving, float par2) {
|
||||
this.renderCloak(par1EntityLiving, par2);
|
||||
}
|
||||
|
||||
protected void renderCloak(EntityPlayerModel entity, float par2) {
|
||||
protected void renderCloak(M entity, float par2) {
|
||||
super.preRenderCallback(entity, par2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,12 @@ import com.voxelmodpack.hdskins.HDSkinManager;
|
|||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@Mixin(TileEntitySkullRenderer.class)
|
||||
public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer {
|
||||
public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer<TileEntitySkull> {
|
||||
|
||||
@Inject(method = "renderSkull",
|
||||
at = @At(
|
||||
|
|
|
@ -52,7 +52,7 @@ public class LiteModHDSkinsMod implements HDSkinsMod {
|
|||
|
||||
@Override
|
||||
public void onInitCompleted(Minecraft minecraft, LiteLoader loader) {
|
||||
ModUtilities.addRenderer(EntityPlayerModel.class, new RenderPlayerModel(minecraft.getRenderManager()));
|
||||
ModUtilities.addRenderer(EntityPlayerModel.class, new RenderPlayerModel<EntityPlayerModel>(minecraft.getRenderManager()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,12 +72,12 @@ public class MineLittlePony {
|
|||
}
|
||||
|
||||
if (this.config.zombies) {
|
||||
ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie(rm));
|
||||
ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie<EntityZombie>(rm));
|
||||
MineLPLogger.info("Zombies are now ponies.");
|
||||
}
|
||||
|
||||
if (this.config.pigzombies) {
|
||||
ModUtilities.addRenderer(EntityPigZombie.class, new RenderPonyZombie(rm));
|
||||
ModUtilities.addRenderer(EntityPigZombie.class, new RenderPonyZombie<EntityPigZombie>(rm));
|
||||
MineLPLogger.info("Zombie pigmen are now ponies.");
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public class Pony {
|
|||
public Pony(AbstractClientPlayer player) {
|
||||
this.textureResourceLocation = player.getLocationSkin();
|
||||
MineLPLogger.debug("+ Initialising new pony #%d for player %s (%s) with resource location %s.", this.ponyId,
|
||||
player.getCommandSenderName(), player.getUniqueID(), this.textureResourceLocation);
|
||||
player.getName(), player.getUniqueID(), this.textureResourceLocation);
|
||||
this.checkSkin(this.textureResourceLocation);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,29 +3,26 @@ package com.brohoof.minelittlepony.hdskins.gui;
|
|||
import com.brohoof.minelittlepony.MineLittlePony;
|
||||
import com.brohoof.minelittlepony.Pony;
|
||||
import com.brohoof.minelittlepony.model.PlayerModel;
|
||||
import com.voxelmodpack.hdskins.gui.EntityPlayerModel;
|
||||
import com.voxelmodpack.hdskins.gui.RenderPlayerModel;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
public class RenderPonyModel extends RenderPlayerModel {
|
||||
public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
|
||||
|
||||
public RenderPonyModel(RenderManager renderer) {
|
||||
super(renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
this.bindEntityTexture(par1EntityLivingBase);
|
||||
EntityPlayerModel playerModelEntity = (EntityPlayerModel) par1EntityLivingBase;
|
||||
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(this.getEntityTexture(playerModelEntity));
|
||||
protected void renderModel(EntityPonyModel playermodel, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
this.bindEntityTexture(playermodel);
|
||||
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(this.getEntityTexture(playermodel));
|
||||
thePony.checkSkin();
|
||||
// TODO small arms
|
||||
PlayerModel pm = thePony.getModel(true, false);
|
||||
this.mainModel = pm.getModel();
|
||||
pm.apply(thePony.metadata);
|
||||
this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7);
|
||||
this.mainModel.render(playermodel, par2, par3, par4, par5, par6, par7);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,13 +27,12 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
|||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerArrow;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@Mixin(RenderPlayer.class)
|
||||
public abstract class MixinRenderPlayer extends RendererLivingEntity implements IRenderPony {
|
||||
public abstract class MixinRenderPlayer extends RendererLivingEntity<AbstractClientPlayer> implements IRenderPony {
|
||||
|
||||
private static final String RenderManager = "Lnet/minecraft/client/renderer/entity/RenderManager;";
|
||||
private static final String AbstractClientPlayer = "Lnet/minecraft/client/entity/AbstractClientPlayer;";
|
||||
|
@ -152,16 +151,12 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements
|
|||
this.playerModel.apply(thePony.metadata);
|
||||
}
|
||||
|
||||
private ResourceLocation getEntityTexture(AbstractClientPlayer player) {
|
||||
@Override
|
||||
public ResourceLocation getEntityTexture(AbstractClientPlayer player) {
|
||||
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(player);
|
||||
return thePony.getTextureResourceLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ResourceLocation getEntityTexture(Entity entity) {
|
||||
return this.getEntityTexture((AbstractClientPlayer) entity);
|
||||
}
|
||||
|
||||
private PlayerModel getModel(AbstractClientPlayer player) {
|
||||
ResourceLocation skin = getEntityTexture(player);
|
||||
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(skin);
|
||||
|
|
|
@ -12,13 +12,10 @@ import com.brohoof.minelittlepony.renderer.layer.LayerPonySkull;
|
|||
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving implements IRenderPony {
|
||||
public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving<T> implements IRenderPony {
|
||||
|
||||
protected AbstractPonyModel mobModel;
|
||||
protected PlayerModel playerModel;
|
||||
|
@ -35,7 +32,7 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
|||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double xPosition, double yPosition, double zPosition, float yaw,
|
||||
public void doRender(T entity, double xPosition, double yPosition, double zPosition, float yaw,
|
||||
float partialTicks) {
|
||||
double yOrigin = yPosition;
|
||||
if (entity.isSneaking()) {
|
||||
|
@ -47,19 +44,8 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
|||
this.playerModel.getModel().heldItemRight = 0;
|
||||
}
|
||||
|
||||
protected abstract ResourceLocation getEntityTexture(T var1);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected final ResourceLocation getEntityTexture(Entity var1) {
|
||||
return this.getEntityTexture((T) var1);
|
||||
}
|
||||
|
||||
protected void preRenderCallback(T entity, float partick) {}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected final void preRenderCallback(EntityLivingBase entitylivingbaseIn, float partialTickTime) {
|
||||
protected void preRenderCallback(T entitylivingbaseIn, float partialTickTime) {
|
||||
|
||||
ItemStack heldItem = entitylivingbaseIn.getHeldItem();
|
||||
this.playerModel.getModel().heldItemRight = heldItem == null ? 0 : 1;
|
||||
|
@ -75,18 +61,6 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
|||
if (MineLittlePony.getConfig().showscale) {
|
||||
this.shadowSize = 0.4F;
|
||||
}
|
||||
|
||||
preRenderCallback((T) entitylivingbaseIn, partialTickTime);
|
||||
}
|
||||
|
||||
protected void rotateCorpse(T entity, float xPosition, float yPosition, float zPosition) {
|
||||
super.rotateCorpse(entity, xPosition, yPosition, zPosition);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected final void rotateCorpse(EntityLivingBase entity, float xPosition, float yPosition, float zPosition) {
|
||||
this.rotateCorpse((T) entity, xPosition, yPosition, zPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,6 +29,7 @@ public class RenderPonySkeleton extends RenderPonyMob<EntitySkeleton> {
|
|||
|
||||
@Override
|
||||
protected void preRenderCallback(EntitySkeleton skeleton, float partialTicks) {
|
||||
super.preRenderCallback(skeleton, partialTicks);
|
||||
if (skeleton.getSkeletonType() == 1) {
|
||||
GlStateManager.scale(1.2F, 1.2F, 1.2F);
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@ import net.minecraft.entity.monster.EntityPigZombie;
|
|||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderPonyZombie extends RenderPonyMob<EntityZombie> {
|
||||
public class RenderPonyZombie<Zombie extends EntityZombie> extends RenderPonyMob<Zombie> {
|
||||
|
||||
public RenderPonyZombie(RenderManager rendermanager) {
|
||||
super(rendermanager, PMAPI.zombie);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityZombie entity, float partick) {
|
||||
protected void preRenderCallback(Zombie entity, float partick) {
|
||||
Random rand = new Random(entity.getUniqueID().hashCode());
|
||||
|
||||
// 50-50 chance for gender
|
||||
|
@ -64,7 +64,7 @@ public class RenderPonyZombie extends RenderPonyMob<EntityZombie> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void rotateCorpse(EntityZombie zombie, float xPosition, float yPosition, float zPosition) {
|
||||
protected void rotateCorpse(Zombie zombie, float xPosition, float yPosition, float zPosition) {
|
||||
super.rotateCorpse(zombie, xPosition, yPosition, zPosition);
|
||||
if (zombie.isConverting()) {
|
||||
yPosition += (float) (Math.cos(zombie.ticksExisted * 3.25D) * Math.PI * 0.25D);
|
||||
|
@ -72,7 +72,7 @@ public class RenderPonyZombie extends RenderPonyMob<EntityZombie> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityZombie zombie) {
|
||||
protected ResourceLocation getEntityTexture(Zombie zombie) {
|
||||
return zombie instanceof EntityPigZombie ? PonyManager.PIGMAN
|
||||
: (zombie.isVillager() ? PonyManager.ZOMBIE_VILLAGER
|
||||
: PonyManager.ZOMBIE);
|
||||
|
|
|
@ -14,8 +14,8 @@ import com.brohoof.minelittlepony.renderer.IRenderPony;
|
|||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
|
||||
|
@ -30,12 +30,12 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LayerHeldPonyItem implements LayerRenderer {
|
||||
public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
|
||||
|
||||
private final RendererLivingEntity livingPonyEntity;
|
||||
private final RendererLivingEntity<? extends EntityLivingBase> livingPonyEntity;
|
||||
private LayerHeldItem held;
|
||||
|
||||
public LayerHeldPonyItem(RendererLivingEntity livingPony) {
|
||||
public LayerHeldPonyItem(RendererLivingEntity<? extends EntityLivingBase> livingPony) {
|
||||
this.livingPonyEntity = livingPony;
|
||||
this.held = new LayerHeldItem(livingPony);
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class LayerHeldPonyItem implements LayerRenderer {
|
|||
float green = (glowColor >> 8 & 255) / 255.0F;
|
||||
float blue = (glowColor & 255) / 255.0F;
|
||||
float alpha = 0.2F;
|
||||
// disableLighting();
|
||||
// disableLighting();
|
||||
enableBlend();
|
||||
blendFunc(GL11.GL_CONSTANT_COLOR, 1);
|
||||
GL14.glBlendColor(red, green, blue, alpha);
|
||||
|
@ -119,7 +119,8 @@ public class LayerHeldPonyItem implements LayerRenderer {
|
|||
|
||||
scale(2, 2, 2);
|
||||
|
||||
applyTransform(model.getItemCameraTransforms().thirdPerson);
|
||||
model.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
applyTransform(model.getItemCameraTransforms(), TransformType.THIRD_PERSON);
|
||||
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
scale(1.1, 1.1, 1.1);
|
||||
if (model.isGui3d()) {
|
||||
|
@ -174,14 +175,7 @@ public class LayerHeldPonyItem implements LayerRenderer {
|
|||
return ibakedmodel;
|
||||
}
|
||||
|
||||
// Copied from RenderItem
|
||||
//@formatter:off
|
||||
private void applyTransform(ItemTransformVec3f transform) {
|
||||
translate(transform.translation.x + RenderItem.debugItemOffsetX, transform.translation.y + RenderItem.debugItemOffsetY, transform.translation.z + RenderItem.debugItemOffsetZ);
|
||||
rotate(transform.rotation.y + RenderItem.debugItemRotationOffsetY, 0.0F, 1.0F, 0.0F);
|
||||
rotate(transform.rotation.x + RenderItem.debugItemRotationOffsetX, 1.0F, 0.0F, 0.0F);
|
||||
rotate(transform.rotation.z + RenderItem.debugItemRotationOffsetZ, 0.0F, 0.0F, 1.0F);
|
||||
scale(transform.scale.x + RenderItem.debugItemScaleX, transform.scale.y + RenderItem.debugItemScaleY, transform.scale.z + RenderItem.debugItemScaleZ);
|
||||
private void applyTransform(ItemCameraTransforms camera, TransformType type) {
|
||||
camera.applyTransform(type);
|
||||
}
|
||||
//@formatter:on
|
||||
}
|
||||
|
|
|
@ -25,18 +25,18 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LayerPonyArmor implements LayerRenderer {
|
||||
public class LayerPonyArmor implements LayerRenderer<EntityLivingBase> {
|
||||
|
||||
private static final ResourceLocation ENCHANTED_ITEM_GLINT_RES = new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
private static final Map<String, ResourceLocation> HUMAN_ARMORS = Maps.newHashMap();
|
||||
private static final Map<ResourceLocation, ResourceLocation> PONY_ARMORS = Maps.newHashMap();
|
||||
|
||||
private RendererLivingEntity renderer;
|
||||
private RendererLivingEntity<? extends EntityLivingBase> renderer;
|
||||
private LayerBipedArmor humanArmor;
|
||||
private PlayerModel pony;
|
||||
|
||||
public LayerPonyArmor(RendererLivingEntity entity) {
|
||||
public LayerPonyArmor(RendererLivingEntity<? extends EntityLivingBase> entity) {
|
||||
this.renderer = entity;
|
||||
this.humanArmor = new LayerBipedArmor(entity);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
package com.brohoof.minelittlepony.renderer.layer;
|
||||
|
||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.rotate;
|
||||
import static net.minecraft.client.renderer.GlStateManager.scale;
|
||||
import static net.minecraft.client.renderer.GlStateManager.translate;
|
||||
|
||||
import com.brohoof.minelittlepony.PonySize;
|
||||
import com.brohoof.minelittlepony.model.PlayerModel;
|
||||
|
@ -12,26 +16,19 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
|
|||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerCape;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EnumPlayerModelParts;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class LayerPonyCape implements LayerRenderer {
|
||||
public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
|
||||
|
||||
private RendererLivingEntity renderer;
|
||||
private RendererLivingEntity<? extends AbstractClientPlayer> renderer;
|
||||
private LayerCape cape;
|
||||
|
||||
public LayerPonyCape(RendererLivingEntity entity) {
|
||||
public LayerPonyCape(RendererLivingEntity<? extends AbstractClientPlayer> entity) {
|
||||
renderer = entity;
|
||||
this.cape = new LayerCape((RenderPlayer) entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityLivingBase entity, float p2, float p3, float ticks, float p5, float p6, float p7,
|
||||
float scale) {
|
||||
doRenderLayer((AbstractClientPlayer) entity, p2, p3, ticks, p5, p6, p7, scale);
|
||||
}
|
||||
|
||||
public void doRenderLayer(AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6,
|
||||
float p7, float scale) {
|
||||
PlayerModel model = ((IRenderPony) renderer).getPony();
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.brohoof.minelittlepony.renderer.layer;
|
||||
|
||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||
import static net.minecraft.client.renderer.GlStateManager.color;
|
||||
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
||||
import static net.minecraft.client.renderer.GlStateManager.rotate;
|
||||
import static net.minecraft.client.renderer.GlStateManager.scale;
|
||||
import static net.minecraft.client.renderer.GlStateManager.translate;
|
||||
|
||||
import com.brohoof.minelittlepony.PonySize;
|
||||
import com.brohoof.minelittlepony.model.AbstractPonyModel;
|
||||
|
@ -26,11 +31,11 @@ import net.minecraft.nbt.NBTUtil;
|
|||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class LayerPonySkull implements LayerRenderer {
|
||||
public class LayerPonySkull implements LayerRenderer<EntityLivingBase> {
|
||||
|
||||
private RendererLivingEntity renderer;
|
||||
private RendererLivingEntity<? extends EntityLivingBase> renderer;
|
||||
|
||||
public LayerPonySkull(RendererLivingEntity renderPony) {
|
||||
public LayerPonySkull(RendererLivingEntity<? extends EntityLivingBase> renderPony) {
|
||||
this.renderer = renderPony;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue