Remove cell deprecation

This commit is contained in:
thatsIch
2015-06-17 23:25:16 +02:00
parent 41b8150ef4
commit 6d510d3912
6 changed files with 25 additions and 58 deletions
@@ -52,18 +52,6 @@ public interface IStorageCell extends ICellWorkbenchItem
*/ */
int getBytes( ItemStack cellItem ); int getBytes( ItemStack cellItem );
/**
* Determines the number of bytes used for any type included on the cell.
*
* @param cellItem item
*
* @return number of bytes
*
* @deprecated use {@link IStorageCell#getBytesPerType(ItemStack)}
*/
@Deprecated
int BytePerType( ItemStack cellItem );
/** /**
* Determines the number of bytes used for any type included on the cell. * Determines the number of bytes used for any type included on the cell.
* *
@@ -23,6 +23,8 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.google.common.base.Optional;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@@ -30,6 +32,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.IncludeExclude; import appeng.api.config.IncludeExclude;
@@ -53,8 +56,6 @@ import appeng.items.materials.MaterialType;
import appeng.util.InventoryAdaptor; import appeng.util.InventoryAdaptor;
import appeng.util.Platform; import appeng.util.Platform;
import com.google.common.base.Optional;
public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, IItemGroup public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, IItemGroup
{ {
@@ -135,12 +136,6 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
return this.totalBytes; return this.totalBytes;
} }
@Override
public int BytePerType( ItemStack cell )
{
return this.perType;
}
@Override @Override
public int getBytesPerType( ItemStack cellItem ) public int getBytesPerType( ItemStack cellItem )
{ {
@@ -28,6 +28,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockColored; import net.minecraft.block.BlockColored;
import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockDispenser;
@@ -47,6 +49,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -81,8 +84,6 @@ import appeng.util.ItemSorters;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.item.AEItemStack; import appeng.util.item.AEItemStack;
import com.google.common.base.Optional;
public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem
{ {
@@ -463,12 +464,6 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
return 512; return 512;
} }
@Override
public int BytePerType( ItemStack cell )
{
return 8;
}
@Override @Override
public int getBytesPerType( ItemStack cellItem ) public int getBytesPerType( ItemStack cellItem )
{ {
@@ -22,6 +22,8 @@ package appeng.items.tools.powered;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockDispenser;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -36,11 +38,11 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -76,8 +78,6 @@ import appeng.tile.misc.TilePaint;
import appeng.util.LookDirection; import appeng.util.LookDirection;
import appeng.util.Platform; import appeng.util.Platform;
import com.google.common.base.Optional;
public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
{ {
@@ -482,12 +482,6 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
return 512; return 512;
} }
@Override
public int BytePerType( ItemStack cell )
{
return 8;
}
@Override @Override
public int getBytesPerType( ItemStack cellItem ) public int getBytesPerType( ItemStack cellItem )
{ {
@@ -23,6 +23,8 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.google.common.base.Optional;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -30,6 +32,7 @@ import net.minecraft.util.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.implementations.guiobjects.IGuiItem; import appeng.api.implementations.guiobjects.IGuiItem;
@@ -53,8 +56,6 @@ import appeng.items.tools.powered.powersink.AEBasePoweredItem;
import appeng.me.storage.CellInventoryHandler; import appeng.me.storage.CellInventoryHandler;
import appeng.util.Platform; import appeng.util.Platform;
import com.google.common.base.Optional;
public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, IGuiItem, IItemGroup public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, IGuiItem, IItemGroup
{ {
@@ -102,12 +103,6 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
return 512; return 512;
} }
@Override
public int BytePerType( ItemStack cell )
{
return 8;
}
@Override @Override
public int getBytesPerType( ItemStack cellItem ) public int getBytesPerType( ItemStack cellItem )
{ {
@@ -65,7 +65,7 @@ public class CellInventory implements ICellInventory
protected int storedItemCount = 0; protected int storedItemCount = 0;
protected IItemList<IAEItemStack> cellItems; protected IItemList<IAEItemStack> cellItems;
protected ItemStack i; protected ItemStack i;
protected IStorageCell CellType; protected IStorageCell cellType;
protected CellInventory( NBTTagCompound data, ISaveProvider container ) protected CellInventory( NBTTagCompound data, ISaveProvider container )
{ {
@@ -92,22 +92,22 @@ public class CellInventory implements ICellInventory
throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" );
} }
this.CellType = null; this.cellType = null;
this.i = o; this.i = o;
Item type = this.i.getItem(); Item type = this.i.getItem();
if( type instanceof IStorageCell ) if( type instanceof IStorageCell )
{ {
this.CellType = (IStorageCell) this.i.getItem(); this.cellType = (IStorageCell) this.i.getItem();
this.maxItemTypes = this.CellType.getTotalTypes( this.i ); this.maxItemTypes = this.cellType.getTotalTypes( this.i );
} }
if( this.CellType == null ) if( this.cellType == null )
{ {
throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" );
} }
if( !this.CellType.isStorageCell( this.i ) ) if( !this.cellType.isStorageCell( this.i ) )
{ {
throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" ); throw new AppEngException( "ItemStack was used as a cell, but was not a cell!" );
} }
@@ -210,7 +210,7 @@ public class CellInventory implements ICellInventory
return null; return null;
} }
if( isBlackListed( input ) || this.CellType.isBlackListed( this.i, input ) ) if( isBlackListed( input ) || this.cellType.isBlackListed( this.i, input ) )
{ {
return input; return input;
} }
@@ -484,31 +484,31 @@ public class CellInventory implements ICellInventory
@Override @Override
public double getIdleDrain() public double getIdleDrain()
{ {
return this.CellType.getIdleDrain(); return this.cellType.getIdleDrain();
} }
@Override @Override
public FuzzyMode getFuzzyMode() public FuzzyMode getFuzzyMode()
{ {
return this.CellType.getFuzzyMode( this.i ); return this.cellType.getFuzzyMode( this.i );
} }
@Override @Override
public IInventory getConfigInventory() public IInventory getConfigInventory()
{ {
return this.CellType.getConfigInventory( this.i ); return this.cellType.getConfigInventory( this.i );
} }
@Override @Override
public IInventory getUpgradesInventory() public IInventory getUpgradesInventory()
{ {
return this.CellType.getUpgradesInventory( this.i ); return this.cellType.getUpgradesInventory( this.i );
} }
@Override @Override
public int getBytesPerType() public int getBytesPerType()
{ {
return this.CellType.BytePerType( this.i ); return this.cellType.getBytesPerType( this.i );
} }
@Override @Override
@@ -521,7 +521,7 @@ public class CellInventory implements ICellInventory
@Override @Override
public long getTotalBytes() public long getTotalBytes()
{ {
return this.CellType.getBytes( this.i ); return this.cellType.getBytes( this.i );
} }
@Override @Override