Skip to content

Commit

Permalink
Unmerged 1.6.4 commits: Various small commits #928
Browse files Browse the repository at this point in the history
Nullcheck on detecting entities
Fix missing NBT data crashing toolrenderer
Fix faucet crashing clients
  • Loading branch information
bonii-xx committed Aug 28, 2014
1 parent 5d83d96 commit 3074243
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/client/ToolCoreRenderer.java
Expand Up @@ -24,6 +24,9 @@ public ToolCoreRenderer(boolean isEntity) {
@Override
public boolean handleRenderType (ItemStack item, ItemRenderType type)
{
if(!item.hasTagCompound())
return false;

switch (type)
{
case ENTITY:
Expand Down
40 changes: 22 additions & 18 deletions src/main/java/tconstruct/smeltery/blocks/SearedBlock.java
Expand Up @@ -278,30 +278,34 @@ public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
}
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);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java
Expand Up @@ -307,6 +307,9 @@ public void updateEntity ()

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);
Expand Down

0 comments on commit 3074243

Please sign in to comment.