New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some API and related cleanups #3155

Merged
merged 3 commits into from Oct 14, 2017
Jump to file or symbol
Failed to load files and symbols.
+22 −23
Diff settings

Always

Just for now

Viewing a subset of changes. View all

move MEMonitorHandler and fix some warnings

  • Loading branch information...
fscan committed Oct 12, 2017
commit 695bc6b767ab6ae7b94ec59dc92b750ed096575c
@@ -100,14 +100,12 @@ protected BlockStateContainer createBlockState()
return new BlockStateContainer( this, this.getAEStates() );
}
@SuppressWarnings( "deprecation" )
@Override
public final boolean isNormalCube( IBlockState state )
{
return this.isFullSize() && this.isOpaque();
}
@SuppressWarnings( "deprecation" )
@Override
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
{
@@ -226,7 +224,6 @@ public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, f
return super.getSelectedBoundingBox( state, w, pos );
}
@SuppressWarnings( "deprecation" )
@Override
public final boolean isOpaqueCube( IBlockState state )
{
@@ -281,14 +278,12 @@ public RayTraceResult collisionRayTrace( final IBlockState state, final World w,
return super.collisionRayTrace( state, w, pos, a, b );
}
@SuppressWarnings( "deprecation" )
@Override
public boolean hasComparatorInputOverride( IBlockState state )
{
return this.isInventory();
}
@SuppressWarnings( "deprecation" )
@Override
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
{
@@ -67,7 +67,6 @@ public int getMetadata( final int dmg )
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
{
this.addCheckedInformation( itemStack, world, toolTip, advancedTooltips );
@@ -97,7 +97,6 @@ protected BlockStateContainer createBlockState()
* controllers and the network state of this controller (offline, online, conflicted). This is used to
* get a rudimentary connected texture feel for the controller based on how it is placed.
*/
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
@@ -160,7 +159,6 @@ public int getMetaFromState( final IBlockState state )
return state.getValue( CONTROLLER_STATE ).ordinal();
}
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getStateFromMeta( final int meta )
{
@@ -174,7 +172,6 @@ public BlockRenderLayer getBlockLayer()
return BlockRenderLayer.CUTOUT;
}
@SuppressWarnings( "deprecation" )
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
@@ -140,7 +140,6 @@ public void initGui()
}
}
@SuppressWarnings( "unchecked" )
private List<Slot> getInventorySlots()
{
return this.inventorySlots.inventorySlots;
@@ -120,7 +120,6 @@ protected void renderToolTip( final ItemStack stack, final int x, final int y )
ITooltipFlag.TooltipFlags tooltipFlag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
if( myStack != null )
{
@SuppressWarnings( "unchecked" )
final List<String> currentToolTip = stack.getTooltip( this.mc.player, tooltipFlag );
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
@@ -168,6 +168,8 @@ private static boolean isStraightLine( AECableType cableType, EnumMap<EnumFacing
return firstType == AECableType.DENSE_COVERED && secondType == AECableType.DENSE_COVERED;
case DENSE_SMART:
return firstType == AECableType.DENSE_SMART && secondType == AECableType.DENSE_SMART;
default:
break;
}
return true;
@@ -208,6 +210,8 @@ private void addCableQuads( CableBusRenderState renderState, List<BakedQuad> qua
case DENSE_SMART:
this.cableBuilder.addStraightDenseSmartConnection( facing, cableColor, renderState.getChannelsOnSide().get( facing ), quadsOut );
break;
default:
break;
}
return; // Don't render the other form of connection
@@ -237,6 +241,8 @@ private void addCableQuads( CableBusRenderState renderState, List<BakedQuad> qua
case DENSE_SMART:
// Dense cables do not render connections to parts since none can be attached
break;
default:
break;
}
}
@@ -265,6 +271,8 @@ private void addCableQuads( CableBusRenderState renderState, List<BakedQuad> qua
case DENSE_SMART:
this.cableBuilder.addDenseSmartConnection( facing, cableColor, connectionType, cableBusAdjacent, channels, quadsOut );
break;
default:
break;
}
}
}
@@ -1108,7 +1108,8 @@ protected void updateHeld( final EntityPlayerMP p )
{
try
{
NetworkHandler.instance().sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.fromItemStack( p.inventory.getItemStack() ) ),
NetworkHandler.instance().sendTo(
new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.fromItemStack( p.inventory.getItemStack() ) ),
p );
}
catch( final IOException e )
@@ -337,7 +337,7 @@ public IItemDefinition wirelessTerminal()
@Override
public IItemDefinition biometricCard()
{
return this.biometricCard;
return this.chargedStaff;
}
@Override
@@ -40,7 +40,6 @@ public AEBaseEntityItem( final World world, final double x, final double y, fina
super( world, x, y, z, stack );
}
@SuppressWarnings( "unchecked" )
protected List<Entity> getCheckedEntitiesWithinAABBExcludingEntity( final AxisAlignedBB region )
{
return this.world.getEntitiesWithinAABBExcludingEntity( this, region );
@@ -55,7 +55,6 @@ public final void addInformation( final ItemStack stack, final World world, fina
}
@Override
@SuppressWarnings( "unchecked" )
public final void getSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
{
if( this.isInCreativeTab( creativeTab ) )
@@ -33,12 +33,12 @@
import appeng.api.implementations.items.IAEItemPowerStorage;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.MEMonitorHandler;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.IConfigManager;
import appeng.container.interfaces.IInventorySlotAware;
import appeng.me.helpers.MEMonitorHandler;
import appeng.me.storage.CellInventory;
import appeng.util.ConfigManager;
import appeng.util.IConfigManagerHost;
@@ -21,7 +21,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.storage;
package appeng.me.helpers;
import java.util.HashMap;
@@ -33,6 +33,10 @@
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.security.IActionSource;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IMEMonitorHandlerReceiver;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
@@ -42,11 +46,9 @@
* listeners.
*
* @param <T>
* @deprecated
*
* TODO: Needs to be redesigned to solve performance issues. Also should not be part of the API as class.
* TODO: Needs to be redesigned to solve performance issues.

This comment has been minimized.

@orod-org

orod-org Oct 12, 2017

INFO Complete the task associated to this TODO comment. rule

@orod-org

orod-org Oct 12, 2017

INFO Complete the task associated to this TODO comment. rule

*/
@Deprecated
public class MEMonitorHandler<T extends IAEStack<T>> implements IMEMonitor<T>
{
@@ -59,7 +59,6 @@
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.MEMonitorHandler;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
@@ -70,6 +69,7 @@
import appeng.api.util.IConfigManager;
import appeng.helpers.PlayerSecurityWrapper;
import appeng.me.GridAccessException;
import appeng.me.helpers.MEMonitorHandler;
import appeng.me.storage.SecurityStationInventory;
import appeng.tile.grid.AENetworkTile;
import appeng.tile.inventory.AppEngInternalInventory;
@@ -78,7 +78,6 @@
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.IStorageMonitorableAccessor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.MEMonitorHandler;
import appeng.api.storage.channels.IFluidStorageChannel;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEFluidStack;
@@ -89,6 +88,7 @@
import appeng.capabilities.Capabilities;
import appeng.helpers.IPriorityHost;
import appeng.me.GridAccessException;
import appeng.me.helpers.MEMonitorHandler;
import appeng.me.helpers.MachineSource;
import appeng.me.storage.MEInventoryHandler;
import appeng.tile.grid.AENetworkPowerTile;
@@ -48,7 +48,8 @@ public void setItemStack( final ItemStack is )
public IAEItemStack getAEItemStack()
{
return this.aeItemStack == null ? ( this.itemStack.isEmpty() ? null : ( this.aeItemStack = AEItemStack.fromItemStack( this.itemStack ) ) ) : this.aeItemStack;
return this.aeItemStack == null ? ( this.itemStack
.isEmpty() ? null : ( this.aeItemStack = AEItemStack.fromItemStack( this.itemStack ) ) ) : this.aeItemStack;
}
void setAEItemStack( final IAEItemStack is )
ProTip! Use n and p to navigate between commits in a pull request.