A few fixes

This commit is contained in:
aidancbrady 2015-04-28 08:24:54 -07:00
parent 33ff01b436
commit a32d6f4953
2 changed files with 60 additions and 58 deletions

View file

@ -58,11 +58,11 @@ public class LaserManager
if(!e.isImmuneToFire())
{
e.setFire((int)(energy / 1000));
if(energy > 256)
{
e.attackEntityFrom(DamageSource.onFire, (float)energy/1000F);
}
}
if(energy > 256)
{
e.attackEntityFrom(DamageSource.generic, (float)energy/1000F);
}
}

View file

@ -59,65 +59,67 @@ public class ThreadMinerSearch extends Thread
return;
}
if(tileEntity.xCoord == x && tileEntity.yCoord == y && tileEntity.zCoord == z)
{
continue;
}
if(!tileEntity.getWorldObj().getChunkProvider().chunkExists(x >> 4, z >> 4))
{
continue;
}
TileEntity tile = tileEntity.getWorldObj().getTileEntity(x, y, z);
if(tile instanceof TileEntityBoundingBlock)
{
continue;
}
info.block = tileEntity.getWorldObj().getBlock(x, y, z);
info.meta = tileEntity.getWorldObj().getBlockMetadata(x, y, z);
if(info.block != null && !tileEntity.getWorldObj().isAirBlock(x, y, z) && info.block.getBlockHardness(tileEntity.getWorldObj(), x, y, z) >= 0)
{
MinerFilter filterFound = null;
boolean canFilter = false;
if(acceptedItems.containsKey(info))
try {
if(tileEntity.xCoord == x && tileEntity.yCoord == y && tileEntity.zCoord == z)
{
filterFound = acceptedItems.get(info);
continue;
}
else {
ItemStack stack = new ItemStack(info.block, 1, info.meta);
if(tileEntity.isReplaceStack(stack))
{
continue;
}
for(MinerFilter filter : tileEntity.filters)
{
if(filter.canFilter(stack))
{
filterFound = filter;
break;
}
}
acceptedItems.put(info, filterFound);
if(!tileEntity.getWorldObj().getChunkProvider().chunkExists(x >> 4, z >> 4))
{
continue;
}
TileEntity tile = tileEntity.getWorldObj().getTileEntity(x, y, z);
canFilter = tileEntity.inverse ? filterFound == null : filterFound != null;
if(canFilter)
if(tile instanceof TileEntityBoundingBlock)
{
set(i, new Coord4D(x, y, z, tileEntity.getWorldObj().provider.dimensionId));
replaceMap.put(i, filterFound);
found++;
continue;
}
}
info.block = tileEntity.getWorldObj().getBlock(x, y, z);
info.meta = tileEntity.getWorldObj().getBlockMetadata(x, y, z);
if(info.block != null && !tileEntity.getWorldObj().isAirBlock(x, y, z) && info.block.getBlockHardness(tileEntity.getWorldObj(), x, y, z) >= 0)
{
MinerFilter filterFound = null;
boolean canFilter = false;
if(acceptedItems.containsKey(info))
{
filterFound = acceptedItems.get(info);
}
else {
ItemStack stack = new ItemStack(info.block, 1, info.meta);
if(tileEntity.isReplaceStack(stack))
{
continue;
}
for(MinerFilter filter : tileEntity.filters)
{
if(filter.canFilter(stack))
{
filterFound = filter;
break;
}
}
acceptedItems.put(info, filterFound);
}
canFilter = tileEntity.inverse ? filterFound == null : filterFound != null;
if(canFilter)
{
set(i, new Coord4D(x, y, z, tileEntity.getWorldObj().provider.dimensionId));
replaceMap.put(i, filterFound);
found++;
}
}
} catch(Exception e) {}
}
state = State.FINISHED;