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,11 +1,15 @@
package appeng.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab {
public AEBaseItemBlockSlab(Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab)
public class AEBaseItemBlockSlab extends ItemSlab
{
public AEBaseItemBlockSlab( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab )
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
+20 -15
View File
@@ -56,11 +56,12 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
this.setStepSound( block.stepSound );
this.useNeighborBrightness = true;
if (!field_150004_a) this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs(this);
if( !field_150004_a )
this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs( this );
this.features = !field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs(AEBaseSlabBlock slabs)
public AEBaseSlabBlock setSlabs( AEBaseSlabBlock slabs )
{
this.slabs = slabs;
return this;
@@ -89,36 +90,40 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
}
@Override
public IIcon getIcon(int dir, int meta)
public IIcon getIcon( int dir, int meta )
{
return block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b(int p_150002_1_)
public String func_150002_b( int p_150002_1_ )
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons(IIconRegister reg) { }
@Override
public Item getItemDropped(int meta, Random rand, int fortune)
public void registerBlockIcons( IIconRegister reg )
{
return this.field_150004_a ? Item.getItemFromBlock(this.slabs) : Item.getItemFromBlock(this);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
public Item getItemDropped( int meta, Random rand, int fortune )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z);
return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
}
if (block == null) return null;
if (block.field_150004_a) block = this.slabs;
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
int meta = world.getBlockMetadata(x, y, z) & 7;
return new ItemStack(block, 1, meta);
if( block == null )
return null;
if( block.field_150004_a )
block = this.slabs;
int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
}
public String name()
@@ -455,7 +455,8 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( Throwable ignored )
{}
{
}
return false;
}
@@ -62,7 +62,7 @@ public class OreQuartzCharged extends OreQuartz
@Override
public int damageDropped( int id )
{
for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
@@ -74,7 +74,7 @@ public class OreQuartzCharged extends OreQuartz
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if ( !AEConfig.instance.enableEffects )
if( !AEConfig.instance.enableEffects )
{
return;
}
@@ -394,7 +394,6 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
private static class ButtonAppearance
{
public int index;
@@ -76,7 +76,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@Override
/**
* Overridden super.setupConfig to prevent setting up the fake slots
*/ protected void setupConfig()
*/protected void setupConfig()
{
this.setupUpgrades();
}
@@ -21,8 +21,8 @@ package appeng.container.slot;
import net.minecraft.inventory.IInventory;
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
public class SlotPlayerInv extends AppEngSlot
{
@@ -145,7 +145,8 @@ public class SlotRestrictedInput extends AppEngSlot
{
return true;
}
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem)
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ?
// ((ICraftingPatternItem)
// i.getItem()).getPatternForItem( i ) : null;
return false;// pattern != null;
}
@@ -179,8 +180,8 @@ public class SlotRestrictedInput extends AppEngSlot
case INSCRIBER_INPUT:
return true;/*
* for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return true;
*
* for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return
* true;
* return false;
*/
+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." );
}
+1 -1
View File
@@ -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;
@@ -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,12 +38,15 @@ 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;
@@ -51,7 +54,8 @@ public class PlayerStatsRegistration
* 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 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 )
@@ -68,7 +68,8 @@ public class MeteorDataNameEncoder
* @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
*/
@@ -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 );
@@ -536,23 +536,18 @@ public class FacadePart implements IFacadePart, IBoxProvider
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); }
*
* if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.NORTH ); }
*
* if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.SOUTH ); }
*
* if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.EAST ); }
*
* if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade(
* ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove(
* ForgeDirection.WEST ); }
+1 -1
View File
@@ -453,7 +453,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
double r = Math.abs( a - 0.5 );
r = Math.max( Math.abs( b - 0.5 ), r );
r = Math.max( Math.abs( c - 0.5 ), r );
return ( 8 * (int) Math.max( Math.abs( d - 0.5 ), r ) );
return( 8 * (int) Math.max( Math.abs( d - 0.5 ), r ) );
}
// @Override
@@ -373,7 +373,6 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
ACCEPT, DECLINE, TEST
}
static class TestLookup
{
@@ -1,3 +1,4 @@
package appeng.helpers;
@@ -317,7 +317,6 @@ public class TickHandler
}
}
public static class PlayerColor
{
@@ -29,9 +29,9 @@ public enum IntegrationType
BuildCraftCore( IntegrationSide.BOTH, "BuildCraft Core", "BuildCraft|Core" ),
BuildCraftTransport( IntegrationSide.BOTH, "BuildCraft Transport", "BuildCraft|Transport"),
BuildCraftTransport( IntegrationSide.BOTH, "BuildCraft Transport", "BuildCraft|Transport" ),
BuildCraftBuilder( IntegrationSide.BOTH, "BuildCraft Builders", "BuildCraft|Builders"),
BuildCraftBuilder( IntegrationSide.BOTH, "BuildCraft Builders", "BuildCraft|Builders" ),
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
@@ -37,7 +37,7 @@ public class BCPipeHandler implements IExternalStorageHandler
@Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
{
if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
{
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
@@ -196,7 +196,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
if( recipe.getOptionalOutput() != null )
{
final int chancePercent = (int) (recipe.getOptionalChance() * 100);
final int chancePercent = (int) ( recipe.getOptionalChance() * 100 );
this.hasOptional = true;
this.displayChance = String.format( GuiText.OfSecondOutput.getLocal(), chancePercent );
@@ -18,6 +18,7 @@
package appeng.integration.modules;
import li.cil.oc.api.Items;
import appeng.api.AEApi;
@@ -25,6 +26,7 @@ import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry;
import appeng.integration.BaseModule;
public class OpenComputers extends BaseModule
{
public static OpenComputers instance;
@@ -54,8 +54,8 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
/**
* Used cache for channels if the channel was not transmitted through the server.
* <p/>
* This is useful, when a player just started to look at a tile
* and thus just requested the new information from the server.
* This is useful, when a player just started to look at a tile and thus just requested the new information from the
* server.
* <p/>
* The cache will be updated from the server.
*/
@@ -91,9 +91,8 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
/**
* Determines the source of the channel.
* <p/>
* If the client received information of the channels on the server, they are used,
* else if the cache contains a previous stored value, this will be used.
* Default value is 0.
* If the client received information of the channels on the server, they are used, else if the cache contains a
* previous stored value, this will be used. Default value is 0.
*
* @param part part to be looked at
* @param tag tag maybe containing the channel information
@@ -125,9 +124,8 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
/**
* Called on server to transfer information from server to client.
* <p/>
* If the part is a cable,
* it writes the channel information in the {@code #tag}
* using the {@code ID_USED_CHANNELS} key.
* If the part is a cable, it writes the channel information in the {@code #tag} using the {@code ID_USED_CHANNELS}
* key.
*
* @param player player looking at the part
* @param part part being looked at
@@ -34,7 +34,8 @@ import appeng.api.parts.IPart;
/**
* An abstraction layer of the {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} for {@link appeng.api.parts.IPart}.
* An abstraction layer of the {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} for
* {@link appeng.api.parts.IPart}.
*
* @author thatsIch
* @version rv2
@@ -42,8 +42,8 @@ public final class PartAccessor
/**
* Hits a {@link appeng.api.parts.IPartHost} with {@link net.minecraft.util.MovingObjectPosition}.
* <p/>
* You can derive the looked at {@link appeng.api.parts.IPart} by doing that.
* If a facade is being looked at, it is defined as being absent.
* You can derive the looked at {@link appeng.api.parts.IPart} by doing that. If a facade is being looked at, it is
* defined as being absent.
*
* @param te being looked at {@link net.minecraft.tileentity.TileEntity}
* @param mop type of ray-trace
@@ -18,6 +18,7 @@
package appeng.integration.modules.waila.part;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.api.IWailaConfigHandler;
@@ -25,6 +26,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
import appeng.api.parts.IPart;
import appeng.api.parts.PartItemStack;
/**
* Part ItemStack provider for WAILA
*
@@ -32,7 +34,8 @@ import appeng.api.parts.PartItemStack;
* @version rv2
* @since rv2
*/
public class PartStackWailaDataProvider extends BasePartWailaDataProvider {
public class PartStackWailaDataProvider extends BasePartWailaDataProvider
{
@Override
public ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack )
@@ -72,7 +72,7 @@ public final class Tracer
Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ );
if( player.worldObj.isRemote )
{
//compatibility with eye height changing mods
// compatibility with eye height changing mods
v.yCoord += player.getEyeHeight() - player.getDefaultEyeHeight();
}
else
@@ -56,8 +56,8 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
/**
* Used cache for power if the power was not transmitted through the server.
* <p/>
* This is useful, when a player just started to look at a tile
* and thus just requested the new information from the server.
* This is useful, when a player just started to look at a tile and thus just requested the new information from the
* server.
* <p/>
* The cache will be updated from the server.
*/
@@ -77,8 +77,8 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
{
//Removes RF tooltip on WAILA 1.5.9+
((ITaggedList<String, String>) currentToolTip).removeEntries("RFEnergyStorage");
// Removes RF tooltip on WAILA 1.5.9+
( (ITaggedList<String, String>) currentToolTip ).removeEntries( "RFEnergyStorage" );
final TileEntity te = accessor.getTileEntity();
if( te instanceof IAEPowerStorage )
@@ -106,9 +106,8 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
/**
* Called on server to transfer information from server to client.
* <p/>
* If the {@link net.minecraft.tileentity.TileEntity} is a {@link appeng.api.networking.energy.IAEPowerStorage},
* it writes the power information to the {@code #tag}
* using the {@code #ID_CURRENT_POWER} key.
* If the {@link net.minecraft.tileentity.TileEntity} is a {@link appeng.api.networking.energy.IAEPowerStorage}, it
* writes the power information to the {@code #tag} using the {@code #ID_CURRENT_POWER} key.
*
* @param player player looking at the power storage
* @param te power storage
@@ -141,9 +140,8 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
/**
* Determines the current power.
* <p/>
* If the client received power information on the server, they are used,
* else if the cache contains a previous stored value, this will be used.
* Default value is 0.
* If the client received power information on the server, they are used, else if the cache contains a previous
* stored value, this will be used. Default value is 0.
*
* @param te te to be looked at
* @param tag tag maybe containing the channel information
@@ -190,7 +190,6 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
mat.markReady();
int newMaterialNum = mat.damageValue;
if( this.dmgToMaterial.get( newMaterialNum ) == null )
{
this.dmgToMaterial.put( newMaterialNum, mat );
@@ -18,6 +18,7 @@
package appeng.items.tools.powered.powersink;
/*
@Interface(iface = "universalelectricity.core.item.IItemElectric", modid = "IC2")
public class UniversalElectricity extends ThermalExpansion implements IItemElectric
@@ -29,8 +29,8 @@ import appeng.api.networking.IGridNode;
/**
* Nested iterator for {@link appeng.me.MachineSet}
*
* Traverses first over the {@link appeng.me.MachineSet}
* and then over every containing {@link appeng.api.networking.IGridNode}
* Traverses first over the {@link appeng.me.MachineSet} and then over every containing
* {@link appeng.api.networking.IGridNode}
*/
public class GridNodeIterator implements Iterator<IGridNode>
{
+1
View File
@@ -43,6 +43,7 @@ public class GridStorage implements IGridStorage
private final WeakHashMap<GridStorage, Boolean> divided = new WeakHashMap<GridStorage, Boolean>();
public boolean isDirty = false;
private WeakReference<IGrid> internalGrid = null;
// lost...
/**
@@ -162,7 +162,6 @@ public class NetworkEventBus
private static final long serialVersionUID = -3079021487019171205L;
}
class EventMethod
{
@@ -199,7 +198,6 @@ public class NetworkEventBus
}
}
class MENetworkEventInfo
{
-1
View File
@@ -380,7 +380,6 @@ public class GridStorageCache implements IStorageGrid
}
}
private class CellChangeTracker
{
+3 -3
View File
@@ -141,14 +141,14 @@ public class SecurityCache implements ISecurityGrid
public void populateGridStorage( IGridStorage destinationStorage )
{
} @Override
}
@Override
public boolean isAvailable()
{
return this.securityProvider.size() == 1 && this.securityProvider.get( 0 ).isSecurityEnabled();
}
@Override
public boolean hasPermission( EntityPlayer player, SecurityPermissions perm )
{
+1 -1
View File
@@ -56,7 +56,7 @@ public class TickTracker implements Comparable<TickTracker>
public long getAvgNanos()
{
return ( this.LastFiveTicksTime / 5 );
return( this.LastFiveTicksTime / 5 );
}
public void setRate( int rate )
@@ -419,7 +419,7 @@ public class CellInventory implements ICellInventory
}
// clean any old crusty stuff...
for(; x < oldStoredItems && x < this.maxItemTypes; x++ )
for( ; x < oldStoredItems && x < this.maxItemTypes; x++ )
{
this.tagCompound.removeTag( itemSlots[x] );
this.tagCompound.removeTag( itemSlotCount[x] );
@@ -69,7 +69,9 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
{
this.myChannel = chan;
this.security = security;
this.priorityInventory = new TreeMap<Integer, List<IMEInventoryHandler<T>>>( PRIORITY_SORTER ); // TreeMultimap.create( prioritySorter, hashSorter );
this.priorityInventory = new TreeMap<Integer, List<IMEInventoryHandler<T>>>( PRIORITY_SORTER ); // TreeMultimap.create(
// prioritySorter,
// hashSorter );
}
public void addNewStorage( IMEInventoryHandler<T> h )
@@ -1,3 +1,4 @@
package appeng.parts.automation;
@@ -1,3 +1,4 @@
package appeng.parts.automation;
@@ -508,10 +508,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
{
is.stackSize = (int) maxStorage;
EntityItem ei = new EntityItem( w, // w
( ( side.offsetX != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetX * -0.3 + x, // spawn
( ( side.offsetY != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetY * -0.3 + y, // spawn
( ( side.offsetZ != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetZ * -0.3 + z, // spawn
EntityItem ei = new EntityItem( w,
( ( side.offsetX != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetX * -0.3 + x,
( ( side.offsetY != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetY * -0.3 + y,
( ( side.offsetZ != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetZ * -0.3 + z,
is.copy() );
Entity result = ei;
@@ -1,3 +1,4 @@
package appeng.parts.automation;
@@ -18,6 +18,7 @@
package appeng.parts.layers;
import javax.annotation.Nullable;
import net.minecraftforge.common.util.ForgeDirection;
@@ -41,10 +42,10 @@ public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment
{
@Nullable
@Override
public Node sidedNode(ForgeDirection side)
public Node sidedNode( ForgeDirection side )
{
final IPart part = this.getPart( side );
if ( part instanceof SidedEnvironment )
if( part instanceof SidedEnvironment )
{
return ( (SidedEnvironment) part ).sidedNode( side );
}
@@ -52,10 +53,10 @@ public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment
}
@Override
public boolean canConnect(ForgeDirection side)
public boolean canConnect( ForgeDirection side )
{
final IPart part = this.getPart( side );
if ( part instanceof SidedEnvironment )
if( part instanceof SidedEnvironment )
{
return ( (SidedEnvironment) part ).canConnect( side );
}
@@ -368,33 +368,32 @@ public class PartDenseCable extends PartCable
boolean isGlass = false;
AEColor myColor = this.getCableColor();
/*
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart(
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) );
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS &&
* partHost.getPart(
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor()
* ) );
* } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) {
* rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 );
* break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4
* ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16,
* 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y,
* z, renderer );
*
* if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon firstIcon = new TaughtIcon( getChannelTex(
* channels, false ).getIcon(), -0.2f ); IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(),
* channels, false ).getIcon(), -0.2f ); IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true
* ).getIcon(),
* -0.2f );
*
* if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock)
* rh.getBlock(); FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip(
* false, true ); }
*
* Tessellator.INSTANCE.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.INSTANCE.setColorOpaque_I(
* myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock)
* myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
* renderAllFaces( (AEBaseBlock)
* rh.getBlock(), x, y, z, renderer );
*
* Tessellator.INSTANCE.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon,
* Tessellator.INSTANCE.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon,
* secondIcon, secondIcon, secondIcon,
* secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer );
*
* renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth =
* renderer.uvRotateTop = renderer.uvRotateWest = 0; }
*
* rh.setTexture( getTexture( getCableColor() ) ); }
*/
@@ -54,7 +54,7 @@ import appeng.transformer.annotations.Integration.Interface;
import appeng.transformer.annotations.Integration.InterfaceList;
@InterfaceList(value = { @Interface(iface = "li.cil.oc.api.network.Environment", iname = "OpenComputers"), @Interface(iface = "li.cil.oc.api.network.SidedEnvironment", iname = "OpenComputers") })
@InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname = "OpenComputers" ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname = "OpenComputers" ) } )
public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenComputers> implements IGridTickable, Environment, SidedEnvironment
{
@Nullable
@@ -62,17 +62,17 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
private final Callable<Void> updateCallback;
public PartP2POpenComputers(ItemStack is)
public PartP2POpenComputers( ItemStack is )
{
super( is );
if ( !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
if( !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
throw new RuntimeException( "OpenComputers is not installed!" );
}
// Avoid NPE when called in pre-init phase (part population).
if ( API.network != null )
if( API.network != null )
{
this.node = Network.newNode( this, Visibility.None ).create();
}
@@ -85,7 +85,7 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public IIcon getTypeTexture()
{
return Items.get( "adapter" ).block().getBlockTextureFromSide( 2 );
@@ -95,7 +95,7 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
public void removeFromWorld()
{
super.removeFromWorld();
if ( this.node != null)
if( this.node != null )
{
this.node.remove();
}
@@ -116,20 +116,20 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
}
@Override
public void readFromNBT(NBTTagCompound data)
public void readFromNBT( NBTTagCompound data )
{
super.readFromNBT( data );
if ( this.node != null)
if( this.node != null )
{
this.node.load( data );
}
}
@Override
public void writeToNBT(NBTTagCompound data)
public void writeToNBT( NBTTagCompound data )
{
super.writeToNBT( data );
if ( this.node != null)
if( this.node != null )
{
this.node.save( data );
}
@@ -148,7 +148,7 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
{
if( !this.proxy.getPath().isNetworkBooting() )
{
if ( this.node() != null ) // Client side doesn't have nodes.
if( this.node() != null ) // Client side doesn't have nodes.
{
TickHandler.INSTANCE.addCallable( this.tile.getWorldObj(), this.updateCallback );
}
@@ -166,14 +166,14 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
private void updateConnections()
{
if ( this.proxy.isPowered() && this.proxy.isActive() )
if( this.proxy.isPowered() && this.proxy.isActive() )
{
// Make sure we're connected to existing OC nodes in the world.
Network.joinOrCreateNetwork( this.getTile() );
if ( this.output )
if( this.output )
{
if ( this.getInput() != null && this.node != null )
if( this.getInput() != null && this.node != null )
{
Network.joinOrCreateNetwork( this.getInput().getTile() );
this.node.connect( this.getInput().node() );
@@ -183,22 +183,22 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
{
try
{
for ( PartP2POpenComputers output : this.getOutputs() )
for( PartP2POpenComputers output : this.getOutputs() )
{
if ( this.node != null )
if( this.node != null )
{
Network.joinOrCreateNetwork( output.getTile() );
this.node.connect( output.node() );
}
}
}
catch ( GridAccessException e )
catch( GridAccessException e )
{
AELog.error( e );
}
}
}
else if ( this.node != null )
else if( this.node != null )
{
this.node.remove();
}
@@ -212,26 +212,29 @@ public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenCompute
}
@Override
public void onConnect(Node node) {
public void onConnect( Node node )
{
}
@Override
public void onDisconnect(Node node) {
public void onDisconnect( Node node )
{
}
@Override
public void onMessage(Message message) {
public void onMessage( Message message )
{
}
@Nullable
@Override
public Node sidedNode(ForgeDirection side)
public Node sidedNode( ForgeDirection side )
{
return side == this.side ? this.node : null;
}
@Override
public boolean canConnect(ForgeDirection side)
public boolean canConnect( ForgeDirection side )
{
return side == this.side;
}
@@ -185,12 +185,9 @@ public class Ingredient implements IIngredient
/*
* Object o = Item.itemRegistry.getObject( nameSpace + ":" + itemName ); if ( o instanceof Item ) return new
* ItemStack( (Item) o, qty, meta );
*
* if ( o instanceof Block ) return new ItemStack( (Block) o, qty, meta );
*
* o = Item.itemRegistry.getObject( nameSpace + ":item." + itemName ); if ( o instanceof Item ) return new
* ItemStack( (Item) o, qty, meta );
*
* o = Block.blockRegistry.getObject( nameSpace + ":tile." + itemName ); if ( o instanceof Block && (!(o
* instanceof BlockAir)) ) return new ItemStack( (Block) o, qty, meta );
*/
@@ -106,7 +106,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
Map<Character, IIngredient> itemMap = new HashMap<Character, IIngredient>();
for(; idx < recipe.length; idx += 2 )
for( ; idx < recipe.length; idx += 2 )
{
Character chr = (Character) recipe[idx];
Object in = recipe[idx + 1];
@@ -271,7 +271,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
{
return false;
}
return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
return( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
}
public ShapedRecipe setMirrored( boolean mirror )
@@ -146,7 +146,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
private boolean checkItemEquals( ItemStack target, ItemStack input )
{
return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
return( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
}
/**
@@ -46,11 +46,11 @@ public final class Inscribe extends InscriberProcess
@Override
public void register() throws RegistrationError, MissingIngredientError
{
if ( this.getImprintable() == null )
if( this.getImprintable() == null )
{
return;
}
if ( this.getOutput() == null )
if( this.getOutput() == null )
{
return;
}
@@ -58,8 +58,8 @@ public final class Inscribe extends InscriberProcess
final ItemStack[] realInput = this.getImprintable().getItemStackSet();
final List<ItemStack> inputs = new ArrayList<ItemStack>( realInput.length );
Collections.addAll( inputs, realInput );
final ItemStack top = (this.getTopOptional() == null) ? null : this.getTopOptional().getItemStack();
final ItemStack bot = (this.getBotOptional() == null) ? null : this.getBotOptional().getItemStack();
final ItemStack top = ( this.getTopOptional() == null ) ? null : this.getTopOptional().getItemStack();
final ItemStack bot = ( this.getBotOptional() == null ) ? null : this.getBotOptional().getItemStack();
final ItemStack output = this.getOutput().getItemStack();
final InscriberProcessType type = InscriberProcessType.Inscribe;
@@ -1,3 +1,4 @@
package appeng.recipes.handlers;
@@ -78,7 +79,7 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali
{
String pattern = "inscriber ";
if ( this.output != null )
if( this.output != null )
{
pattern += this.output.getQty() + '\n';
pattern += handler.getName( this.output ) + '\n';
@@ -89,7 +90,7 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali
pattern += handler.getName( this.topOptional ) + '\n';
}
if ( this.imprintable != null )
if( this.imprintable != null )
{
pattern += handler.getName( this.imprintable );
}
@@ -46,11 +46,11 @@ public final class Press extends InscriberProcess
@Override
public void register() throws RegistrationError, MissingIngredientError
{
if ( this.getImprintable() == null )
if( this.getImprintable() == null )
{
return;
}
if ( this.getOutput() == null )
if( this.getOutput() == null )
{
return;
}
@@ -147,17 +147,20 @@ public class RecipeResourceCopier
if( dirURL != null && dirURL.getProtocol().equals( "jar" ) )
{
/* A JAR path */
final String jarPath = dirURL.getPath().substring( 5, dirURL.getPath().indexOf( '!' ) ); //strip out only the JAR file
final String jarPath = dirURL.getPath().substring( 5, dirURL.getPath().indexOf( '!' ) ); // strip out only
// the JAR file
final JarFile jar = new JarFile( URLDecoder.decode( jarPath, "UTF-8" ) );
try
{
final Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
final Collection<String> result = new HashSet<String>( INITIAL_RESOURCE_CAPACITY ); //avoid duplicates in case it is a subdirectory
final Enumeration<JarEntry> entries = jar.entries(); // gives ALL entries in jar
final Collection<String> result = new HashSet<String>( INITIAL_RESOURCE_CAPACITY ); // avoid duplicates
// in case it is a
// subdirectory
while( entries.hasMoreElements() )
{
final String name = entries.nextElement().getName();
if( name.startsWith( path ) )
{ //filter according to the path
{ // filter according to the path
String entry = name.substring( path.length() );
final int checkSubDir = entry.indexOf( '/' );
if( checkSubDir >= 0 )
@@ -220,7 +220,6 @@ public final class CompassService
}
}
private class CMDirectionRequest implements Runnable
{
@@ -87,7 +87,7 @@ public final class CompassRegion
private File getFile()
{
final String fileName = this.encoder.encode( this.world, this.lowX, this.lowZ);
final String fileName = this.encoder.encode( this.world, this.lowX, this.lowZ );
return new File( this.worldCompassFolder, fileName );
}
@@ -1,3 +1,4 @@
package appeng.services.version;
@@ -1,3 +1,4 @@
package appeng.services.version;
@@ -1,3 +1,4 @@
package appeng.services.version;
@@ -1,3 +1,4 @@
package appeng.services.version;
@@ -1,3 +1,4 @@
package appeng.services.version;
@@ -1,3 +1,4 @@
package appeng.services.version.github;
@@ -1,3 +1,4 @@
package appeng.services.version.github;
@@ -1,3 +1,4 @@
package appeng.services.version.github;
@@ -1,3 +1,4 @@
package appeng.services.version.github;
@@ -1,3 +1,4 @@
package appeng.services.version.github;
@@ -207,7 +207,9 @@ public class StorageHelper
}
}
public void swapRegions( World src /** over world **/, World dst /** storage cell **/, int x, int y, int z, int i, int j, int k, int scaleX, int scaleY, int scaleZ )
public void swapRegions( World src /** over world **/
, World dst /** storage cell **/
, int x, int y, int z, int i, int j, int k, int scaleX, int scaleY, int scaleZ )
{
for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() )
{
@@ -254,9 +256,9 @@ public class StorageHelper
this.transverseEdges( i, j, k, i + scaleX, j + scaleY, k + scaleZ, new TriggerUpdates( dst ) );
/*
* IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) { ChunkProviderServer
* IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) {
* ChunkProviderServer
* srv = (ChunkProviderServer) cp; srv.unloadAllChunks(); }
*
* cp.unloadQueuedChunks();
*/
@@ -280,7 +282,6 @@ public class StorageHelper
}
}
static class WrapInMatrixFrame implements ISpatialVisitor
{
@@ -302,7 +303,6 @@ public class StorageHelper
}
}
static class TelDestination
{
@@ -326,7 +326,6 @@ public class StorageHelper
}
}
static class METeleporter extends Teleporter
{
+3 -2
View File
@@ -349,7 +349,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
final Class<? extends AEBaseTile> clazz = this.getClass();
final Map<TileEventType, List<AETileEventHandler>> storedHandlers = HANDLERS.get( clazz );
if ( storedHandlers == null )
if( storedHandlers == null )
{
final Map<TileEventType, List<AETileEventHandler>> newStoredHandlers = new EnumMap<TileEventType, List<AETileEventHandler>>( TileEventType.class );
@@ -373,7 +373,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
}
@Nonnull
private List<AETileEventHandler> getHandlers( Map<TileEventType, List<AETileEventHandler>> eventToHandlers, TileEventType event ) {
private List<AETileEventHandler> getHandlers( Map<TileEventType, List<AETileEventHandler>> eventToHandlers, TileEventType event )
{
final List<AETileEventHandler> oldHandlers = eventToHandlers.get( event );
if( oldHandlers == null )
@@ -96,7 +96,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
if( this.cell.getStackInSlot( 0 ).getItem() instanceof ICellWorkbenchItem )
{
return ( (ICellWorkbenchItem) this.cell.getStackInSlot( 0 ).getItem() );
return( (ICellWorkbenchItem) this.cell.getStackInSlot( 0 ).getItem() );
}
return null;
@@ -289,7 +289,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
this.isOn = this.burnTime > 0;
this.markForUpdate();
if ( this.hasWorldObj() )
if( this.hasWorldObj() )
{
Platform.notifyBlocksOfNeighbors( this.worldObj, this.xCoord, this.yCoord, this.zCoord );
}
@@ -279,7 +279,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
public boolean isBlocked( ForgeDirection side )
{
return !this.ImmibisMicroblocks_isSideOpen( side.ordinal() );
} @Override
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean visual )
{
return this.cb.getSelectedBoundingBoxesFromPool( false, true, e, visual );
@@ -334,7 +336,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
this.getWorldObj().setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.AIR_BLOCK );
} @Override
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
for( AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, x, y, z, e, false ) )
@@ -374,7 +378,4 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
return this.cb.recolourBlock( side, colour, who );
}
}
@@ -34,7 +34,8 @@ import appeng.transformer.annotations.Integration.Interface;
import appeng.transformer.annotations.Integration.InterfaceList;
import appeng.transformer.annotations.Integration.Method;
@InterfaceList( value = { @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver" ), @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Interfaces.Transducerable") } )
@InterfaceList( value = { @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Power.AdvancedShaftPowerReceiver" ), @Interface( iname = "RotaryCraft", iface = "Reika.RotaryCraft.API.Interfaces.Transducerable" ) } )
public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerReceiver, Transducerable
{
@@ -176,7 +177,6 @@ public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerRecei
out = String.format( "Receiving %d W @ %d rad/s.", power, omega );
}
ArrayList<String> messages = new ArrayList<String>( 1 );
messages.add( out );
return messages;
@@ -18,66 +18,57 @@
package appeng.tile.powersink;
/*
import net.minecraftforge.common.util.ForgeDirection;
import universalelectricity.core.block.IElectrical;
import universalelectricity.core.electricity.ElectricityPack;
import appeng.api.config.PowerUnits;
public abstract class UniversalElectricity extends ThermalExpansion implements IElectrical
{
@Override
public final boolean canConnect(ForgeDirection direction)
{
return internalCanAcceptPower && getPowerSides().contains( direction );
}
@Override
public final float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive)
{
float accepted = 0;
double receivedPower = receive.getWatts();
if ( doReceive )
{
accepted = (float) (receivedPower - injectExternalPower( PowerUnits.KJ, receivedPower ));
}
else
{
double whatIWant = getExternalPowerDemand( PowerUnits.KJ );
if ( whatIWant > receivedPower )
accepted = (float) receivedPower;
else
accepted = (float) whatIWant;
}
return accepted;
}
@Override
public final float getRequest(ForgeDirection direction)
{
return (float) getExternalPowerDemand( PowerUnits.KJ );
}
@Override
public final float getVoltage()
{
return 120;
}
@Override
public final ElectricityPack provideElectricity(ForgeDirection from, ElectricityPack request, boolean doProvide)
{
return null; // cannot be dis-charged
}
@Override
public final float getProvide(ForgeDirection direction)
{
return 0;
}
}
*/
* import net.minecraftforge.common.util.ForgeDirection;
* import universalelectricity.core.block.IElectrical;
* import universalelectricity.core.electricity.ElectricityPack;
* import appeng.api.config.PowerUnits;
* public abstract class UniversalElectricity extends ThermalExpansion implements IElectrical
* {
* @Override
* public final boolean canConnect(ForgeDirection direction)
* {
* return internalCanAcceptPower && getPowerSides().contains( direction );
* }
* @Override
* public final float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive)
* {
* float accepted = 0;
* double receivedPower = receive.getWatts();
* if ( doReceive )
* {
* accepted = (float) (receivedPower - injectExternalPower( PowerUnits.KJ, receivedPower ));
* }
* else
* {
* double whatIWant = getExternalPowerDemand( PowerUnits.KJ );
* if ( whatIWant > receivedPower )
* accepted = (float) receivedPower;
* else
* accepted = (float) whatIWant;
* }
* return accepted;
* }
* @Override
* public final float getRequest(ForgeDirection direction)
* {
* return (float) getExternalPowerDemand( PowerUnits.KJ );
* }
* @Override
* public final float getVoltage()
* {
* return 120;
* }
* @Override
* public final ElectricityPack provideElectricity(ForgeDirection from, ElectricityPack request, boolean doProvide)
* {
* return null; // cannot be dis-charged
* }
* @Override
* public final float getProvide(ForgeDirection direction)
* {
* return 0;
* }
* }
*/
@@ -179,7 +179,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
{
return ( i == 0 && this.isSpatialCell( itemstack ) );
return( i == 0 && this.isSpatialCell( itemstack ) );
}
@Override
@@ -866,7 +866,6 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
private static final long serialVersionUID = 7995805326136526631L;
}
class ChestNetNotifier<T extends IAEStack<T>> implements IMEMonitorHandlerReceiver<T>
{
@@ -919,7 +918,6 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
}
}
class ChestMonitorHandler<T extends IAEStack> extends MEMonitorHandler<T>
{
@@ -34,7 +34,6 @@ public @interface Integration
Interface[] value();
}
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.TYPE )
@interface Interface
@@ -44,7 +43,6 @@ public @interface Integration
String iname();
}
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.METHOD )
@interface Method
@@ -1,3 +1,4 @@
package appeng.util;
@@ -1,3 +1,4 @@
package appeng.util;
-3
View File
@@ -1306,13 +1306,10 @@ public class Platform
/*
* // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1 ) return OreID == getOreID( b );
*
* if ( Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() && !isShared( a.getTagCompound() ) ) { a =
* Platform.getSharedItemStack( AEItemStack.create( a ) ); }
*
* if ( b.hasTagCompound() && !isShared( b.getTagCompound() ) ) { b = Platform.getSharedItemStack(
* AEItemStack.create( b ) ); }
*
* // test regular items with damage values and what not... if ( isShared( a.getTagCompound() ) && isShared(
* b.getTagCompound() ) && a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound)
* a.getTagCompound()).compareFuzzyWithRegistry( (AppEngSharedNBTTagCompound) b.getTagCompound() ); } }
@@ -1,3 +1,4 @@
package appeng.util;
@@ -87,7 +87,6 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
/*
* Super hackery.
*
* is.itemID = appeng.api.Materials.matQuartz.itemID; damageValue = is.getItemDamage(); is.itemID = itemID;
*/
@@ -478,7 +477,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
if( ia instanceof AEItemStack )
{
return ( (AEItemStack) ia ).def.equals( this.def );// && def.tagCompound == ((AEItemStack) ia).def.tagCompound;
return ( (AEItemStack) ia ).def.equals( this.def );// && def.tagCompound == ((AEItemStack)
// ia).def.tagCompound;
}
else if( ia instanceof ItemStack )
{
@@ -1,3 +1,4 @@
package appeng.worldgen.meteorite;
@@ -1,3 +1,4 @@
package appeng.worldgen.meteorite;
@@ -1,3 +1,4 @@
package appeng.worldgen.meteorite;
@@ -1,3 +1,4 @@
package appeng.worldgen.meteorite;
@@ -1,3 +1,4 @@
package appeng.worldgen.meteorite;

Some files were not shown because too many files have changed in this diff Show More