Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,10 +33,12 @@ import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockChunkloader extends AEBaseBlock implements LoadingCallback
|
||||
{
|
||||
|
||||
public BlockChunkloader() {
|
||||
public BlockChunkloader()
|
||||
{
|
||||
super( BlockChunkloader.class, Material.iron );
|
||||
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
|
||||
this.setTileEntity( TileChunkLoader.class );
|
||||
@@ -43,15 +46,14 @@ public class BlockChunkloader extends AEBaseBlock implements LoadingCallback
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
public void ticketsLoaded( List<Ticket> tickets, World world )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegistry)
|
||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||
{
|
||||
this.registerNoIcons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -28,30 +29,31 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockCubeGenerator extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockCubeGenerator() {
|
||||
public BlockCubeGenerator()
|
||||
{
|
||||
super( BlockCubeGenerator.class, Material.iron );
|
||||
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
|
||||
this.setTileEntity( TileCubeGenerator.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
|
||||
TileCubeGenerator tcg = this.getTileEntity(w, x, y, z);
|
||||
if ( tcg != null )
|
||||
TileCubeGenerator tcg = this.getTileEntity( w, x, y, z );
|
||||
if( tcg != null )
|
||||
tcg.click( player );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegistry)
|
||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||
{
|
||||
this.registerNoIcons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -26,19 +27,20 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockItemGen extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockItemGen() {
|
||||
public BlockItemGen()
|
||||
{
|
||||
super( BlockItemGen.class, Material.iron );
|
||||
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
|
||||
this.setTileEntity( TileItemGen.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegistry)
|
||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||
{
|
||||
this.registerNoIcons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -28,17 +29,19 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockPhantomNode extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockPhantomNode() {
|
||||
public BlockPhantomNode()
|
||||
{
|
||||
super( BlockPhantomNode.class, Material.iron );
|
||||
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
|
||||
this.setTileEntity( TilePhantomNode.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
TilePhantomNode tpn = this.getTileEntity( w, x, y, z );
|
||||
tpn.BOOM();
|
||||
@@ -46,9 +49,8 @@ public class BlockPhantomNode extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegistry)
|
||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||
{
|
||||
this.registerNoIcons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -37,16 +38,17 @@ import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class TileChunkLoader extends AEBaseTile
|
||||
{
|
||||
|
||||
boolean requestTicket = true;
|
||||
Ticket ct;
|
||||
|
||||
@TileEvent(TileEventType.TICK)
|
||||
@TileEvent( TileEventType.TICK )
|
||||
public void Tick_TileChunkLoader()
|
||||
{
|
||||
if ( this.requestTicket )
|
||||
if( this.requestTicket )
|
||||
{
|
||||
this.requestTicket = false;
|
||||
this.initTicket();
|
||||
@@ -55,18 +57,18 @@ public class TileChunkLoader extends AEBaseTile
|
||||
|
||||
void initTicket()
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return;
|
||||
|
||||
this.ct = ForgeChunkManager.requestTicket( AppEng.instance, this.worldObj, Type.NORMAL );
|
||||
|
||||
if ( this.ct == null )
|
||||
if( this.ct == null )
|
||||
{
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if ( server != null )
|
||||
if( server != null )
|
||||
{
|
||||
List<EntityPlayerMP> pl = server.getConfigurationManager().playerEntityList;
|
||||
for (EntityPlayerMP p : pl)
|
||||
for( EntityPlayerMP p : pl )
|
||||
{
|
||||
p.addChatMessage( new ChatComponentText( "Can't chunk load.." ) );
|
||||
}
|
||||
@@ -81,7 +83,7 @@ public class TileChunkLoader extends AEBaseTile
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return;
|
||||
|
||||
AELog.info( "Released Ticket " + this.ct.toString() );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,6 +31,7 @@ import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class TileCubeGenerator extends AEBaseTile
|
||||
{
|
||||
|
||||
@@ -38,22 +40,22 @@ public class TileCubeGenerator extends AEBaseTile
|
||||
int countdown = 20 * 10;
|
||||
EntityPlayer who;
|
||||
|
||||
@TileEvent(TileEventType.TICK)
|
||||
@TileEvent( TileEventType.TICK )
|
||||
public void TCG_Tick()
|
||||
{
|
||||
if ( this.is != null && Platform.isServer() )
|
||||
if( this.is != null && Platform.isServer() )
|
||||
{
|
||||
this.countdown--;
|
||||
|
||||
if ( this.countdown % 20 == 0 )
|
||||
if( this.countdown % 20 == 0 )
|
||||
{
|
||||
for (EntityPlayer e : CommonHelper.proxy.getPlayers())
|
||||
for( EntityPlayer e : CommonHelper.proxy.getPlayers() )
|
||||
{
|
||||
e.addChatMessage( new ChatComponentText( "Spawning in... " + (this.countdown / 20) ) );
|
||||
e.addChatMessage( new ChatComponentText( "Spawning in... " + ( this.countdown / 20 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.countdown <= 0 )
|
||||
if( this.countdown <= 0 )
|
||||
this.spawn();
|
||||
}
|
||||
}
|
||||
@@ -67,11 +69,11 @@ public class TileCubeGenerator extends AEBaseTile
|
||||
|
||||
int half = (int) Math.floor( this.size / 2 );
|
||||
|
||||
for (int y = 0; y < this.size; y++)
|
||||
for( int y = 0; y < this.size; y++ )
|
||||
{
|
||||
for (int x = -half; x < half; x++)
|
||||
for( int x = -half; x < half; x++ )
|
||||
{
|
||||
for (int z = -half; z < half; z++)
|
||||
for( int z = -half; z < half; z++ )
|
||||
{
|
||||
i.onItemUse( this.is.copy(), this.who, this.worldObj, x + this.xCoord, y + this.yCoord - 1, z + this.zCoord, side, 0.5f, 0.0f, 0.5f );
|
||||
}
|
||||
@@ -79,25 +81,25 @@ public class TileCubeGenerator extends AEBaseTile
|
||||
}
|
||||
}
|
||||
|
||||
public void click(EntityPlayer player)
|
||||
public void click( EntityPlayer player )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
ItemStack hand = player.inventory.getCurrentItem();
|
||||
this.who = player;
|
||||
|
||||
if ( hand == null )
|
||||
if( hand == null )
|
||||
{
|
||||
this.is = null;
|
||||
|
||||
if ( player.isSneaking() )
|
||||
if( player.isSneaking() )
|
||||
this.size--;
|
||||
else
|
||||
this.size++;
|
||||
|
||||
if ( this.size < 3 )
|
||||
if( this.size < 3 )
|
||||
this.size = 3;
|
||||
if ( this.size > 64 )
|
||||
if( this.size > 64 )
|
||||
this.size = 64;
|
||||
|
||||
player.addChatMessage( new ChatComponentText( "Size: " + this.size ) );
|
||||
@@ -109,5 +111,4 @@ public class TileCubeGenerator extends AEBaseTile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -30,22 +31,24 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
||||
|
||||
public class TileItemGen extends AEBaseTile implements IInventory
|
||||
{
|
||||
|
||||
private static final Queue<ItemStack> POSSIBLE_ITEMS = new LinkedList<ItemStack>();
|
||||
|
||||
public TileItemGen() {
|
||||
if ( POSSIBLE_ITEMS.isEmpty() )
|
||||
public TileItemGen()
|
||||
{
|
||||
if( POSSIBLE_ITEMS.isEmpty() )
|
||||
{
|
||||
for (Object obj : Item.itemRegistry)
|
||||
for( Object obj : Item.itemRegistry )
|
||||
{
|
||||
Item mi = (Item) obj;
|
||||
if ( mi != null )
|
||||
if( mi != null )
|
||||
{
|
||||
if ( mi.isDamageable() )
|
||||
if( mi.isDamageable() )
|
||||
{
|
||||
for (int dmg = 0; dmg < mi.getMaxDamage(); dmg++)
|
||||
for( int dmg = 0; dmg < mi.getMaxDamage(); dmg++ )
|
||||
POSSIBLE_ITEMS.add( new ItemStack( mi, 1, dmg ) );
|
||||
}
|
||||
else
|
||||
@@ -66,7 +69,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i)
|
||||
public ItemStack getStackInSlot( int i )
|
||||
{
|
||||
return this.getRandomItem();
|
||||
}
|
||||
@@ -77,7 +80,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j)
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
{
|
||||
ItemStack a = POSSIBLE_ITEMS.poll();
|
||||
ItemStack out = a.copy();
|
||||
@@ -86,13 +89,13 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i)
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack)
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
{
|
||||
ItemStack a = POSSIBLE_ITEMS.poll();
|
||||
POSSIBLE_ITEMS.add( a );
|
||||
@@ -116,6 +119,12 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
@@ -129,15 +138,8 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -26,12 +27,22 @@ import appeng.api.networking.IGridNode;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
|
||||
public class TilePhantomNode extends AENetworkTile
|
||||
{
|
||||
|
||||
protected AENetworkProxy proxy = null;
|
||||
boolean crashMode = false;
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode( ForgeDirection dir )
|
||||
{
|
||||
if( !this.crashMode )
|
||||
return super.getGridNode( dir );
|
||||
|
||||
return this.proxy.getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady()
|
||||
{
|
||||
@@ -41,18 +52,9 @@ public class TilePhantomNode extends AENetworkTile
|
||||
this.crashMode = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(ForgeDirection dir)
|
||||
{
|
||||
if ( !this.crashMode )
|
||||
return super.getGridNode( dir );
|
||||
|
||||
return this.proxy.getNode();
|
||||
}
|
||||
|
||||
public void BOOM()
|
||||
{
|
||||
if ( this.proxy != null )
|
||||
if( this.proxy != null )
|
||||
{
|
||||
this.crashMode = true;
|
||||
this.proxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) );
|
||||
|
||||
@@ -62,15 +62,15 @@ public class ToolDebugCard extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
if ( player.isSneaking() )
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
int grids = 0;
|
||||
int totalNodes = 0;
|
||||
|
||||
for ( Grid g : TickHandler.INSTANCE.getGridList() )
|
||||
for( Grid g : TickHandler.INSTANCE.getGridList() )
|
||||
{
|
||||
grids++;
|
||||
totalNodes += g.getNodes().size();
|
||||
@@ -83,10 +83,10 @@ public class ToolDebugCard extends AEBaseItem
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
|
||||
if ( te instanceof IGridHost )
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) );
|
||||
if ( node != null )
|
||||
if( node != null )
|
||||
{
|
||||
Grid g = node.getInternalGrid();
|
||||
IGridNode center = g.getPivot();
|
||||
@@ -94,7 +94,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
this.outputMsg( player, "Center Node: " + center.toString() );
|
||||
|
||||
IPathingGrid pg = g.getCache( IPathingGrid.class );
|
||||
if ( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
|
||||
if( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
|
||||
{
|
||||
int length = 0;
|
||||
|
||||
@@ -104,46 +104,46 @@ public class ToolDebugCard extends AEBaseItem
|
||||
int maxLength = 10000;
|
||||
|
||||
outer:
|
||||
while ( !next.isEmpty() )
|
||||
while( !next.isEmpty() )
|
||||
{
|
||||
Iterable<IGridNode> current = next;
|
||||
next = new HashSet<IGridNode>();
|
||||
|
||||
for ( IGridNode n : current )
|
||||
for( IGridNode n : current )
|
||||
{
|
||||
if ( n.getMachine() instanceof TileController )
|
||||
if( n.getMachine() instanceof TileController )
|
||||
break outer;
|
||||
|
||||
for ( IGridConnection c : n.getConnections() )
|
||||
for( IGridConnection c : n.getConnections() )
|
||||
next.add( c.getOtherSide( n ) );
|
||||
}
|
||||
|
||||
length++;
|
||||
|
||||
if ( length > maxLength )
|
||||
if( length > maxLength )
|
||||
break;
|
||||
}
|
||||
|
||||
this.outputMsg( player, "Cable Distance: " + length );
|
||||
}
|
||||
|
||||
if ( center.getMachine() instanceof PartP2PTunnel )
|
||||
if( center.getMachine() instanceof PartP2PTunnel )
|
||||
{
|
||||
this.outputMsg( player, "Freq: " + ( (PartP2PTunnel) center.getMachine() ).freq );
|
||||
}
|
||||
|
||||
TickManagerCache tmc = g.getCache( ITickManager.class );
|
||||
for ( Class<? extends IGridHost> c : g.getMachineClasses() )
|
||||
for( Class<? extends IGridHost> c : g.getMachineClasses() )
|
||||
{
|
||||
int o = 0;
|
||||
long nanos = 0;
|
||||
for ( IGridNode oj : g.getMachines( c ) )
|
||||
for( IGridNode oj : g.getMachines( c ) )
|
||||
{
|
||||
o++;
|
||||
nanos += tmc.getAvgNanoTime( oj );
|
||||
}
|
||||
|
||||
if ( nanos < 0 )
|
||||
if( nanos < 0 )
|
||||
{
|
||||
this.outputMsg( player, c.getSimpleName() + " - " + o );
|
||||
}
|
||||
@@ -159,32 +159,32 @@ public class ToolDebugCard extends AEBaseItem
|
||||
else
|
||||
this.outputMsg( player, "Not Networked Block" );
|
||||
|
||||
if ( te instanceof IPartHost )
|
||||
if( te instanceof IPartHost )
|
||||
{
|
||||
IPart center = ( (IPartHost) te ).getPart( ForgeDirection.UNKNOWN );
|
||||
( (IPartHost) te ).markForUpdate();
|
||||
if ( center != null )
|
||||
if( center != null )
|
||||
{
|
||||
GridNode n = (GridNode) center.getGridNode();
|
||||
this.outputMsg( player, "Node Channels: " + n.usedChannels() );
|
||||
for ( IGridConnection gc : n.getConnections() )
|
||||
for( IGridConnection gc : n.getConnections() )
|
||||
{
|
||||
ForgeDirection fd = gc.getDirection( n );
|
||||
if ( fd != ForgeDirection.UNKNOWN )
|
||||
if( fd != ForgeDirection.UNKNOWN )
|
||||
this.outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( te instanceof IAEPowerStorage )
|
||||
if( te instanceof IAEPowerStorage )
|
||||
{
|
||||
IAEPowerStorage ps = (IAEPowerStorage) te;
|
||||
this.outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() );
|
||||
|
||||
if ( te instanceof IGridHost )
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
IGridNode node = ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) );
|
||||
if ( node != null && node.getGrid() != null )
|
||||
if( node != null && node.getGrid() != null )
|
||||
{
|
||||
IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class );
|
||||
this.outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) );
|
||||
@@ -203,7 +203,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
public String timeMeasurement( long nanos )
|
||||
{
|
||||
long ms = nanos / 100000;
|
||||
if ( nanos <= 100000 )
|
||||
if( nanos <= 100000 )
|
||||
return nanos + "ns";
|
||||
return ( ms / 10.0f ) + "ms";
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ToolEraser extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
Block blk = world.getBlock( x, y, z );
|
||||
@@ -67,17 +67,17 @@ public class ToolEraser extends AEBaseItem
|
||||
List<WorldCoord> next = new LinkedList<WorldCoord>();
|
||||
next.add( new WorldCoord( x, y, z ) );
|
||||
|
||||
while ( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() )
|
||||
while( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() )
|
||||
{
|
||||
List<WorldCoord> c = next;
|
||||
next = new LinkedList<WorldCoord>();
|
||||
|
||||
for ( WorldCoord wc : c )
|
||||
for( WorldCoord wc : c )
|
||||
{
|
||||
Block c_blk = world.getBlock( wc.x, wc.y, wc.z );
|
||||
int c_meta = world.getBlockMetadata( wc.x, wc.y, wc.z );
|
||||
|
||||
if ( c_blk == blk && c_meta == meta )
|
||||
if( c_blk == blk && c_meta == meta )
|
||||
{
|
||||
blocks++;
|
||||
world.setBlock( wc.x, wc.y, wc.z, Platform.AIR );
|
||||
|
||||
@@ -29,10 +29,10 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.worldgen.MeteoritePlacer;
|
||||
import appeng.worldgen.meteorite.StandardWorld;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import appeng.worldgen.MeteoritePlacer;
|
||||
import appeng.worldgen.meteorite.StandardWorld;
|
||||
|
||||
|
||||
public class ToolMeteoritePlacer extends AEBaseItem
|
||||
@@ -51,13 +51,13 @@ public class ToolMeteoritePlacer extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
MeteoritePlacer mp = new MeteoritePlacer();
|
||||
boolean worked = mp.spawnMeteorite( new StandardWorld( world ), x, y, z );
|
||||
|
||||
if ( !worked )
|
||||
if( !worked )
|
||||
player.addChatMessage( new ChatComponentText( "Un-suitable Location." ) );
|
||||
|
||||
return true;
|
||||
|
||||
@@ -52,12 +52,12 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
if ( player.isSneaking() )
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
if ( world.getTileEntity( x, y, z ) instanceof IGridHost )
|
||||
if( world.getTileEntity( x, y, z ) instanceof IGridHost )
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger( "x", x );
|
||||
@@ -73,7 +73,7 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
else
|
||||
{
|
||||
NBTTagCompound ish = stack.getTagCompound();
|
||||
if ( ish != null )
|
||||
if( ish != null )
|
||||
{
|
||||
int src_x = ish.getInteger( "x" );
|
||||
int src_y = ish.getInteger( "y" );
|
||||
@@ -83,19 +83,19 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
World src_w = DimensionManager.getWorld( dimid );
|
||||
|
||||
TileEntity te = src_w.getTileEntity( src_x, src_y, src_z );
|
||||
if ( te instanceof IGridHost )
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
IGridHost gh = (IGridHost) te;
|
||||
ForgeDirection sideOff = ForgeDirection.getOrientation( src_side );
|
||||
ForgeDirection currentSideOff = ForgeDirection.getOrientation( side );
|
||||
IGridNode n = gh.getGridNode( sideOff );
|
||||
if ( n != null )
|
||||
if( n != null )
|
||||
{
|
||||
IGrid g = n.getGrid();
|
||||
if ( g != null )
|
||||
if( g != null )
|
||||
{
|
||||
ISpatialCache sc = g.getCache( ISpatialCache.class );
|
||||
if ( sc.isValidRegion() )
|
||||
if( sc.isValidRegion() )
|
||||
{
|
||||
DimensionalCoord min = sc.getMin();
|
||||
DimensionalCoord max = sc.getMax();
|
||||
@@ -116,15 +116,15 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
int scale_y = max.y - min.y;
|
||||
int scale_z = max.z - min.z;
|
||||
|
||||
for ( int i = 1; i < scale_x; i++ )
|
||||
for ( int j = 1; j < scale_y; j++ )
|
||||
for ( int k = 1; k < scale_z; k++ )
|
||||
for( int i = 1; i < scale_x; i++ )
|
||||
for( int j = 1; j < scale_y; j++ )
|
||||
for( int k = 1; k < scale_z; k++ )
|
||||
{
|
||||
Block blk = src_w.getBlock( min_x + i, min_y + j, min_z + k );
|
||||
int meta = src_w.getBlockMetadata( min_x + i, min_y + j, min_z + k );
|
||||
world.setBlock( i + rel_x, j + rel_y, k + rel_z, blk, meta, 4 );
|
||||
|
||||
if ( blk != null && blk.hasTileEntity( meta ) )
|
||||
if( blk != null && blk.hasTileEntity( meta ) )
|
||||
{
|
||||
TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k );
|
||||
TileEntity nte = blk.createTileEntity( world, meta );
|
||||
|
||||
Reference in New Issue
Block a user