Yea nevermind whoops

This commit is contained in:
Ellpeck 2015-07-07 12:34:20 +02:00
parent afcbc81d35
commit 2b40e12eae
3 changed files with 3 additions and 3 deletions

View file

@ -61,7 +61,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
} }
} }
else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){ else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){
int theSlot = WorldUtil.findFirstEmptySlot(this.slots); int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot])); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot]));
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
} }

View file

@ -73,7 +73,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase{
} }
else{ else{
if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){ if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){
int theSlot = WorldUtil.findFirstEmptySlot(this.slots); int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot])); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot]));
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
} }

View file

@ -200,7 +200,7 @@ public class WorldUtil{
return working >= stacks.size(); return working >= stacks.size();
} }
public static int findFirstEmptySlot(ItemStack[] slots){ public static int findFirstFilledSlot(ItemStack[] slots){
for(int i = 0; i < slots.length; i++){ for(int i = 0; i < slots.length; i++){
if(slots[i] != null){ if(slots[i] != null){
return i; return i;