From 4552394f6eab5e4d5048575415ad9b12d26cca08 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Sat, 21 Mar 2015 16:03:26 +0100 Subject: [PATCH] Removes deprecated method access of LocatableRegistry and getPickBlock --- src/api/java/appeng/api/storage/IMEInventory.java | 8 ++++---- src/api/java/appeng/api/storage/IMEMonitor.java | 6 +++--- src/main/java/appeng/block/solids/BlockSkyStone.java | 6 ++++-- src/main/java/appeng/block/storage/BlockSkyChest.java | 5 +++-- .../core/features/registries/LocatableRegistry.java | 1 + src/main/java/appeng/helpers/DualityInterface.java | 2 +- .../java/appeng/helpers/WirelessTerminalGuiObject.java | 5 +++-- .../appeng/me/cluster/implementations/QuantumCluster.java | 4 ++-- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/api/java/appeng/api/storage/IMEInventory.java b/src/api/java/appeng/api/storage/IMEInventory.java index e57b701c..54128bc2 100644 --- a/src/api/java/appeng/api/storage/IMEInventory.java +++ b/src/api/java/appeng/api/storage/IMEInventory.java @@ -49,7 +49,7 @@ public interface IMEInventory * @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 * 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 * the IItemList the results will be written too * @return returns same list that was passed in, is passed out */ - public IItemList getAvailableItems(IItemList out); + IItemList getAvailableItems( IItemList out ); /** * @return the type of channel your handler should be part of */ - public StorageChannel getChannel(); + StorageChannel getChannel(); } diff --git a/src/api/java/appeng/api/storage/IMEMonitor.java b/src/api/java/appeng/api/storage/IMEMonitor.java index a267b88e..cdee632d 100644 --- a/src/api/java/appeng/api/storage/IMEMonitor.java +++ b/src/api/java/appeng/api/storage/IMEMonitor.java @@ -30,12 +30,12 @@ import appeng.api.storage.data.IItemList; public interface IMEMonitor extends IMEInventoryHandler, IBaseMonitor { - @Override - @Deprecated /** * This method is discouraged when accessing data via a IMEMonitor */ - public IItemList getAvailableItems(IItemList out); + @Override + @Deprecated + IItemList getAvailableItems( IItemList out ); /** * Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...) diff --git a/src/main/java/appeng/block/solids/BlockSkyStone.java b/src/main/java/appeng/block/solids/BlockSkyStone.java index c2e7d9eb..746ccd64 100644 --- a/src/main/java/appeng/block/solids/BlockSkyStone.java +++ b/src/main/java/appeng/block/solids/BlockSkyStone.java @@ -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; } diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index ec5dd31f..57e0c5e4 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -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; } diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index 49998a6a..d50b8803 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -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 ); diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index d05f05a7..37040343 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -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; } diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index 0dbc9e09..3c836240 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -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) { diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 70d839e6..4716e37c 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -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;