reformatted all src files (#141)
This commit is contained in:
@@ -19,9 +19,8 @@
|
||||
package appeng.block.spatial;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -36,57 +35,49 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
{
|
||||
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision {
|
||||
|
||||
public BlockMatrixFrame()
|
||||
{
|
||||
super( Material.ANVIL );
|
||||
this.setResistance( 6000000.0F );
|
||||
this.setBlockUnbreakable();
|
||||
this.setLightOpacity( 0 );
|
||||
this.setOpaque( false );
|
||||
}
|
||||
public BlockMatrixFrame() {
|
||||
super(Material.ANVIL);
|
||||
this.setResistance(6000000.0F);
|
||||
this.setBlockUnbreakable();
|
||||
this.setLightOpacity(0);
|
||||
this.setOpaque(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||
{
|
||||
return Arrays.asList( new AxisAlignedBB[] {} );// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 )
|
||||
// } );
|
||||
}
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity thePlayer, final boolean b) {
|
||||
return Arrays.asList(new AxisAlignedBB[]{});// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 )
|
||||
// } );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
out.add( new AxisAlignedBB( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
|
||||
}
|
||||
@Override
|
||||
public void addCollidingBlockToList(final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e) {
|
||||
out.add(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt( final World worldIn, final BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(final World worldIn, final BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded( final World world, final BlockPos pos, final Explosion explosion )
|
||||
{
|
||||
// Don't explode.
|
||||
}
|
||||
@Override
|
||||
public void onBlockExploded(final World world, final BlockPos pos, final Explosion explosion) {
|
||||
// Don't explode.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntityDestroy( final IBlockState state, final IBlockAccess world, final BlockPos pos, final Entity entity )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canEntityDestroy(final IBlockState state, final IBlockAccess world, final BlockPos pos, final Entity entity) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,11 @@
|
||||
package appeng.block.spatial;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -31,48 +34,36 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock
|
||||
{
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock {
|
||||
|
||||
public BlockSpatialIOPort()
|
||||
{
|
||||
super( Material.IRON );
|
||||
}
|
||||
public BlockSpatialIOPort() {
|
||||
super(Material.IRON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileSpatialIOPort te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
{
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
final TileSpatialIOPort te = this.getTileEntity(world, pos);
|
||||
if (te != null) {
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onActivated(final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
|
||||
if (p.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final TileSpatialIOPort tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_SPATIAL_IO_PORT );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
final TileSpatialIOPort tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
Platform.openGUI(p, tg, AEPartLocation.fromFacing(side), GuiBridge.GUI_SPATIAL_IO_PORT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
package appeng.block.spatial;
|
||||
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.spatial.SpatialPylonStateProperty;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -30,73 +34,57 @@ import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.spatial.SpatialPylonStateProperty;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
|
||||
public class BlockSpatialPylon extends AEBaseTileBlock {
|
||||
|
||||
public class BlockSpatialPylon extends AEBaseTileBlock
|
||||
{
|
||||
public static final SpatialPylonStateProperty STATE = new SpatialPylonStateProperty();
|
||||
|
||||
public static final SpatialPylonStateProperty STATE = new SpatialPylonStateProperty();
|
||||
public BlockSpatialPylon() {
|
||||
super(AEGlassMaterial.INSTANCE);
|
||||
}
|
||||
|
||||
public BlockSpatialPylon()
|
||||
{
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
}
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(this, this.getAEStates(), new IUnlistedProperty[]{STATE});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||
}
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
return extState.withProperty(STATE, this.getDisplayState(world, pos));
|
||||
}
|
||||
|
||||
return extState.withProperty( STATE, this.getDisplayState( world, pos ) );
|
||||
}
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
final TileSpatialPylon tsp = this.getTileEntity(world, pos);
|
||||
if (tsp != null) {
|
||||
tsp.neighborChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
|
||||
if( tsp != null )
|
||||
{
|
||||
tsp.neighborChanged();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getLightValue(final IBlockState state, final IBlockAccess w, final BlockPos pos) {
|
||||
final TileSpatialPylon tsp = this.getTileEntity(w, pos);
|
||||
if (tsp != null) {
|
||||
return tsp.getLightValue();
|
||||
}
|
||||
return super.getLightValue(state, w, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue( final IBlockState state, final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
|
||||
if( tsp != null )
|
||||
{
|
||||
return tsp.getLightValue();
|
||||
}
|
||||
return super.getLightValue( state, w, pos );
|
||||
}
|
||||
private int getDisplayState(IBlockAccess world, BlockPos pos) {
|
||||
TileSpatialPylon te = this.getTileEntity(world, pos);
|
||||
|
||||
private int getDisplayState( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
TileSpatialPylon te = this.getTileEntity( world, pos );
|
||||
if (te == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( te == null )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return te.getDisplayBits();
|
||||
}
|
||||
|
||||
return te.getDisplayBits();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user