Code format

This commit is contained in:
yueh
2015-08-06 18:49:57 +02:00
parent c21a44d8c0
commit 9c8deac9de
119 changed files with 430 additions and 401 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ public final class Api implements IAppEngApi
@Override
public IGridNode createGridNode( IGridBlock blk )
{
if ( Platform.isClient() )
if( Platform.isClient() )
{
throw new IllegalStateException( "Grid features for " + blk + " are server side only." );
}
+5 -5
View File
@@ -343,10 +343,10 @@ public final class Registration
target.partCableCovered = source.cableCovered();
target.partCableGlass = source.cableGlass();
target.partCableDense = source.cableDense();
// target.partLumenCableSmart = source.lumenCableSmart();
// target.partLumenCableCovered = source.lumenCableCovered();
// target.partLumenCableGlass = source.lumenCableGlass();
// target.partLumenCableDense = source.lumenCableDense();
// target.partLumenCableSmart = source.lumenCableSmart();
// target.partLumenCableCovered = source.lumenCableCovered();
// target.partLumenCableGlass = source.lumenCableGlass();
// target.partLumenCableDense = source.lumenCableDense();
target.partQuartzFiber = this.converter.of( source.quartzFiber() );
target.partToggleBus = this.converter.of( source.toggleBus() );
target.partInvertedToggleBus = this.converter.of( source.invertedToggleBus() );
@@ -532,7 +532,7 @@ public final class Registration
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
}
if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
}
@@ -241,14 +241,15 @@ public final class ApiBlocks implements IBlocks
this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) );
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) );
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) );
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) );
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) );
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) );
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) );
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) );
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSlabBlock" ) );
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBlockSlabBlock" ) );
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBrickSlabBlock" ) );
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSmallBrickSlabBlock" ) );
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "FluixSlabBlock" ) );
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzSlabBlock" ) );
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "ChiseledQuartzSlabBlock" ) );
;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzPillarSlabBlock" ) );
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
@@ -54,7 +54,7 @@ public class DefinitionConstructor
if( definition instanceof ITileDefinition )
{
return ( (ITileDefinition) definition );
return( (ITileDefinition) definition );
}
throw new IllegalStateException( "No tile definition for " + feature );
@@ -66,7 +66,7 @@ public class DefinitionConstructor
if( definition instanceof IBlockDefinition )
{
return ( (IBlockDefinition) definition );
return( (IBlockDefinition) definition );
}
throw new IllegalStateException( "No block definition for " + feature );
@@ -18,35 +18,35 @@
/* Example:
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setInteger( "turns", 8 );
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
-- or --
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 );
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
*/
@@ -18,14 +18,14 @@
/* Example:
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound();
new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 );
new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );
*/
@@ -18,12 +18,12 @@
/* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );
*/
@@ -18,7 +18,7 @@
/* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );
FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );
*/
@@ -1,3 +1,4 @@
package appeng.core.crash;
@@ -1,3 +1,4 @@
package appeng.core.crash;
@@ -7,7 +8,7 @@ import appeng.core.AEConfig;
public class ModCrashEnhancement extends BaseCrashEnhancement
{
private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion;
@@ -79,7 +79,7 @@ public enum AEFeature
AEFeature( String cat )
{
this(cat, true);
this( cat, true );
}
AEFeature( String cat, boolean defaultValue )
@@ -1,3 +1,4 @@
package appeng.core.features;
@@ -92,7 +93,6 @@ public final class DefinitionConverter
}
}
private static class AEItem extends AEComparable
{
private final IItemDefinition definition;
@@ -119,7 +119,6 @@ public final class DefinitionConverter
}
}
private static class AEBlock extends AEItem
{
private final IBlockDefinition definition;
@@ -145,7 +144,6 @@ public final class DefinitionConverter
}
}
private static class AETile extends AEBlock
{
private final ITileDefinition definition;
@@ -42,7 +42,7 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
{
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
this.slabs = slabs;
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent());
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent() );
this.enabled = state == ActivityState.Enabled;
this.definition = new BlockDefinition( slabs, state );
}
@@ -65,8 +65,8 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
if( this.enabled )
{
this.slabs.setCreativeTab( CreativeTab.instance );
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false);
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true);
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false );
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true );
}
}
}
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries;
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries;
@@ -94,7 +95,7 @@ public class InscriberRecipe implements IInscriberRecipe
{
return true;
}
if( !(o instanceof IInscriberRecipe) )
if( !( o instanceof IInscriberRecipe ) )
{
return false;
}
@@ -113,7 +114,7 @@ public class InscriberRecipe implements IInscriberRecipe
{
return false;
}
if( !this.maybeBot.equals( that.getBottomOptional()) )
if( !this.maybeBot.equals( that.getBottomOptional() ) )
{
return false;
}
@@ -30,7 +30,7 @@ public enum PlayerMessages
isNowLocked, isNowUnlocked,
AmmoDepleted,
CommunicationError, OutOfRange, DeviceNotPowered, DeviceNotWirelessTerminal, DeviceNotLinked, StationCanNotBeLocated,
SettingCleared,;
SettingCleared, ;
public IChatComponent get()
{
@@ -38,20 +38,24 @@ import appeng.core.features.AEFeature;
public class PlayerStatsRegistration
{
/**
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the feature is enabled
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the
* feature is enabled
*/
private final EventBus bus;
/**
* is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the {@param config}
* is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the
*
* @param config}
*/
private final boolean isAchievementFeatureEnabled;
/**
* Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
*
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the
* {@link appeng.core.features.AEFeature#Achievements} is enabled
*/
public PlayerStatsRegistration( EventBus bus, AEConfig config )
{
@@ -60,7 +64,9 @@ public class PlayerStatsRegistration
}
/**
* Registers the {@link appeng.core.stats.AchievementCraftingHandler} and {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is true.
* Registers the {@link appeng.core.stats.AchievementCraftingHandler} and
* {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is
* true.
*/
public void registerAchievementHandlers()
{
@@ -76,7 +82,8 @@ public class PlayerStatsRegistration
}
/**
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements} to a new {@link net.minecraftforge.common.AchievementPage}.
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements}
* to a new {@link net.minecraftforge.common.AchievementPage}.
*/
public void registerAchievements()
{
@@ -56,7 +56,6 @@ public class AppEngPacketHandlerBase
{
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
public enum PacketTypes
{
PACKET_COMPASS_REQUEST( PacketCompassRequest.class ),
@@ -67,7 +67,7 @@ public final class PacketConfigButton extends AppEngPacket
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
if ( sender.openContainer instanceof AEBaseContainer )
if( sender.openContainer instanceof AEBaseContainer )
{
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if( baseContainer.getTarget() instanceof IConfigurableObject )
@@ -48,7 +48,7 @@ public interface IWorldPlayerMapping
/**
* Put in new players when they join the server
*
* @param id id of new player
* @param id id of new player
* @param uuid UUID of new player
*/
void put( int id, @Nonnull UUID uuid );
@@ -65,10 +65,11 @@ public class MeteorDataNameEncoder
/**
* @param dimension ID of the processed dimension. Can be any integer
* @param chunkX X coordinate of the chunk. Can be any integer
* @param chunkZ Z coordinate of the chunk. Can be any integer
* @param chunkX X coordinate of the chunk. Can be any integer
* @param chunkZ Z coordinate of the chunk. Can be any integer
*
* @return encoded file name suggestion in form of <tt>dim_x_y.dat</tt> where <tt>x</tt> and <tt>y</tt> will be shifted to stay conform with the vanilla chunk system
* @return encoded file name suggestion in form of <tt>dim_x_y.dat</tt> where <tt>x</tt> and <tt>y</tt> will be
* shifted to stay conform with the vanilla chunk system
*
* @since rv3 05.06.2015
*/
@@ -51,7 +51,7 @@ class PlayerMappingsInitializer
* where the UUIDs were introduced.
*
* @param playerList the category for the player list, generally extracted using the "players" tag
* @param log the logger used to warn the server or user of faulty entries
* @param log the logger used to warn the server or user of faulty entries
*/
PlayerMappingsInitializer( ConfigCategory playerList, FMLRelaunchLog log )
{
@@ -57,7 +57,8 @@ final class SpawnData implements IWorldSpawnData
}
@Override
public void setGenerated( int dim, int chunkX, int chunkZ ) {
public void setGenerated( int dim, int chunkX, int chunkZ )
{
synchronized( SpawnData.class )
{
NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ );