mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Make the Phantom Itemface work with IItemHandler only blocks.
Closes #299
This commit is contained in:
parent
6cce2d47cf
commit
20664fccf4
1 changed files with 17 additions and 1 deletions
|
@ -16,6 +16,7 @@ import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
|
|
||||||
public class TileEntityPhantomItemface extends TileEntityPhantomface{
|
public class TileEntityPhantomItemface extends TileEntityPhantomface{
|
||||||
|
|
||||||
|
@ -106,7 +107,22 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBoundThingInRange(){
|
public boolean isBoundThingInRange(){
|
||||||
return super.isBoundThingInRange() && this.getInventory() != null;
|
if(super.isBoundThingInRange()){
|
||||||
|
if(this.getInventory() != null){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
TileEntity tile = this.worldObj.getTileEntity(this.getBoundPosition());
|
||||||
|
if(tile != null){
|
||||||
|
for(EnumFacing facing : EnumFacing.values()){
|
||||||
|
if(tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue