Unmerged 1.6.4 commits: Various small commits #928

Nullcheck on detecting entities
Fix missing NBT data crashing toolrenderer
Fix faucet crashing clients
This commit is contained in:
Bernhard Bonigl committed 2014-08-28 14:35:05 +02:00
1 parent 5d83d96d10
commit 3074243c56
3 files changed
+28 -18

No files matched your search

@@ -24,6 +24,9 @@ public class ToolCoreRenderer implements IItemRenderer
@Override
public boolean handleRenderType (ItemStack item, ItemRenderType type)
{
if(!item.hasTagCompound())
return false;
switch (type)
{
case ENTITY:
@@ -278,30 +278,34 @@ public class SearedBlock extends InventoryBlock
}
else
{
FaucetLogic logic = (FaucetLogic) world.getTileEntity(x, y, z);
TileEntity te = world.getTileEntity(x, y, z);
float xMin = 0.25F;
float xMax = 0.75F;
float zMin = 0.25F;
float zMax = 0.75F;
switch (logic.getRenderDirection())
if(te instanceof FaucetLogic)
{
case 2:
zMin = 0.625F;
zMax = 1.0F;
break;
case 3:
zMax = 0.375F;
zMin = 0F;
break;
case 4:
xMin = 0.625F;
xMax = 1.0F;
break;
case 5:
xMax = 0.375F;
xMin = 0F;
break;
FaucetLogic logic = (FaucetLogic) te;
switch (logic.getRenderDirection())
{
case 2:
zMin = 0.625F;
zMax = 1.0F;
break;
case 3:
zMax = 0.375F;
zMin = 0F;
break;
case 4:
xMin = 0.625F;
xMax = 1.0F;
break;
case 5:
xMax = 0.375F;
xMin = 0F;
break;
}
}
this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax);
@@ -307,6 +307,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
void detectEntities ()
{
if(centerPos == null)
return;
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(centerPos.x, centerPos.y, centerPos.z, centerPos.x + 1.0D, centerPos.y + 1.0D, centerPos.z + 1.0D).expand(1.0D, 0.0D, 1.0D);
List list = worldObj.getEntitiesWithinAABB(Entity.class, box);