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.
+46 −146
Diff settings

Always

Just for now

@@ -26,8 +26,8 @@
import appeng.api.definitions.IDefinitions;
import appeng.api.features.IRegistryContainer;
import appeng.api.networking.IGridNode;
import appeng.api.networking.IGridHelper;
import appeng.api.networking.IGridNode;
import appeng.api.parts.IPartHelper;
import appeng.api.storage.IStorageHelper;

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -21,6 +21,8 @@
public class CoreInaccessibleException extends RuntimeException
{
private static final long serialVersionUID = -7434641554655517242L;
public CoreInaccessibleException( final String message )
{
super( message );
@@ -21,6 +21,8 @@
public class MissingDefinition extends RuntimeException
{
private static final long serialVersionUID = -6547396584255825761L;
public MissingDefinition( final String message )
{
super( message );
@@ -28,7 +28,7 @@
import appeng.api.storage.data.IAEStack;
public interface IBaseMonitor<T extends IAEStack>
public interface IBaseMonitor<T extends IAEStack<T>>
{
/**
@@ -50,5 +50,5 @@
* @param src action source
* @param chan storage channel
*/
void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, IActionSource src, IStorageChannel chan );
void onStackChange( IItemList<?> o, IAEStack<?> fullStack, IAEStack<?> diffStack, IActionSource src, IStorageChannel<?> chan );
}
@@ -29,8 +29,8 @@
import appeng.api.networking.security.IActionSource;
import appeng.api.storage.ICellContainer;
import appeng.api.storage.ICellProvider;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.data.IAEStack;
@@ -50,7 +50,7 @@
*
* @param input injected items
*/
void postAlterationOfStoredItems( IStorageChannel chan, Iterable<? extends IAEStack> input, IActionSource src );
void postAlterationOfStoredItems( IStorageChannel<?> chan, Iterable<? extends IAEStack<?>> input, IActionSource src );
/**
* Used to add a cell provider to the storage system
@@ -42,7 +42,7 @@
*
* @return a valid list of handlers, NEVER NULL
*/
List<IMEInventoryHandler> getCellArray( IStorageChannel channel );
List<IMEInventoryHandler> getCellArray( IStorageChannel<?> channel );
/**
* the storage's priority.
@@ -29,7 +29,7 @@
import appeng.api.storage.data.IAEStack;
public interface IMEMonitorHandlerReceiver<StackType extends IAEStack>
public interface IMEMonitorHandlerReceiver<T extends IAEStack<T>>
{
/**
@@ -46,7 +46,7 @@
*
* @param change done change
*/
void postChange( IBaseMonitor<StackType> monitor, Iterable<StackType> change, IActionSource actionSource );
void postChange( IBaseMonitor<T> monitor, Iterable<T> change, IActionSource actionSource );
/**
* called when the list updates its contents, this is mostly for handling power events.
@@ -27,5 +27,5 @@
public interface ISaveProvider
{
void saveChanges( IMEInventory cellInventory );
void saveChanges( IMEInventory<?> cellInventory );
}
@@ -35,15 +35,15 @@
import appeng.api.storage.IStorageChannel;
public interface IAEStack<StackType extends IAEStack<StackType>>
public interface IAEStack<T extends IAEStack<T>>
{
/**
* add two stacks together
*
* @param is added item
*/
void add( StackType is );
void add( T is );
/**
* number of items in the stack.
@@ -57,7 +57,7 @@
*
* @param stackSize , ItemStack.stackSize = N
*/
StackType setStackSize( long stackSize );
T setStackSize( long stackSize );
/**
* Same as getStackSize, but for requestable items. ( LP )
@@ -71,7 +71,7 @@
*
* @return basically itemStack.stackSize = N but for setStackSize items.
*/
StackType setCountRequestable( long countRequestable );
T setCountRequestable( long countRequestable );
/**
* true, if the item can be crafted.
@@ -85,12 +85,12 @@
*
* @param isCraftable can item be crafted
*/
StackType setCraftable( boolean isCraftable );
T setCraftable( boolean isCraftable );
/**
* clears, requestable, craftable, and stack sizes.
*/
StackType reset();
T reset();
/**
* returns true, if the item can be crafted, requested, or extracted.
@@ -174,14 +174,14 @@
*
* @return a new Stack, which is copied from the original.
*/
StackType copy();
T copy();
/**
* create an empty stack.
*
* @return a new stack, which represents an empty copy of the original.
*/
StackType empty();
T empty();
/**
* @return true if the stack is a {@link IAEItemStack}
@@ -196,7 +196,7 @@
/**
* @return ITEM or FLUID
*/
IStorageChannel getChannel();
IStorageChannel<T> getChannel();
/**
* Returns itemstack for display and similar purposes. Always has a count of 1.
@@ -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() ) )
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.