Added a temporary texture overlay (borrowed from the Faithful 32x texture pack, until a unique one is made) for the corrupted zombie. Generalized enough so that new mobs can have them added easily.
This commit is contained in:
parent
80af2463b3
commit
f0a5b5274f
|
@ -1,8 +1,6 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.model.ModelZombie;
|
||||
import net.minecraft.client.model.ModelZombieVillager;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
|
@ -14,23 +12,19 @@ import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
||||
{
|
||||
private static final ResourceLocation ZOMBIE_TEXTURES = new ResourceLocation("bloodmagic", "textures/entities/zombie_raw.png");
|
||||
private final ModelBiped defaultModel;
|
||||
private final ModelZombieVillager zombieVillagerModel;
|
||||
private final List<LayerRenderer<EntityCorruptedZombie>> defaultLayers;
|
||||
|
||||
public RenderCorruptedZombie(RenderManager renderManagerIn)
|
||||
{
|
||||
super(renderManagerIn, new ModelZombie(), 0.5F, 1.0F);
|
||||
LayerRenderer<?> layerrenderer = (LayerRenderer) this.layerRenderers.get(0);
|
||||
this.defaultModel = this.modelBipedMain;
|
||||
this.zombieVillagerModel = new ModelZombieVillager();
|
||||
this.addLayer(new LayerHeldItem(this));
|
||||
LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this)
|
||||
|
@ -42,7 +36,6 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
}
|
||||
};
|
||||
this.addLayer(layerbipedarmor);
|
||||
this.defaultLayers = Lists.newArrayList(this.layerRenderers);
|
||||
|
||||
if (layerrenderer instanceof LayerCustomHead)
|
||||
{
|
||||
|
@ -51,6 +44,7 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
}
|
||||
|
||||
this.removeLayer(layerbipedarmor);
|
||||
this.addLayer(new LayerWill<EntityCorruptedZombie>(this, new ModelZombie(1.2f, false)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,7 +61,6 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
*/
|
||||
public void doRender(EntityCorruptedZombie entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
this.swapArmor(entity);
|
||||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
|
@ -76,27 +69,12 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
|
|||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityCorruptedZombie entity)
|
||||
{
|
||||
|
||||
{
|
||||
return ZOMBIE_TEXTURES;
|
||||
}
|
||||
}
|
||||
|
||||
private void swapArmor(EntityCorruptedZombie zombie)
|
||||
{
|
||||
|
||||
{
|
||||
this.mainModel = this.defaultModel;
|
||||
this.layerRenderers = this.defaultLayers;
|
||||
}
|
||||
|
||||
this.modelBipedMain = (ModelBiped) this.mainModel;
|
||||
}
|
||||
|
||||
protected void rotateCorpse(EntityCorruptedZombie entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
|
||||
{
|
||||
|
||||
super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityDemonBase;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LayerWill<T extends EntityDemonBase> implements LayerRenderer<T>
|
||||
{
|
||||
private static final ResourceLocation LIGHTNING_TEXTURE = new ResourceLocation("bloodmagic", "textures/entities/overlay/overlay_raw.png");
|
||||
private final RenderLiving<T> renderer;
|
||||
private final ModelBase model;
|
||||
|
||||
public LayerWill(RenderLiving<T> rendererIn, ModelBase model)
|
||||
{
|
||||
this.renderer = rendererIn;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(EntityDemonBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
// if (entitylivingbaseIn.getPowered())
|
||||
{
|
||||
boolean flag = entitylivingbaseIn.isInvisible();
|
||||
GlStateManager.depthMask(!flag);
|
||||
this.renderer.bindTexture(LIGHTNING_TEXTURE);
|
||||
GlStateManager.matrixMode(5890);
|
||||
GlStateManager.loadIdentity();
|
||||
float f = (float) entitylivingbaseIn.ticksExisted + partialTicks;
|
||||
GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F);
|
||||
GlStateManager.matrixMode(5888);
|
||||
GlStateManager.enableBlend();
|
||||
float f1 = 0.5F;
|
||||
GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
|
||||
this.model.setModelAttributes(this.renderer.getMainModel());
|
||||
this.model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
GlStateManager.matrixMode(5890);
|
||||
GlStateManager.loadIdentity();
|
||||
GlStateManager.matrixMode(5888);
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.depthMask(flag);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldCombineTextures()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
|||
import WayofTime.bloodmagic.api.iface.IAltarReader;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedZombie;
|
||||
import WayofTime.bloodmagic.tile.TileIncenseAltar;
|
||||
import WayofTime.bloodmagic.tile.TileInversionPillar;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
|
@ -39,12 +40,12 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
|
|||
// DungeonTester.testDungeonElementWithOutput((WorldServer) world, player.getPosition());
|
||||
// }
|
||||
|
||||
// if (!world.isRemote)
|
||||
// {
|
||||
// EntityCorruptedZombie fred = new EntityCorruptedZombie(world);
|
||||
// fred.setPosition(player.posX, player.posY, player.posZ);
|
||||
// world.spawnEntityInWorld(fred);
|
||||
// }
|
||||
if (!world.isRemote)
|
||||
{
|
||||
EntityCorruptedZombie fred = new EntityCorruptedZombie(world);
|
||||
fred.setPosition(player.posX, player.posY, player.posZ);
|
||||
world.spawnEntityInWorld(fred);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5 KiB |
Loading…
Reference in a new issue