mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-10-25 20:32:32 +00:00
Switch to older renderer for tools
This commit is contained in:
1 parent
340e4e2370
commit
d6711d0c03
12 files changed
+1392
-233
No files matched your search
@@ -21,4 +21,4 @@ EntityOmega:https://github.com/mDiyo/TinkersConstruct/blob/16working/capes/defau
|
||||
skedone:https://github.com/mDiyo/TinkersConstruct/blob/16working/capes/default_green.png
|
||||
type1ninja:https://www.dropbox.com/s/f6ayqlrgh1jhdd6/My%20Cape.png
|
||||
turbeauke:http://i.imgur.com/XdOIone.png
|
||||
Nieue:https://github.com/mDiyo/TinkersConstruct/blob/16working/capes/default_green.png
|
||||
Nieue:http://i.imgur.com/8c5yUgX.png
|
||||
@@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
* @dependencies: IC2 API, MFR API
|
||||
*/
|
||||
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.dev.29.3", dependencies = "required-after:Forge@[7.7.1.687,)")
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.dev.30", dependencies = "required-after:Forge@[7.7.1.687,)")
|
||||
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class)
|
||||
public class TConstruct
|
||||
{
|
||||
|
||||
@@ -72,15 +72,6 @@ public class CustomBowRenderer implements IItemRenderer
|
||||
GL11.glPopMatrix();
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (stack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.mc.renderEngine.bindTexture("/terrain.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.mc.renderEngine.bindTexture("/gui/items.png");
|
||||
}*/
|
||||
TextureManager texturemanager = this.mc.func_110434_K();
|
||||
texturemanager.func_110577_a(texturemanager.func_130087_a(stack.getItemSpriteNumber()));
|
||||
|
||||
@@ -112,37 +103,6 @@ public class CustomBowRenderer implements IItemRenderer
|
||||
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getOriginX(), icon.getOriginY(), 0.0625F);
|
||||
|
||||
/*if (stack != null && stack.hasEffect() && renderPass == 0)
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.mc.renderEngine.bindTexture("%blur%/misc/glint.png");
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
float f7 = 0.76F;
|
||||
GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
float f8 = 0.125F;
|
||||
GL11.glScalef(f8, f8, f8);
|
||||
float f9 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
GL11.glTranslatef(f9, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f8, f8, f8);
|
||||
f9 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
GL11.glTranslatef(-f9, 0.0F, 0.0F);
|
||||
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}*/
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -95,8 +95,8 @@ import tconstruct.client.entity.FancyItemRender;
|
||||
import tconstruct.client.entity.MiniGardyRender;
|
||||
import tconstruct.client.entity.SlimeCloneRender;
|
||||
import tconstruct.client.entity.SlimeRender;
|
||||
import tconstruct.client.entity.projectile.ArrowRender;
|
||||
import tconstruct.client.entity.projectile.DaggerRender;
|
||||
import tconstruct.client.entity.projectile.ArrowRenderCustom;
|
||||
import tconstruct.client.entity.projectile.DaggerRenderCustom;
|
||||
import tconstruct.client.entity.projectile.LaunchedItemRender;
|
||||
import tconstruct.client.gui.ArmorExtendedGui;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
@@ -356,14 +356,14 @@ public class TProxyClient extends TProxyCommon
|
||||
RenderingRegistry.registerEntityRenderingHandler(SlimeClone.class, new SlimeCloneRender(new CloneHeadModel(0), new CloneHeadModel(1f), 0.25F));
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(DaggerEntity.class, new DaggerRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(DaggerEntity.class, new DaggerRenderCustom());
|
||||
RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender());
|
||||
// RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new
|
||||
// SkylaRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(MiniGardy.class, new MiniGardyRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(Automaton.class, new CrystalGuardianRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384));
|
||||
RenderingRegistry.registerEntityRenderingHandler(ArrowEntity.class, new ArrowRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(ArrowEntity.class, new ArrowRenderCustom());
|
||||
// RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class,
|
||||
// new PlayerArmorRender()); // <-- Works, woo!
|
||||
|
||||
@@ -372,14 +372,14 @@ public class TProxyClient extends TProxyCommon
|
||||
|
||||
ToolCoreRenderer renderer = new ToolCoreRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.arrow.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.battleaxe.itemID, renderer);
|
||||
/*MinecraftForgeClient.registerItemRenderer(TContent.battleaxe.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.battlesign.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.broadsword.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.chisel.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.cleaver.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.cutlass.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.cutlass.itemID, renderer);*/
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.dagger.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.excavator.itemID, renderer);
|
||||
/*MinecraftForgeClient.registerItemRenderer(TContent.excavator.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.frypan.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.hammer.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.hatchet.itemID, renderer);
|
||||
@@ -390,7 +390,7 @@ public class TProxyClient extends TProxyCommon
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.rapier.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.scythe.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.shortbow.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.shovel.itemID, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(TContent.shovel.itemID, renderer);*/
|
||||
|
||||
addRenderMappings();
|
||||
addToolButtons();
|
||||
|
||||
@@ -20,7 +20,10 @@ public class ToolCoreRenderer implements IItemRenderer
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
GL11.glTranslatef(0.03f, 0F, -0.09375F);
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
|
||||
@@ -2,12 +2,19 @@ package tconstruct.client.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
@@ -16,86 +23,612 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.entity.projectile.ArrowEntity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ArrowRender extends Render
|
||||
{
|
||||
private static RenderItem renderer = new RenderItem();
|
||||
private Random random = new Random();
|
||||
private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
private RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
public ArrowRender() {}
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
private Random random = new Random();
|
||||
public boolean renderWithColor = true;
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(ArrowEntity arrow, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
random.setSeed(187L);
|
||||
ItemStack item = arrow.getEntityItem();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
float shake = arrow.arrowShake - par9;
|
||||
if (shake > 0.0F)
|
||||
GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
float scale = 1.35f;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
/** Defines the zLevel of rendering of item on GUI. */
|
||||
public float zLevel;
|
||||
public static boolean renderInFrame;
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((ArrowEntity)par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a (Entity par1Entity)
|
||||
public ArrowRender()
|
||||
{
|
||||
return this.func_110796_a((ArrowEntity) par1Entity);
|
||||
this.shadowSize = 0.15F;
|
||||
this.shadowOpaque = 0.75F;
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (ArrowEntity par1ArrowEntity)
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem (ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.func_110777_b(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f2 = shouldBob() ? MathHelper.sin(((float) 0 + par9) / 10.0F + 0) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float) 0 + par9) / 20.0F + 0) * (180F / (float) Math.PI);
|
||||
byte b0 = getMiniBlockCount(itemstack);
|
||||
|
||||
GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
int i;
|
||||
|
||||
Block block = null;
|
||||
if (itemstack.itemID < Block.blocksList.length)
|
||||
{
|
||||
block = Block.blocksList[itemstack.itemID];
|
||||
}
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(1.25F, 1.25F, 1.25F);
|
||||
GL11.glTranslatef(0.0F, 0.05F, 0.0F);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
float f7 = 0.25F;
|
||||
int j = block.getRenderType();
|
||||
|
||||
if (j == 1 || j == 19 || j == 12 || j == 2)
|
||||
{
|
||||
f7 = 0.5F;
|
||||
}
|
||||
|
||||
GL11.glScalef(f7, f7, f7);
|
||||
|
||||
for (i = 0; i < b0; ++i)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
GL11.glTranslatef(f5, f4, f6);
|
||||
}
|
||||
|
||||
f5 = 1.0F;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float f8;
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
Icon icon = itemstack.getItem().getIcon(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
|
||||
f5 = (float) (i >> 16 & 255) / 255.0F;
|
||||
f4 = (float) (i >> 8 & 255) / 255.0F;
|
||||
f6 = (float) (i & 255) / 255.0F;
|
||||
GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F);
|
||||
this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, 1.0F, 1.0F, 1.0F, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
Icon icon1 = itemstack.getIconIndex();
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
|
||||
f8 = (float) (l >> 16 & 255) / 255.0F;
|
||||
float f9 = (float) (l >> 8 & 255) / 255.0F;
|
||||
f5 = (float) (l & 255) / 255.0F;
|
||||
f4 = 1.0F;
|
||||
this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (ArrowEntity par1ArrowEntity)
|
||||
{
|
||||
return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem (ArrowEntity par1ArrowEntity, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem (ArrowEntity arrow, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null)
|
||||
{
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K();
|
||||
ResourceLocation resourcelocation = texturemanager.func_130087_a(arrow.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno");
|
||||
}
|
||||
|
||||
float f4 = ((Icon) par2Icon).getMinU();
|
||||
float f5 = ((Icon) par2Icon).getMaxU();
|
||||
float f6 = ((Icon) par2Icon).getMinV();
|
||||
float f7 = ((Icon) par2Icon).getMaxV();
|
||||
float f8 = 1.0F;
|
||||
float f9 = 0.5F;
|
||||
float f10 = 0.25F;
|
||||
float f11;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glRotatef((((float) 0 + par4) / 20.0F + 0) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
float f12 = 0.0625F;
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = arrow.getEntityItem();
|
||||
int j = itemstack.stackSize;
|
||||
byte b0 = getMiniItemCount(itemstack);
|
||||
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F));
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par4 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par4 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
// Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
if (k > 0 && shouldSpreadItems())
|
||||
{
|
||||
float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
GL11.glTranslatef(x, y, f12 + f11);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
}
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.func_110776_a(TextureMap.field_110575_b);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.func_110776_a(TextureMap.field_110576_c);
|
||||
}
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12);
|
||||
|
||||
if (itemstack.hasEffect(pass))
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.renderManager.renderEngine.func_110577_a(field_110798_h);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
float f13 = 0.76F;
|
||||
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
float f14 = 0.125F;
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
GL11.glTranslatef(-f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false);
|
||||
}
|
||||
|
||||
public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect)
|
||||
{
|
||||
int k = par3ItemStack.itemID;
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
Object object = par3ItemStack.getIconIndex();
|
||||
float f;
|
||||
int i1;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
{
|
||||
par2TextureManager.func_110577_a(TextureMap.field_110575_b);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel);
|
||||
GL11.glScalef(10.0F, 10.0F, 10.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1.0F);
|
||||
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = true;
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if (Item.itemsList[k].requiresMultipleRenderPasses())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
|
||||
{
|
||||
par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
|
||||
Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
|
||||
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
|
||||
f1 = (float) (k1 >> 16 & 255) / 255.0F;
|
||||
f2 = (float) (k1 >> 8 & 255) / 255.0F;
|
||||
float f3 = (float) (k1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f1, f2, f3, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, icon, 16, 16);
|
||||
|
||||
if (par3ItemStack.hasEffect(j1))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber());
|
||||
par2TextureManager.func_110577_a(resourcelocation);
|
||||
|
||||
if (object == null)
|
||||
{
|
||||
object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno");
|
||||
}
|
||||
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, (Icon) object, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
if (par3ItemStack.hasEffect(0))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
|
||||
private void renderEffect (TextureManager manager, int x, int y)
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
manager.func_110577_a(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
|
||||
{
|
||||
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
|
||||
}
|
||||
|
||||
/* Modders must handle this themselves if they use custom renderers!
|
||||
if (par3ItemStack.hasEffect())
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
par2TextureManager.func_110577_a(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
private void renderGlint (int par1, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; ++j1)
|
||||
{
|
||||
if (j1 == 0)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f4 = 4.0F;
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
f4 = -1.0F;
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f),
|
||||
(double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null);
|
||||
}
|
||||
|
||||
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str)
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (par3ItemStack.stackSize > 1 || par6Str != null)
|
||||
{
|
||||
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (par3ItemStack.isItemDamaged())
|
||||
{
|
||||
int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage());
|
||||
int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i1 = 255 - l << 16 | l << 8;
|
||||
int j1 = (255 - l) / 4 << 16 | 16128;
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setColorOpaque_I(par6);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV());
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV());
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a (Entity par1Entity)
|
||||
{
|
||||
return this.func_110796_a((ArrowEntity) par1Entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((ArrowEntity) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should spread out when rendered in 3d?
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldSpreadItems ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should have a bob effect
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldBob ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte getMiniBlockCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 5)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 20)
|
||||
ret = 4;
|
||||
if (stack.stackSize > 40)
|
||||
ret = 5;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public byte getMiniItemCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 15)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 31)
|
||||
ret = 4;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.entity.projectile.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ArrowRenderCustom extends Render
|
||||
{
|
||||
private static RenderItem renderer = new RenderItem();
|
||||
private Random random = new Random();
|
||||
|
||||
public ArrowRenderCustom() {}
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(ArrowEntity arrow, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
random.setSeed(187L);
|
||||
ItemStack item = arrow.getEntityItem();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
float shake = arrow.arrowShake - par9;
|
||||
if (shake > 0.0F)
|
||||
GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
float scale = 1.35f;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((ArrowEntity)par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a (Entity par1Entity)
|
||||
{
|
||||
return this.func_110796_a((ArrowEntity) par1Entity);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (ArrowEntity par1ArrowEntity)
|
||||
{
|
||||
return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,19 @@ package tconstruct.client.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
@@ -16,14 +23,23 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.entity.projectile.DaggerEntity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class DaggerRender extends Render
|
||||
{
|
||||
private static RenderItem renderer = new RenderItem();
|
||||
private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
private RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
private Random random = new Random();
|
||||
public boolean renderWithColor = true;
|
||||
|
||||
/** Defines the zLevel of rendering of item on GUI. */
|
||||
public float zLevel;
|
||||
public static boolean renderInFrame = true;
|
||||
|
||||
public DaggerRender()
|
||||
{
|
||||
@@ -34,77 +50,579 @@ public class DaggerRender extends Render
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(DaggerEntity dagger, double par2, double par4, double par6, float par8, float par9)
|
||||
public void doRenderItem (DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
random.setSeed(187L);
|
||||
ItemStack item = dagger.getEntityItem();
|
||||
this.func_110777_b(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f2 = shouldBob() ? MathHelper.sin(((float) 0 + par9) / 10.0F + 0) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float) 0 + par9) / 20.0F + 0) * (180F / (float) Math.PI);
|
||||
byte b0 = getMiniBlockCount(itemstack);
|
||||
|
||||
GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
int i;
|
||||
|
||||
Block block = null;
|
||||
if (itemstack.itemID < Block.blocksList.length)
|
||||
{
|
||||
block = Block.blocksList[itemstack.itemID];
|
||||
}
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(1.25F, 1.25F, 1.25F);
|
||||
GL11.glTranslatef(0.0F, 0.05F, 0.0F);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
float f7 = 0.25F;
|
||||
int j = block.getRenderType();
|
||||
|
||||
if (j == 1 || j == 19 || j == 12 || j == 2)
|
||||
{
|
||||
f7 = 0.5F;
|
||||
}
|
||||
|
||||
GL11.glScalef(f7, f7, f7);
|
||||
|
||||
for (i = 0; i < b0; ++i)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
GL11.glTranslatef(f5, f4, f6);
|
||||
}
|
||||
|
||||
f5 = 1.0F;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float f8;
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
Icon icon = itemstack.getItem().getIcon(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
|
||||
f5 = (float) (i >> 16 & 255) / 255.0F;
|
||||
f4 = (float) (i >> 8 & 255) / 255.0F;
|
||||
f6 = (float) (i & 255) / 255.0F;
|
||||
GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F);
|
||||
this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, 1.0F, 1.0F, 1.0F, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
Icon icon1 = itemstack.getIconIndex();
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
|
||||
f8 = (float) (l >> 16 & 255) / 255.0F;
|
||||
float f9 = (float) (l >> 8 & 255) / 255.0F;
|
||||
f5 = (float) (l & 255) / 255.0F;
|
||||
f4 = 1.0F;
|
||||
this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (DaggerEntity par1ArrowEntity)
|
||||
{
|
||||
return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem (DaggerEntity par1ArrowEntity, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem (DaggerEntity dagger, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null)
|
||||
{
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K();
|
||||
ResourceLocation resourcelocation = texturemanager.func_130087_a(dagger.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno");
|
||||
}
|
||||
|
||||
float f4 = ((Icon) par2Icon).getMinU();
|
||||
float f5 = ((Icon) par2Icon).getMaxU();
|
||||
float f6 = ((Icon) par2Icon).getMinV();
|
||||
float f7 = ((Icon) par2Icon).getMaxV();
|
||||
float f8 = 1.0F;
|
||||
float f9 = 0.5F;
|
||||
float f10 = 0.25F;
|
||||
float f11;
|
||||
float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par7 * -20;
|
||||
|
||||
//GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par4 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
//GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par4 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(dagger.prevRotationYaw + (dagger.rotationYaw - dagger.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9;
|
||||
GL11.glRotatef(dagger.rotationYaw + 90, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(rotation * 15, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
float shake = dagger.arrowShake - par9;
|
||||
if (shake > 0.0F)
|
||||
GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
float scale = 1.35f;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glRotatef((((float) 0 + par4) / 20.0F + 0) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
float f12 = 0.0625F;
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = dagger.getEntityItem();
|
||||
int j = itemstack.stackSize;
|
||||
byte b0 = getMiniItemCount(itemstack);
|
||||
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F));
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
// Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.func_110776_a(TextureMap.field_110575_b);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.func_110776_a(TextureMap.field_110576_c);
|
||||
}
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
GL11.glRotatef(90, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rotation, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12);
|
||||
|
||||
/*if (itemstack.hasEffect(pass))
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.renderManager.renderEngine.func_110577_a(field_110798_h);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
float f13 = 0.76F;
|
||||
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
float f14 = 0.125F;
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
GL11.glTranslatef(-f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}*/
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false);
|
||||
}
|
||||
|
||||
public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect)
|
||||
{
|
||||
int k = par3ItemStack.itemID;
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
Object object = par3ItemStack.getIconIndex();
|
||||
float f;
|
||||
int i1;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
{
|
||||
par2TextureManager.func_110577_a(TextureMap.field_110575_b);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel);
|
||||
GL11.glScalef(10.0F, 10.0F, 10.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1.0F);
|
||||
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = true;
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if (Item.itemsList[k].requiresMultipleRenderPasses())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
|
||||
{
|
||||
par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
|
||||
Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
|
||||
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
|
||||
f1 = (float) (k1 >> 16 & 255) / 255.0F;
|
||||
f2 = (float) (k1 >> 8 & 255) / 255.0F;
|
||||
float f3 = (float) (k1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f1, f2, f3, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, icon, 16, 16);
|
||||
|
||||
if (par3ItemStack.hasEffect(j1))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber());
|
||||
par2TextureManager.func_110577_a(resourcelocation);
|
||||
|
||||
if (object == null)
|
||||
{
|
||||
object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno");
|
||||
}
|
||||
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, (Icon) object, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
if (par3ItemStack.hasEffect(0))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
|
||||
private void renderEffect (TextureManager manager, int x, int y)
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
manager.func_110577_a(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
|
||||
{
|
||||
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
|
||||
}
|
||||
|
||||
/* Modders must handle this themselves if they use custom renderers!
|
||||
if (par3ItemStack.hasEffect())
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
par2TextureManager.func_110577_a(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
private void renderGlint (int par1, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; ++j1)
|
||||
{
|
||||
if (j1 == 0)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f4 = 4.0F;
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
f4 = -1.0F;
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f),
|
||||
(double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null);
|
||||
}
|
||||
|
||||
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str)
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (par3ItemStack.stackSize > 1 || par6Str != null)
|
||||
{
|
||||
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (par3ItemStack.isItemDamaged())
|
||||
{
|
||||
int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage());
|
||||
int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i1 = 255 - l << 16 | l << 8;
|
||||
int j1 = (255 - l) / 4 << 16 | 16128;
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
this.doRenderItem((DaggerEntity)par1Entity, par2, par4, par6, par8, par9);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setColorOpaque_I(par6);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV());
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV());
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a (Entity par1Entity)
|
||||
{
|
||||
return this.func_110796_a((DaggerEntity) par1Entity);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (DaggerEntity par1ArrowEntity)
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
this.doRenderItem((DaggerEntity) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should spread out when rendered in 3d?
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldSpreadItems ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should have a bob effect
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldBob ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte getMiniBlockCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 5)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 20)
|
||||
ret = 4;
|
||||
if (stack.stackSize > 40)
|
||||
ret = 5;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public byte getMiniItemCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 15)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 31)
|
||||
ret = 4;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.entity.projectile.DaggerEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class DaggerRenderCustom extends Render
|
||||
{
|
||||
private static RenderItem renderer = new RenderItem();
|
||||
private Random random = new Random();
|
||||
|
||||
public DaggerRenderCustom()
|
||||
{
|
||||
this.shadowSize = 0.15F;
|
||||
this.shadowOpaque = 0.75F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(DaggerEntity dagger, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
random.setSeed(187L);
|
||||
ItemStack item = dagger.getEntityItem();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(dagger.prevRotationYaw + (dagger.rotationYaw - dagger.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9;
|
||||
GL11.glRotatef(dagger.rotationYaw + 90, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(rotation * 15, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
float shake = dagger.arrowShake - par9;
|
||||
if (shake > 0.0F)
|
||||
GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
float scale = 1.35f;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((DaggerEntity)par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a (Entity par1Entity)
|
||||
{
|
||||
return this.func_110796_a((DaggerEntity) par1Entity);
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a (DaggerEntity par1ArrowEntity)
|
||||
{
|
||||
return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.entity.projectile.DaggerEntity;
|
||||
|
||||
public class DaggerRenderOld extends RangedRenderBase
|
||||
{
|
||||
public DaggerRenderOld(double d)
|
||||
{
|
||||
System.out.println("new renderer");
|
||||
shadowSize = 0.15F;
|
||||
shadowOpaque = 0.75F;
|
||||
daggerRotation = (float) d;
|
||||
}
|
||||
|
||||
public void doRender (DaggerEntity dagger, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
if ((new Random()).nextFloat() > 0.8)
|
||||
System.out.println("rendering dagger " + dagger.texID + " " + dagger.tex2ID);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d, (float) d1, (float) d2);
|
||||
GL11.glRotatef(f, 0.0F, 1.0F, 0.0F);
|
||||
float f2 = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * f1;
|
||||
GL11.glRotatef(-f2, 1.0F, 0.0F, 0.0F);
|
||||
if (!dagger.onGround)
|
||||
{
|
||||
float f3 = dagger.prevBoomerangRotation + (dagger.boomerangRotation - dagger.prevBoomerangRotation) * f1 * 1.1F;
|
||||
GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
|
||||
//loadTexture("/infi2x2/daggers.png");
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i = 0;//dagger.getTexID();
|
||||
float f4 = ((float) ((i % 16) * 16) + 0.0F) / 256F;
|
||||
float f5 = ((float) ((i % 16) * 16) + 15.99F) / 256F;
|
||||
float f6 = ((float) ((i / 16) * 16) + 0.0F) / 256F;
|
||||
float f7 = ((float) ((i / 16) * 16) + 15.99F) / 256F;
|
||||
float f8 = 1.0F;
|
||||
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||
float f9 = 0.0625F;
|
||||
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
|
||||
renderItem(tessellator, f4, f5, f6, f7, f8, f9);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender (Entity entity, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
doRender((DaggerEntity) entity, d, d1, d2, f, f1);
|
||||
}
|
||||
|
||||
public float daggerRotation;
|
||||
|
||||
@Override
|
||||
protected ResourceLocation func_110775_a (Entity entity)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1638,6 +1638,8 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(manualBook, 2, 1), new ItemStack(manualBook, 1, 1), Item.book);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(manualBook, 1, 2), new ItemStack(manualBook, 1, 1));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(manualBook, 2, 2), new ItemStack(manualBook, 1, 2), Item.book);
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.book), Item.paper, Item.paper, Item.paper, Item.silk, blankPattern, blankPattern);//Vanilla books
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(materials, 1, 0), "pp", "pp", 'p', Item.paper); //Paper stack
|
||||
OreDictionary.registerOre("mossystone", new ItemStack(Block.stoneBrick, 1, 1));
|
||||
|
||||
@@ -264,7 +264,7 @@ public class TEventHandler
|
||||
//{
|
||||
if (!event.entityLiving.isChild())
|
||||
{
|
||||
if (event.entityLiving.getClass() == EntityCow.class)
|
||||
/*if (event.entityLiving.getClass() == EntityCow.class)
|
||||
{
|
||||
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
|
||||
|
||||
@@ -272,9 +272,9 @@ public class TEventHandler
|
||||
{
|
||||
addDrops(event, new ItemStack(Item.leather, 1));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
else if (event.entityLiving.getClass() == EntityChicken.class)
|
||||
if (event.entityLiving.getClass() == EntityChicken.class)
|
||||
{
|
||||
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user