Added the Soul Snare renderer and recipe and basically everything soul snare
This commit is contained in:
parent
c015e3421f
commit
74718f5042
18 changed files with 273 additions and 23 deletions
|
@ -0,0 +1,62 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
|
||||
public class RenderEntitySoulSnare extends Render<EntitySoulSnare>
|
||||
{
|
||||
protected final Item field_177084_a;
|
||||
private final RenderItem field_177083_e;
|
||||
|
||||
public RenderEntitySoulSnare(RenderManager renderManagerIn, Item p_i46137_2_, RenderItem p_i46137_3_)
|
||||
{
|
||||
super(renderManagerIn);
|
||||
this.field_177084_a = p_i46137_2_;
|
||||
this.field_177083_e = p_i46137_3_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity>) and this method has signature
|
||||
* public void func_76986_a(T entity, double d, double d1, double d2, float
|
||||
* f, float f1). But JAD is pre 1.5 so doe
|
||||
*/
|
||||
public void doRender(EntitySoulSnare entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float) x, (float) y, (float) z);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
this.bindTexture(TextureMap.locationBlocksTexture);
|
||||
this.field_177083_e.func_181564_a(this.func_177082_d(entity), ItemCameraTransforms.TransformType.GROUND);
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.popMatrix();
|
||||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
public ItemStack func_177082_d(EntitySoulSnare entityIn)
|
||||
{
|
||||
return new ItemStack(this.field_177084_a, 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntitySoulSnare entity)
|
||||
{
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
|
||||
public class SoulSnareRenderFactory implements IRenderFactory<EntitySoulSnare>
|
||||
{
|
||||
@Override
|
||||
public Render<? super EntitySoulSnare> createRenderFor(RenderManager manager)
|
||||
{
|
||||
return new RenderEntitySoulSnare(manager, ModItems.soulSnare, Minecraft.getMinecraft().getRenderItem());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue