From e3d043f5e5971c2a82703e2df23c3bccd31b5c44 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Mon, 23 Dec 2013 22:19:48 +0800 Subject: [PATCH] Small refactor --- src/resonantinduction/battery/TileBattery.java | 10 ++-------- src/resonantinduction/levitator/TileEMLevitator.java | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/resonantinduction/battery/TileBattery.java b/src/resonantinduction/battery/TileBattery.java index 1dd5c5fd..6d52d7de 100644 --- a/src/resonantinduction/battery/TileBattery.java +++ b/src/resonantinduction/battery/TileBattery.java @@ -6,22 +6,16 @@ package resonantinduction.battery; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.ForgeDirection; import resonantinduction.ResonantInduction; -import resonantinduction.api.ICapacitor; -import resonantinduction.base.ListUtil; -import universalelectricity.api.item.IEnergyItem; import universalelectricity.api.vector.Vector3; import calclavia.lib.network.IPacketReceiver; import calclavia.lib.network.IPacketSender; +import calclavia.lib.tile.EnergyStorage; import calclavia.lib.tile.TileEntityElectrical; import com.google.common.io.ByteArrayDataInput; @@ -49,7 +43,7 @@ public class TileBattery extends TileEntityElectrical implements IPacketSender, public TileBattery() { - this.energy.setCapacity(1000); + this.energy = new EnergyStorage(1000); } @Override diff --git a/src/resonantinduction/levitator/TileEMLevitator.java b/src/resonantinduction/levitator/TileEMLevitator.java index 89711f06..fc49330b 100644 --- a/src/resonantinduction/levitator/TileEMLevitator.java +++ b/src/resonantinduction/levitator/TileEMLevitator.java @@ -24,10 +24,10 @@ import net.minecraftforge.fluids.IFluidBlock; import resonantinduction.ResonantInduction; import resonantinduction.tesla.TileTesla; import universalelectricity.api.vector.Vector3; -import calclavia.lib.InventoryHelper; import calclavia.lib.network.IPacketReceiver; import calclavia.lib.network.IPacketSender; import calclavia.lib.tile.TileEntityAdvanced; +import calclavia.lib.utility.InventoryUtility; import com.google.common.io.ByteArrayDataInput; @@ -97,7 +97,7 @@ public class TileEMLevitator extends TileEntityAdvanced implements IPacketReceiv if (!suck && pushDelay == 0) { - ItemStack retrieved = InventoryHelper.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal()); + ItemStack retrieved = InventoryUtility.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal()); if (retrieved != null) { @@ -119,7 +119,7 @@ public class TileEMLevitator extends TileEntityAdvanced implements IPacketReceiv { for (EntityItem item : (List) worldObj.getEntitiesWithinAABB(EntityItem.class, suckBounds)) { - ItemStack remains = InventoryHelper.putStackInInventory(inventory, item.getEntityItem(), getDirection().getOpposite().ordinal(), false); + ItemStack remains = InventoryUtility.putStackInInventory(inventory, item.getEntityItem(), getDirection().getOpposite().ordinal(), false); if (remains == null) {