Small refactor

This commit is contained in:
Calclavia 2013-12-23 22:19:48 +08:00
parent 21dd2a501a
commit e3d043f5e5
2 changed files with 5 additions and 11 deletions

View file

@ -6,22 +6,16 @@ package resonantinduction.battery;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.Set; import java.util.Set;
import net.minecraft.entity.player.EntityPlayer; 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.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import resonantinduction.ResonantInduction; import resonantinduction.ResonantInduction;
import resonantinduction.api.ICapacitor;
import resonantinduction.base.ListUtil;
import universalelectricity.api.item.IEnergyItem;
import universalelectricity.api.vector.Vector3; import universalelectricity.api.vector.Vector3;
import calclavia.lib.network.IPacketReceiver; import calclavia.lib.network.IPacketReceiver;
import calclavia.lib.network.IPacketSender; import calclavia.lib.network.IPacketSender;
import calclavia.lib.tile.EnergyStorage;
import calclavia.lib.tile.TileEntityElectrical; import calclavia.lib.tile.TileEntityElectrical;
import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataInput;
@ -49,7 +43,7 @@ public class TileBattery extends TileEntityElectrical implements IPacketSender,
public TileBattery() public TileBattery()
{ {
this.energy.setCapacity(1000); this.energy = new EnergyStorage(1000);
} }
@Override @Override

View file

@ -24,10 +24,10 @@ import net.minecraftforge.fluids.IFluidBlock;
import resonantinduction.ResonantInduction; import resonantinduction.ResonantInduction;
import resonantinduction.tesla.TileTesla; import resonantinduction.tesla.TileTesla;
import universalelectricity.api.vector.Vector3; import universalelectricity.api.vector.Vector3;
import calclavia.lib.InventoryHelper;
import calclavia.lib.network.IPacketReceiver; import calclavia.lib.network.IPacketReceiver;
import calclavia.lib.network.IPacketSender; import calclavia.lib.network.IPacketSender;
import calclavia.lib.tile.TileEntityAdvanced; import calclavia.lib.tile.TileEntityAdvanced;
import calclavia.lib.utility.InventoryUtility;
import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataInput;
@ -97,7 +97,7 @@ public class TileEMLevitator extends TileEntityAdvanced implements IPacketReceiv
if (!suck && pushDelay == 0) if (!suck && pushDelay == 0)
{ {
ItemStack retrieved = InventoryHelper.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal()); ItemStack retrieved = InventoryUtility.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal());
if (retrieved != null) if (retrieved != null)
{ {
@ -119,7 +119,7 @@ public class TileEMLevitator extends TileEntityAdvanced implements IPacketReceiv
{ {
for (EntityItem item : (List<EntityItem>) worldObj.getEntitiesWithinAABB(EntityItem.class, suckBounds)) for (EntityItem item : (List<EntityItem>) 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) if (remains == null)
{ {