Basic reformat, hit once, hope never again
This commit is contained in:
@@ -62,11 +62,10 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
try
|
||||
{
|
||||
this.MicroblockAPIUtils = Class.forName( "mods.immibis.microblocks.api.MicroblockAPIUtils" );
|
||||
this.mergeIntoMicroblockContainer = this.MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class,
|
||||
int.class, int.class, int.class, int.class, Block.class, int.class );
|
||||
this.mergeIntoMicroblockContainer = this.MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class, int.class, int.class, int.class, int.class, Block.class, int.class );
|
||||
this.canConvertTiles = true;
|
||||
}
|
||||
catch ( Throwable t )
|
||||
catch( Throwable t )
|
||||
{
|
||||
AELog.error( t );
|
||||
}
|
||||
@@ -78,22 +77,6 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leaveParts( TileEntity te )
|
||||
{
|
||||
if ( te instanceof IMultipartTile )
|
||||
{
|
||||
ICoverSystem ci = ( ( IMultipartTile ) te ).getCoverSystem();
|
||||
if ( ci != null )
|
||||
{
|
||||
ci.convertToContainerBlock();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te )
|
||||
{
|
||||
@@ -103,7 +86,7 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
final int z = te.zCoord;
|
||||
final boolean isPartItem = player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IPartItem;
|
||||
|
||||
if ( te instanceof IMultipartTile && this.canConvertTiles && isPartItem )
|
||||
if( te instanceof IMultipartTile && this.canConvertTiles && isPartItem )
|
||||
{
|
||||
final IBlockDefinition multiPart = AEApi.instance().definitions().blocks().multiPart();
|
||||
final Optional<Block> maybeMultiPartBlock = multiPart.maybeBlock();
|
||||
@@ -111,7 +94,7 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
|
||||
final boolean multiPartPresent = maybeMultiPartBlock.isPresent() && maybeMultiPartStack.isPresent();
|
||||
|
||||
if ( multiPartPresent )
|
||||
if( multiPartPresent )
|
||||
{
|
||||
final Block multiPartBlock = maybeMultiPartBlock.get();
|
||||
final ItemStack multiPartStack = maybeMultiPartStack.get();
|
||||
@@ -122,7 +105,7 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
// int.class, int.class, int.class, int.class, Block.class, int.class );
|
||||
this.mergeIntoMicroblockContainer.invoke( null, multiPartStack, player, w, x, y, z, side, multiPartBlock, 0 );
|
||||
}
|
||||
catch ( Throwable e )
|
||||
catch( Throwable e )
|
||||
{
|
||||
this.canConvertTiles = false;
|
||||
return null;
|
||||
@@ -131,9 +114,25 @@ public class ImmibisMicroblocks extends BaseModule implements IImmibisMicroblock
|
||||
}
|
||||
|
||||
final TileEntity tx = w.getTileEntity( x, y, z );
|
||||
if ( tx instanceof IPartHost )
|
||||
return ( IPartHost ) tx;
|
||||
if( tx instanceof IPartHost )
|
||||
return (IPartHost) tx;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leaveParts( TileEntity te )
|
||||
{
|
||||
if( te instanceof IMultipartTile )
|
||||
{
|
||||
ICoverSystem ci = ( (IMultipartTile) te ).getCoverSystem();
|
||||
if( ci != null )
|
||||
{
|
||||
ci.convertToContainerBlock();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user