Merge pull request #1066 from thatsIch/e-remove-deprecated-access

Removes deprecated method access of LocatableRegistry and getPickBlock
This commit is contained in:
thatsIch 2015-03-24 12:47:55 +01:00
commit eb98ec891b
8 changed files with 21 additions and 16 deletions

View file

@ -49,7 +49,7 @@ public interface IMEInventory<StackType extends IAEStack>
* @param src action source * @param src action source
* @return returns the number of items not added. * @return returns the number of items not added.
*/ */
public StackType injectItems(StackType input, Actionable type, BaseActionSource src); StackType injectItems( StackType input, Actionable type, BaseActionSource src );
/** /**
* Extract the specified item from the ME Inventory * Extract the specified item from the ME Inventory
@ -60,7 +60,7 @@ public interface IMEInventory<StackType extends IAEStack>
* simulate, or perform action? * simulate, or perform action?
* @return returns the number of items extracted, null * @return returns the number of items extracted, null
*/ */
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src); StackType extractItems( StackType request, Actionable mode, BaseActionSource src );
/** /**
* request a full report of all available items, storage. * request a full report of all available items, storage.
@ -69,11 +69,11 @@ public interface IMEInventory<StackType extends IAEStack>
* the IItemList the results will be written too * the IItemList the results will be written too
* @return returns same list that was passed in, is passed out * @return returns same list that was passed in, is passed out
*/ */
public IItemList<StackType> getAvailableItems(IItemList<StackType> out); IItemList<StackType> getAvailableItems( IItemList<StackType> out );
/** /**
* @return the type of channel your handler should be part of * @return the type of channel your handler should be part of
*/ */
public StorageChannel getChannel(); StorageChannel getChannel();
} }

View file

@ -30,12 +30,12 @@ import appeng.api.storage.data.IItemList;
public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>, IBaseMonitor<T> public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>, IBaseMonitor<T>
{ {
@Override
@Deprecated
/** /**
* This method is discouraged when accessing data via a IMEMonitor * This method is discouraged when accessing data via a IMEMonitor
*/ */
public IItemList<T> getAvailableItems(IItemList out); @Override
@Deprecated
IItemList<T> getAvailableItems( IItemList out );
/** /**
* Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...) * Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...)

View file

@ -25,6 +25,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -163,10 +164,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
{ {
ItemStack is = super.getPickBlock( target, world, x, y, z ); final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
is.setItemDamage( world.getBlockMetadata( x, y, z ) ); is.setItemDamage( world.getBlockMetadata( x, y, z ) );
return is; return is;
} }

View file

@ -87,10 +87,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
} }
@Override @Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
{ {
ItemStack is = super.getPickBlock( target, world, x, y, z ); final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
is.setItemDamage( world.getBlockMetadata( x, y, z ) ); is.setItemDamage( world.getBlockMetadata( x, y, z ) );
return is; return is;
} }

View file

@ -63,6 +63,7 @@ public final class LocatableRegistry implements ILocatableRegistry
* Find a locate-able object by its serial. * Find a locate-able object by its serial.
*/ */
@Override @Override
@Deprecated
public Object findLocatableBySerial( long ser ) public Object findLocatableBySerial( long ser )
{ {
return this.set.get( ser ); return this.set.get( ser );

View file

@ -1080,7 +1080,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{ {
if ( mop.blockX == te.xCoord && mop.blockY == te.yCoord && mop.blockZ == te.zCoord ) if ( mop.blockX == te.xCoord && mop.blockY == te.yCoord && mop.blockZ == te.zCoord )
{ {
ItemStack g = blk.getPickBlock( mop, w, te.xCoord, te.yCoord, te.zCoord ); ItemStack g = blk.getPickBlock( mop, w, te.xCoord, te.yCoord, te.zCoord, null );
if ( g != null ) if ( g != null )
what = g; what = g;
} }

View file

@ -27,6 +27,7 @@ import appeng.api.AEApi;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier; import appeng.api.config.PowerMultiplier;
import appeng.api.features.ILocatable;
import appeng.api.features.IWirelessTermHandler; import appeng.api.features.IWirelessTermHandler;
import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.implementations.tiles.IWirelessAccessPoint; import appeng.api.implementations.tiles.IWirelessAccessPoint;
@ -76,12 +77,12 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
this.myPlayer = ep; this.myPlayer = ep;
this.wth = wh; this.wth = wh;
Object obj = null; ILocatable obj = null;
try try
{ {
long encKey = Long.parseLong( this.encryptionKey ); long encKey = Long.parseLong( this.encryptionKey );
obj = AEApi.instance().registries().locatable().findLocatableBySerial( encKey ); obj = AEApi.instance().registries().locatable().getLocatableBy( encKey );
} }
catch (NumberFormatException err) catch (NumberFormatException err)
{ {

View file

@ -81,7 +81,7 @@ public class QuantumCluster implements ILocatable, IAECluster
public boolean canUseNode(long qe) public boolean canUseNode(long qe)
{ {
QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().findLocatableBySerial( qe ); QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe );
if ( qc != null ) if ( qc != null )
{ {
World theWorld = qc.getCenter().getWorldObj(); World theWorld = qc.getCenter().getWorldObj();
@ -147,7 +147,7 @@ public class QuantumCluster implements ILocatable, IAECluster
} }
} }
Object myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().findLocatableBySerial( this.otherSide ); ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide );
boolean shutdown = false; boolean shutdown = false;