Consolidate in other method
This commit is contained in:
		| @@ -93,6 +93,10 @@ public abstract class TileBase extends TileEntity implements ITickable { | |||||||
|         return oldState.getBlock() != newState.getBlock(); |         return oldState.getBlock() != newState.getBlock(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public TileEntity getFacingTile() { | ||||||
|  |         return worldObj.getTileEntity(pos.offset(direction)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public IInventory getDroppedInventory() { |     public IInventory getDroppedInventory() { | ||||||
|         return null; |         return null; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ public class TileExporter extends TileMachine implements ICompareConfig { | |||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void updateMachine() { |     public void updateMachine() { | ||||||
|         IItemHandler handler = RefinedStorageUtils.getItemHandler(worldObj.getTileEntity(pos.offset(getDirection())), getDirection().getOpposite()); |         IItemHandler handler = RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite()); | ||||||
|  |  | ||||||
|         if (handler != null && ticks % RefinedStorageUtils.getSpeed(upgradesInventory) == 0) { |         if (handler != null && ticks % RefinedStorageUtils.getSpeed(upgradesInventory) == 0) { | ||||||
|             for (int i = 0; i < inventory.getSizeInventory(); ++i) { |             for (int i = 0; i < inventory.getSizeInventory(); ++i) { | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ import net.minecraft.inventory.Container; | |||||||
| import net.minecraft.inventory.IInventory; | import net.minecraft.inventory.IInventory; | ||||||
| import net.minecraft.item.ItemStack; | import net.minecraft.item.ItemStack; | ||||||
| import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.NBTTagCompound; | ||||||
| import net.minecraft.tileentity.TileEntity; |  | ||||||
| import net.minecraftforge.items.IItemHandler; | import net.minecraftforge.items.IItemHandler; | ||||||
| import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; | import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; | ||||||
| import refinedstorage.RefinedStorage; | import refinedstorage.RefinedStorage; | ||||||
| @@ -162,16 +161,12 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider | |||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public TileEntity getFront() { |  | ||||||
|         return worldObj.getTileEntity(pos.offset(getDirection())); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     public IDeepStorageUnit getStorageUnit() { |     public IDeepStorageUnit getStorageUnit() { | ||||||
|         return getFront() instanceof IDeepStorageUnit ? (IDeepStorageUnit) getFront() : null; |         return getFacingTile() instanceof IDeepStorageUnit ? (IDeepStorageUnit) getFacingTile() : null; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public IItemHandler getItemHandler() { |     public IItemHandler getItemHandler() { | ||||||
|         return RefinedStorageUtils.getItemHandler(getFront(), getDirection().getOpposite()); |         return RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ import net.minecraft.inventory.Container; | |||||||
| import net.minecraft.inventory.IInventory; | import net.minecraft.inventory.IInventory; | ||||||
| import net.minecraft.item.ItemStack; | import net.minecraft.item.ItemStack; | ||||||
| import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.NBTTagCompound; | ||||||
| import net.minecraft.tileentity.TileEntity; |  | ||||||
| import net.minecraftforge.items.IItemHandler; | import net.minecraftforge.items.IItemHandler; | ||||||
| import refinedstorage.RefinedStorageUtils; | import refinedstorage.RefinedStorageUtils; | ||||||
| import refinedstorage.container.ContainerImporter; | import refinedstorage.container.ContainerImporter; | ||||||
| @@ -32,10 +31,9 @@ public class TileImporter extends TileMachine implements ICompareConfig, IModeCo | |||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void updateMachine() { |     public void updateMachine() { | ||||||
|         TileEntity tile = worldObj.getTileEntity(pos.offset(getDirection())); |         IItemHandler handler = RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite()); | ||||||
|         IItemHandler handler = RefinedStorageUtils.getItemHandler(tile, getDirection().getOpposite()); |  | ||||||
|  |  | ||||||
|         if (tile instanceof TileDiskDrive || handler == null) { |         if (getFacingTile() instanceof TileDiskDrive || handler == null) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Raoul Van den Berge
					Raoul Van den Berge