mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
Fixed a crash with the ESD when placing it next to a non-IInventory
This commit is contained in:
parent
43229f2d20
commit
541641595f
1 changed files with 18 additions and 2 deletions
|
@ -119,7 +119,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
* Pulls Items from the specified Slots on the specified Side
|
||||
*/
|
||||
private void pull(){
|
||||
if(this.newPulling()){
|
||||
if(this.newPulling() || !(this.placeToPull instanceof IInventory)){
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
* (Check pull() for Description, similar to this)
|
||||
*/
|
||||
private void put(){
|
||||
if(this.newPutting()){
|
||||
if(this.newPutting() || !(this.placeToPut instanceof IInventory)){
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -331,6 +331,14 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
if(this.placeToPull instanceof IInventory){
|
||||
this.slotToPullEnd = ((IInventory)this.placeToPull).getSizeInventory();
|
||||
}
|
||||
else{
|
||||
if(this.placeToPull.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){
|
||||
IItemHandler cap = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
|
||||
if(cap != null){
|
||||
this.slotToPullEnd = cap.getSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,6 +350,14 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
if(this.placeToPut instanceof IInventory){
|
||||
this.slotToPutEnd = ((IInventory)this.placeToPut).getSizeInventory();
|
||||
}
|
||||
else{
|
||||
if(this.placeToPut.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){
|
||||
IItemHandler cap = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
|
||||
if(cap != null){
|
||||
this.slotToPutEnd = cap.getSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue