Forgeified texturebinding for pipeitems, changed getBoundingBoxFromPool to getBoundingBox, fixed Block.getHardness calls
This commit is contained in:
parent
e93c37f1a3
commit
f7c5262c09
7 changed files with 18 additions and 27 deletions
|
@ -433,8 +433,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
if (customRenderer != null) {
|
||||
|
||||
GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC
|
||||
loadTexture("/terrain.png");
|
||||
ForgeHooksClient.overrideTexture(itemstack.getItem());
|
||||
ForgeHooksClient.bindTexture(itemstack.getItem().getTextureFile(), 0);
|
||||
float f4 = 0.25F;
|
||||
f4 = 0.5F;
|
||||
GL11.glScalef(f4, f4, f4);
|
||||
|
@ -460,8 +459,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
&& RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) {
|
||||
|
||||
GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC
|
||||
loadTexture("/terrain.png");
|
||||
ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]);
|
||||
|
||||
ForgeHooksClient.bindTexture(Block.blocksList[itemstack.itemID].getTextureFile(), 0);
|
||||
float f4 = 0.25F;
|
||||
int j = Block.blocksList[itemstack.itemID].getRenderType();
|
||||
if (j == 1 || j == 19 || j == 12 || j == 2)
|
||||
|
@ -488,7 +487,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses()) {
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID]));
|
||||
ForgeHooksClient.bindTexture(Item.itemsList[itemstack.itemID].getTextureFile(), 0);
|
||||
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
int iconIndex = itemstack.getItem().getIconFromDamageForRenderPass(itemstack.getItemDamage(), i);
|
||||
|
@ -509,11 +508,9 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
int i = itemstack.getIconIndex();
|
||||
if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null) {
|
||||
loadTexture("/terrain.png");
|
||||
ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]);
|
||||
ForgeHooksClient.bindTexture(Block.blocksList[itemstack.itemID].getTextureFile(), 0);
|
||||
} else {
|
||||
loadTexture("/gui/items.png");
|
||||
ForgeHooksClient.overrideTexture(Item.itemsList[itemstack.itemID]);
|
||||
ForgeHooksClient.bindTexture(Item.itemsList[itemstack.itemID].getTextureFile(), 0);
|
||||
}
|
||||
|
||||
drawItem(i, quantity);
|
||||
|
@ -555,9 +552,4 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected void loadTexture(String s) {
|
||||
RenderEngine renderengine = RenderManager.instance.renderEngine;
|
||||
renderengine.bindTexture(renderengine.getTexture(s));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,17 +49,17 @@ public class BlockMarker extends BlockContainer {
|
|||
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 1 - h, k + 0.5 - w, i + 0.5 + w, j + 1, k + 0.5 + w);
|
||||
return AxisAlignedBB.getBoundingBox(i + 0.5 - w, j + 1 - h, k + 0.5 - w, i + 0.5 + w, j + 1, k + 0.5 + w);
|
||||
case 5:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j, k + 0.5 - w, i + 0.5 + w, j + h, k + 0.5 + w);
|
||||
return AxisAlignedBB.getBoundingBox(i + 0.5 - w, j, k + 0.5 - w, i + 0.5 + w, j + h, k + 0.5 + w);
|
||||
case 3:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - w, k, i + 0.5 + w, j + 0.5 + w, k + h);
|
||||
return AxisAlignedBB.getBoundingBox(i + 0.5 - w, j + 0.5 - w, k, i + 0.5 + w, j + 0.5 + w, k + h);
|
||||
case 4:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - w, k + 1 - h, i + 0.5 + w, j + 0.5 + w, k + 1);
|
||||
return AxisAlignedBB.getBoundingBox(i + 0.5 - w, j + 0.5 - w, k + 1 - h, i + 0.5 + w, j + 0.5 + w, k + 1);
|
||||
case 1:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i, j + 0.5 - w, k + 0.5 - w, i + h, j + 0.5 + w, k + 0.5 + w);
|
||||
return AxisAlignedBB.getBoundingBox(i, j + 0.5 - w, k + 0.5 - w, i + h, j + 0.5 + w, k + 0.5 + w);
|
||||
default:
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(i + 1 - h, j + 0.5 - w, k + 0.5 - w, i + 1, j + 0.5 + w, k + 0.5 + w);
|
||||
return AxisAlignedBB.getBoundingBox(i + 1 - h, j + 0.5 - w, k + 0.5 - w, i + 1, j + 0.5 + w, k + 0.5 + w);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
|
|||
zMax = 1.0F;
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax,
|
||||
return AxisAlignedBB.getBoundingBox((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax,
|
||||
(double) j + yMax, (double) k + zMax);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class TileMiningWell extends TileMachine implements IMachine, IPowerRecep
|
|||
|
||||
if (depth < 0
|
||||
|| (Block.blocksList[world.getBlockId(xCoord, depth, zCoord)] != null && Block.blocksList[world.getBlockId(
|
||||
xCoord, depth, zCoord)].getHardness() == -1.0f)
|
||||
xCoord, depth, zCoord)].getBlockHardness(world, xCoord, yCoord, zCoord) == -1.0f)
|
||||
|| world.getBlockId(xCoord, depth, zCoord) == Block.lavaMoving.blockID
|
||||
|| world.getBlockId(xCoord, depth, zCoord) == Block.lavaStill.blockID) {
|
||||
|
||||
|
|
|
@ -407,8 +407,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
|
|||
}
|
||||
|
||||
// Collect any lost items laying around
|
||||
AxisAlignedBB axis = AxisAlignedBB.getBoundingBoxFromPool(arm.headPosX - 1.5, arm.headPosY, arm.headPosZ - 1.5,
|
||||
arm.headPosX + 2.5, arm.headPosY + 2.5, arm.headPosZ + 2.5);
|
||||
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(arm.headPosX - 1.5, arm.headPosY, arm.headPosZ - 1.5, arm.headPosX + 2.5, arm.headPosY + 2.5, arm.headPosZ + 2.5);
|
||||
List result = worldObj.getEntitiesWithinAABB(EntityItem.class, axis);
|
||||
for (int ii = 0; ii < result.size(); ii++) {
|
||||
if (result.get(ii) instanceof EntityItem) {
|
||||
|
@ -455,7 +454,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
|
|||
|
||||
private boolean blockDig(int blockID) {
|
||||
|
||||
if (Block.blocksList[blockID] != null && Block.blocksList[blockID].getHardness() == -1.0f)
|
||||
if (Block.blocksList[blockID] != null && Block.blocksList[blockID].getBlockHardness(worldObj, xCoord, yCoord, zCoord) == -1.0f)
|
||||
return true;
|
||||
|
||||
return blockID == Block.lavaStill.blockID || blockID == Block.lavaMoving.blockID;
|
||||
|
|
|
@ -128,7 +128,7 @@ public class BlockGenericPipe extends BlockContainer {
|
|||
if (Utils.checkPipesConnections(world, tile1, i, j, k + 1))
|
||||
zMax = 1.0F;
|
||||
|
||||
return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax,
|
||||
return AxisAlignedBB.getBoundingBox((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax,
|
||||
(double) j + yMax, (double) k + zMax);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
|
|||
Position min = p1.min(p2);
|
||||
Position max = p1.max(p2);
|
||||
|
||||
return AxisAlignedBB.getBoundingBoxFromPool(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue