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
* @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
@ -60,7 +60,7 @@ public interface IMEInventory<StackType extends IAEStack>
* simulate, or perform action?
* @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.
@ -69,11 +69,11 @@ public interface IMEInventory<StackType extends IAEStack>
* the IItemList the results will be written too
* @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
*/
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>
{
@Override
@Deprecated
/**
* 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(...)

View file

@ -25,6 +25,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -163,10 +164,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@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 ) );
return is;
}

View file

@ -87,10 +87,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
}
@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 ) );
return is;
}

View file

@ -63,6 +63,7 @@ public final class LocatableRegistry implements ILocatableRegistry
* Find a locate-able object by its serial.
*/
@Override
@Deprecated
public Object findLocatableBySerial( long 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 )
{
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 )
what = g;
}

View file

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

View file

@ -81,7 +81,7 @@ public class QuantumCluster implements ILocatable, IAECluster
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 )
{
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;