Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
@@ -18,6 +18,7 @@
package appeng.block.storage;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -37,10 +38,12 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileChest;
import appeng.util.Platform;
public class BlockChest extends AEBaseBlock
{
public BlockChest() {
public BlockChest()
{
super( BlockChest.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
this.setTileEntity( TileChest.class );
@@ -53,22 +56,22 @@ public class BlockChest extends AEBaseBlock
}
@Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
TileChest tg = this.getTileEntity( w, x, y, z );
if ( tg != null && !p.isSneaking() )
if( tg != null && !p.isSneaking() )
{
if ( Platform.isClient() )
if( Platform.isClient() )
return true;
if ( side != tg.getUp().ordinal() )
if( side != tg.getUp().ordinal() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CHEST );
}
else
{
ItemStack cell = tg.getStackInSlot( 1 );
if ( cell != null )
if( cell != null )
{
ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
@@ -18,6 +18,7 @@
package appeng.block.storage;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -33,10 +34,12 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
public class BlockDrive extends AEBaseBlock
{
public BlockDrive() {
public BlockDrive()
{
super( BlockDrive.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
this.setTileEntity( TileDrive.class );
@@ -49,19 +52,18 @@ public class BlockDrive extends AEBaseBlock
}
@Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if ( p.isSneaking() )
if( p.isSneaking() )
return false;
TileDrive tg = this.getTileEntity( w, x, y, z );
if ( tg != null )
if( tg != null )
{
if ( Platform.isServer() )
if( Platform.isServer() )
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_DRIVE );
return true;
}
return false;
}
}
@@ -18,6 +18,7 @@
package appeng.block.storage;
import java.util.EnumSet;
import net.minecraft.block.Block;
@@ -32,33 +33,35 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileIOPort;
import appeng.util.Platform;
public class BlockIOPort extends AEBaseBlock
{
public BlockIOPort() {
public BlockIOPort()
{
super( BlockIOPort.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
this.setTileEntity( TileIOPort.class );
}
@Override
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
public final void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
{
TileIOPort te = this.getTileEntity( w, x, y, z );
if ( te != null )
if( te != null )
te.updateRedstoneState();
}
@Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if ( p.isSneaking() )
if( p.isSneaking() )
return false;
TileIOPort tg = this.getTileEntity( w, x, y, z );
if ( tg != null )
if( tg != null )
{
if ( Platform.isServer() )
if( Platform.isServer() )
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_IOPORT );
return true;
}
@@ -51,10 +51,12 @@ import appeng.helpers.ICustomCollision;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
{
public BlockSkyChest() {
public BlockSkyChest()
{
super( BlockSkyChest.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
this.setTileEntity( TileSkyChest.class );
@@ -66,31 +68,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
}
@Override
public String getUnlocalizedName(ItemStack is)
public int damageDropped( int metadata )
{
if ( is.getItemDamage() == 1 )
return this.getUnlocalizedName() + ".Block";
return this.getUnlocalizedName();
}
@Override
public int damageDropped(int metadata) {
return metadata;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int direction, int metadata)
{
for ( Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() )
{
return skyStoneBlock.getIcon( direction, metadata );
}
return Blocks.stone.getIcon( direction, metadata );
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
{
@@ -101,8 +83,40 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
}
@Override
@SideOnly(Side.CLIENT)
public void getCheckedSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemStacks)
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderBlockSkyChest.class;
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
{
for( Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet() )
{
return skyStoneBlock.getIcon( direction, metadata );
}
return Blocks.stone.getIcon( direction, metadata );
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( Platform.isServer() )
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
return true;
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
{
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
@@ -110,28 +124,22 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
}
@Override
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
public String getUnlocalizedName( ItemStack is )
{
if ( Platform.isServer() )
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
if( is.getItemDamage() == 1 )
return this.getUnlocalizedName() + ".Block";
return true;
return this.getUnlocalizedName();
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderBlockSkyChest.class;
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
TileSkyChest sk = this.getTileEntity( w, x, y, z );
double sc = 0.06;
ForgeDirection o = ForgeDirection.UNKNOWN;
if ( sk != null )
if( sk != null )
o = sk.getUp();
double X = o.offsetX == 0 ? 0.06 : 0.0;
@@ -142,13 +150,8 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
}
@Override
public void registerBlockIcons(IIconRegister iconRegistry)
{
}
}