Removed some dead code, We don't bind custom tessellators
This commit is contained in:
parent
4ea34fe6af
commit
ea57a46227
6 changed files with 7 additions and 50 deletions
|
@ -201,22 +201,6 @@ public class ForgeHooksClient
|
||||||
Tessellator.instance = defaultTessellator;
|
Tessellator.instance = defaultTessellator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void beforeBlockRender(Block block, RenderBlocks render)
|
|
||||||
{
|
|
||||||
if (!block.isDefaultTexture && render.overrideBlockTexture == -1)
|
|
||||||
{
|
|
||||||
bindTexture(block.getTextureFile(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void afterBlockRender(Block block, RenderBlocks render)
|
|
||||||
{
|
|
||||||
if (!block.isDefaultTexture && render.overrideBlockTexture == -1)
|
|
||||||
{
|
|
||||||
unbindTexture();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getArmorTexture(ItemStack armor, String _default)
|
public static String getArmorTexture(ItemStack armor, String _default)
|
||||||
{
|
{
|
||||||
if (armor.getItem() instanceof IArmorTextureProvider)
|
if (armor.getItem() instanceof IArmorTextureProvider)
|
||||||
|
@ -246,7 +230,7 @@ public class ForgeHooksClient
|
||||||
|
|
||||||
if (item.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())))
|
if (item.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())))
|
||||||
{
|
{
|
||||||
engine.bindTexture(engine.getTexture(item.getItem().getTextureFile()));
|
engine.bindTexture(engine.getTexture("/terrain.png"));
|
||||||
int renderType = Block.blocksList[item.itemID].getRenderType();
|
int renderType = Block.blocksList[item.itemID].getRenderType();
|
||||||
float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F);
|
float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F);
|
||||||
|
|
||||||
|
@ -271,7 +255,7 @@ public class ForgeHooksClient
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
engine.bindTexture(engine.getTexture(item.getItem().getTextureFile()));
|
engine.bindTexture(engine.getTexture("/gui/items.png"));
|
||||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||||
customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
|
customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
|
||||||
}
|
}
|
||||||
|
@ -286,7 +270,7 @@ public class ForgeHooksClient
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
engine.bindTexture(engine.getTexture(Item.itemsList[item.itemID].getTextureFile()));
|
engine.bindTexture(engine.getTexture("/gui/items.png"));
|
||||||
if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK))
|
if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK))
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
|
@ -41,15 +41,6 @@ public class MinecraftForgeClient
|
||||||
ForgeHooksClient.engine().getTexture(texture);
|
ForgeHooksClient.engine().getTexture(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Render a block. Render a block which may have a custom texture.
|
|
||||||
*/
|
|
||||||
public static void renderBlock(RenderBlocks render, Block block, int x, int y, int z)
|
|
||||||
{
|
|
||||||
ForgeHooksClient.beforeBlockRender(block, render);
|
|
||||||
render.renderBlockByRenderType(block, x, y, z);
|
|
||||||
ForgeHooksClient.afterBlockRender(block, render);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current render pass.
|
* Get the current render pass.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class ChestGenHooks
|
||||||
addInfo(VILLAGE_BLACKSMITH, ComponentVillageHouse2.villageBlacksmithChestContents, 3, 9);
|
addInfo(VILLAGE_BLACKSMITH, ComponentVillageHouse2.villageBlacksmithChestContents, 3, 9);
|
||||||
addInfo(BONUS_CHEST, WorldServer.bonusChestContent, 10, 10);
|
addInfo(BONUS_CHEST, WorldServer.bonusChestContent, 10, 10);
|
||||||
|
|
||||||
ItemStack book = new ItemStack(Item.field_92053_bW, 1, 0);
|
ItemStack book = new ItemStack(Item.enchantedBook, 1, 0);
|
||||||
WeightedRandomChestContent tmp = new WeightedRandomChestContent(book, 1, 1, 1);
|
WeightedRandomChestContent tmp = new WeightedRandomChestContent(book, 1, 1, 1);
|
||||||
getInfo(MINESHAFT_CORRIDOR ).addItem(tmp);
|
getInfo(MINESHAFT_CORRIDOR ).addItem(tmp);
|
||||||
getInfo(PYRAMID_DESERT_CHEST).addItem(tmp);
|
getInfo(PYRAMID_DESERT_CHEST).addItem(tmp);
|
||||||
|
|
|
@ -215,22 +215,6 @@ public class ForgeHooks
|
||||||
MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing, "pickaxe");
|
MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing, "pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTexture(String _default, Object obj)
|
|
||||||
{
|
|
||||||
if (obj instanceof Item)
|
|
||||||
{
|
|
||||||
return ((Item)obj).getTextureFile();
|
|
||||||
}
|
|
||||||
else if (obj instanceof Block)
|
|
||||||
{
|
|
||||||
return ((Block)obj).getTextureFile();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return _default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getTotalArmorValue(EntityPlayer player)
|
public static int getTotalArmorValue(EntityPlayer player)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
+
|
+
|
||||||
+ if (customRenderer != null)
|
+ if (customRenderer != null)
|
||||||
+ {
|
+ {
|
||||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile()));
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture((par2ItemStack.func_94608_d() == 0 ? "/terrain.png" : "/gui/items.png")));
|
||||||
+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack);
|
+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack);
|
||||||
+ }
|
+ }
|
||||||
+ else if (block != null && par2ItemStack.func_94608_d() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
+ else if (block != null && par2ItemStack.func_94608_d() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
{
|
{
|
||||||
TileEntity tileentity = chunkcache.getBlockTileEntity(k2, i2, j2);
|
TileEntity tileentity = chunkcache.getBlockTileEntity(k2, i2, j2);
|
||||||
|
|
||||||
@@ -212,14 +215,17 @@
|
@@ -212,14 +215,15 @@
|
||||||
|
|
||||||
int i3 = block.getRenderBlockPass();
|
int i3 = block.getRenderBlockPass();
|
||||||
|
|
||||||
|
@ -52,13 +52,11 @@
|
||||||
- flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
- flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||||
+ continue;
|
+ continue;
|
||||||
}
|
}
|
||||||
+ ForgeHooksClient.beforeBlockRender(block, renderblocks);
|
|
||||||
+ flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
+ flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||||
+ ForgeHooksClient.afterBlockRender(block, renderblocks);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,10 +234,11 @@
|
@@ -228,10 +232,11 @@
|
||||||
|
|
||||||
if (flag2)
|
if (flag2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue