From 2e51ea5f787b336e25ad0b235b9833f70d65e801 Mon Sep 17 00:00:00 2001 From: yueh Date: Thu, 24 Dec 2015 02:11:17 +0100 Subject: [PATCH] Always use {} for statements --- src/main/java/appeng/block/AEBaseBlock.java | 10 ++++++ .../block/networking/BlockCableBus.java | 2 ++ .../appeng/client/render/ModelGenerator.java | 34 +++++++++++++++++++ .../render/blocks/RenderBlockCraftingCPU.java | 2 ++ .../container/slot/AppEngCraftingSlot.java | 4 +++ .../features/AECableBusFeatureHandler.java | 4 +++ .../java/appeng/helpers/MetaRotation.java | 6 ++++ .../java/appeng/items/misc/ItemPaintBall.java | 2 ++ .../java/appeng/items/parts/ItemFacade.java | 2 ++ .../appeng/parts/p2p/PartP2PRedstone.java | 2 ++ .../java/appeng/tile/misc/TileInterface.java | 4 +++ .../appeng/tile/qnb/TileQuantumBridge.java | 4 +++ 12 files changed, 76 insertions(+) diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index a57686a5..cae779d8 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -169,7 +169,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature { final Class re = this.getRenderer(); if( re == null ) + { return null; // use 1.8 models. + } final BaseBlockRender renderer = re.newInstance(); this.renderInfo = new BlockRenderInfo( renderer ); @@ -250,7 +252,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature final IOrientable ori = this.getOrientable( w, pos ); if( ori == null ) + { return this.getIcon( side, state ); + } return this.getIcon( this.mapRotation( ori, side ), state ); } @@ -363,9 +367,13 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } if( b == null ) + { b = new AxisAlignedBB( 16d, 16d, 16d, 0d, 0d, 0d ); + } else + { b = AxisAlignedBB.fromBounds( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() ); + } return b; } @@ -597,7 +605,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } if( west == null ) + { return dir; + } if( dir == forward ) { diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index 77498d5d..a25a0ebf 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -226,7 +226,9 @@ public class BlockCableBus extends AEBaseTileBlock // implements IRedNetConnecti EnumFacing side ) { if( side == null ) + { side = EnumFacing.UP; + } return this.cb( w, pos ).canConnectRedstone( EnumSet.of( side ) ); } diff --git a/src/main/java/appeng/client/render/ModelGenerator.java b/src/main/java/appeng/client/render/ModelGenerator.java index 33c9c904..7d365ab7 100644 --- a/src/main/java/appeng/client/render/ModelGenerator.java +++ b/src/main/java/appeng/client/render/ModelGenerator.java @@ -48,7 +48,9 @@ public class ModelGenerator { this.general = new ArrayList(); for( final EnumFacing f : EnumFacing.VALUES ) + { this.faces[f.ordinal()] = new ArrayList(); + } } @Override @@ -147,7 +149,9 @@ public class ModelGenerator final Block block ) { if( block == null ) + { return; + } this.setRenderMinX( block.getBlockBoundsMinX() ); this.setRenderMinY( block.getBlockBoundsMinY() ); @@ -245,18 +249,24 @@ public class ModelGenerator final Item it = is.getItem(); if( it instanceof ItemMultiPart ) + { return ( (ItemMultiPart) it ).getIcon( is ); + } final Block blk = Block.getBlockFromItem( it ); if( blk != null ) + { return this.getIcon( blk.getStateFromMeta( is.getMetadata() ) )[0]; + } if( it instanceof AEBaseItem ) { final IAESprite ico = ( (AEBaseItem) it ).getIcon( is ); if( ico != null ) + { return ico; + } } return new MissingIcon( is ); @@ -272,7 +282,9 @@ public class ModelGenerator { final AEBaseBlock base = (AEBaseBlock) blk; for( final EnumFacing face : EnumFacing.VALUES ) + { out[face.ordinal()] = base.getIcon( face, state ); + } } else { @@ -312,7 +324,9 @@ public class ModelGenerator final AEBaseBlock base = (AEBaseBlock) blk; for( final EnumFacing face : EnumFacing.VALUES ) + { out[face.ordinal()] = base.getIcon( world, pos, face ); + } return out; } @@ -566,7 +580,9 @@ public class ModelGenerator IAESprite texture ) { if( this.getOverrideBlockTexture() != null ) + { texture = this.getOverrideBlockTexture(); + } this.faces.add( new SMFace( face, isEdge, this.color, to, from, defUVs2, new IconUnwrapper( texture ) ) ); } @@ -577,17 +593,29 @@ public class ModelGenerator final float z ) { if( x > 0.5 ) + { this.currentFace = EnumFacing.EAST; + } if( x < -0.5 ) + { this.currentFace = EnumFacing.WEST; + } if( y > 0.5 ) + { this.currentFace = EnumFacing.UP; + } if( y < -0.5 ) + { this.currentFace = EnumFacing.DOWN; + } if( z > 0.5 ) + { this.currentFace = EnumFacing.SOUTH; + } if( z < -0.5 ) + { this.currentFace = EnumFacing.NORTH; + } } public void setOverrideBlockTexture( @@ -601,7 +629,9 @@ public class ModelGenerator ModelRotation mr = ModelRotation.X0_Y0; if( Flip ) + { mr = ModelRotation.X0_Y180; + } for( final SMFace face : this.faces ) { @@ -615,9 +645,13 @@ public class ModelGenerator bf = new IColoredBakedQuad.ColoredBakedQuad( bf.getVertexData(), face.getColor(), bf.getFace() ); if( face.isEdge() ) + { this.generatedModel.getFaceQuads( myFace ).add( bf ); + } else + { this.generatedModel.getGeneralQuads().add( bf ); + } } } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index a63e5601..54e27415 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -77,7 +77,9 @@ public class RenderBlockCraftingCPU // and this cause sometimes it can go thought walls. for( final EnumFacing face : EnumFacing.VALUES ) + { Platform.notifyBlocksOfNeighbors( worldObj, this.getTile().getPos().offset( face ) ); + } } @MENetworkEventSubscribe diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index 14cdec92..f69577af 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -125,9 +125,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT private void configureNodeSides() { if( this.pointAt == AEPartLocation.INTERNAL ) + { this.getProxy().setValidSides( EnumSet.allOf( EnumFacing.class ) ); + } else + { this.getProxy().setValidSides( EnumSet.complementOf( EnumSet.of( this.pointAt.getFacing() ) ) ); + } } @Override diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index 3c46a3c0..5aa9cabb 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -239,8 +239,12 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock { final EnumSet sides = EnumSet.noneOf( EnumFacing.class ); for( final AEPartLocation dir : this.getConnections() ) + { if( dir != AEPartLocation.INTERNAL ) + { sides.add( dir.getFacing() ); + } + } this.getProxy().setValidSides( sides ); }