Code Formatting

This commit is contained in:
yueh
2018-08-30 20:31:27 +02:00
parent 044f4c9ed3
commit 66c365d11f
50 changed files with 170 additions and 111 deletions
@@ -1,10 +1,13 @@
package appeng.bootstrap.components;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.registries.IForgeRegistry;
import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface
public interface IEntityRegistrationComponent extends IBootstrapComponent
{
@@ -78,8 +78,9 @@ public class GuiPatternTerm extends GuiMEMonitorable
if( this.tabCraftButton == btn || this.tabProcessButton == btn )
{
NetworkHandler.instance().sendToServer(
new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
NetworkHandler.instance()
.sendToServer(
new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING ) );
}
if( this.encodeBtn == btn )
@@ -94,8 +95,9 @@ public class GuiPatternTerm extends GuiMEMonitorable
if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn )
{
NetworkHandler.instance().sendToServer(
new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
NetworkHandler.instance()
.sendToServer(
new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
}
}
catch( final IOException e )
@@ -41,6 +41,7 @@ import net.minecraft.util.EnumFacing;
public class DummyFluidBakedModel implements IBakedModel
{
private final ImmutableList<BakedQuad> quads;
public DummyFluidBakedModel( ImmutableList<BakedQuad> quads )
{
this.quads = quads;
@@ -78,7 +78,7 @@ public class DummyFluidItemModel implements IModel
{
IBakedModel bakedBaseModel = this.getBaseModel().bake( state, format, bakedTextureGetter );
return new DummyFluidDispatcherBakedModel( bakedBaseModel, format, bakedTextureGetter );
return new DummyFluidDispatcherBakedModel( bakedBaseModel, format, bakedTextureGetter );
}
@Override
@@ -247,8 +247,10 @@ public enum UVLModelLoader implements ICustomModelLoader
{
String s = modelLocation.getResourcePath();
iresource = Minecraft.getMinecraft().getResourceManager().getResource(
new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
iresource = Minecraft.getMinecraft()
.getResourceManager()
.getResource(
new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
reader = new InputStreamReader( iresource.getInputStream(), Charsets.UTF_8 );
lvt_5_1_ = JsonUtils.gsonDeserialize( this.UVLSERIALIZER, reader, ModelBlock.class, false );
@@ -468,8 +468,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
final ItemStack failed = real.getStackInSlot( x );
if( !failed.isEmpty() )
{
this.getCellInventory().injectItems( AEItemStack.fromItemStack( failed ), Actionable.MODULATE,
new MachineSource( this.getPatternTerminal() ) );
this.getCellInventory()
.injectItems( AEItemStack.fromItemStack( failed ), Actionable.MODULATE,
new MachineSource( this.getPatternTerminal() ) );
}
}
}
@@ -88,7 +88,7 @@ public class ContainerPriority extends AEBaseContainer
super.onUpdate( field, oldValue, newValue );
}
public IPriorityHost getPriorityHost()
{
return this.priHost;
@@ -151,7 +151,7 @@ public final class ApiMaterials implements IMaterials
.entity( EntityChargedQuartz.class )
.id( new ResourceLocation( "appliedenergistics2", EntityChargedQuartz.class.getName() ),
EntityIds.get( EntityChargedQuartz.class ) )
.name( EntityChargedQuartz.class.getSimpleName() )
.name( EntityChargedQuartz.class.getSimpleName() )
.tracker( 16, 4, true )
.build() );
} )
@@ -438,7 +438,7 @@ public final class ApiParts implements IParts
{
return this.fluidAnnihilationPlane;
}
@Override
public IItemDefinition fluidFormationnPlane()
{
@@ -81,7 +81,7 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
}
@Override
protected GuiText getName()
{
@@ -36,6 +36,6 @@ public interface IFluidInterfaceHost extends IActionHost, IGridProxyable, IUpgra
EnumSet<EnumFacing> getTargets();
TileEntity getTileEntity();
void saveChanges();
}
@@ -175,7 +175,7 @@ public class TileFluidInterface extends AENetworkTile implements IGridTickable,
{
return this.duality.getInventoryByName( name );
}
@Override
public ItemStack getItemStackRepresentation()
{
@@ -34,7 +34,7 @@ public class AEFluidTank extends FluidTank implements IAEFluidTank
{
super( capacity );
this.host = host;
if (host instanceof TileEntity)
if( host instanceof TileEntity )
{
this.setTileEntity( (TileEntity) host );
}
@@ -90,7 +90,6 @@ public class FluidSorters
}
};
private static SortDir getDirection()
{
return Direction;
@@ -1243,7 +1243,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{
this.priority = newValue;
this.iHost.saveChanges();
try
{
this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) );
@@ -18,10 +18,12 @@
package appeng.helpers;
import net.minecraft.item.ItemStack;
import appeng.core.sync.GuiBridge;
public interface IPriorityHost
{
@@ -34,8 +36,8 @@ public interface IPriorityHost
* set new priority
*/
void setPriority( int newValue );
ItemStack getItemStackRepresentation();
GuiBridge getGuiBridge();
}
@@ -77,8 +77,9 @@ final class IntegrationNode
final ModAPIManager apiManager = ModAPIManager.INSTANCE;
boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ) || apiManager.hasAPI( this.modID );
AEConfig.instance().addCustomCategoryComment( "ModIntegration",
"Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." );
AEConfig.instance()
.addCustomCategoryComment( "ModIntegration",
"Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." );
final String mode = AEConfig.instance().get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString();
if( mode.toUpperCase().equals( "ON" ) )
@@ -79,10 +79,12 @@ public class JEIPlugin implements IModPlugin
this.registerDescriptions( definitions, registry );
// Allow recipe transfer from JEI to crafting and pattern terminal
registry.getRecipeTransferRegistry().addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerCraftingTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
registry.getRecipeTransferRegistry().addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerPatternTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
registry.getRecipeTransferRegistry()
.addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerCraftingTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
registry.getRecipeTransferRegistry()
.addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerPatternTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
}
private void registerDescriptions( IDefinitions definitions, IModRegistry registry )
@@ -225,7 +225,8 @@ public enum PartType
FORMATION_PLANE( 320, "formation_plane", EnumSet.of( AEFeature.FORMATION_PLANE ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
FLUID_FORMATION_PLANE( 321, "fluid_formation_plane", EnumSet.of( AEFeature.FLUID_FORMATION_PLANE ), EnumSet.noneOf( IntegrationType.class ), PartFluidFormationPlane.class ),
FLUID_FORMATION_PLANE( 321, "fluid_formation_plane", EnumSet.of( AEFeature.FLUID_FORMATION_PLANE ), EnumSet
.noneOf( IntegrationType.class ), PartFluidFormationPlane.class ),
PATTERN_TERMINAL( 340, "pattern_terminal", EnumSet.of( AEFeature.PATTERNS ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
@@ -80,8 +80,11 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
@Override
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
{
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null,
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IMEInventoryHandler<?> inventory = AEApi.instance()
.registries()
.cell()
.getCellInventory( stack, null,
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
if( inventory instanceof ICellInventoryHandler )
{
@@ -157,9 +157,10 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
BlockPos offset = manager.getCellDimensionOrigin( cellid );
this.setStorageCell( is, cellid, targetSize );
StorageHelper.getInstance().swapRegions( w, min.x + 1, min.y + 1, min.z + 1, manager.getWorld(), offset.getX(), offset.getY(),
offset.getZ(), targetX - 1, targetY - 1,
targetZ - 1 );
StorageHelper.getInstance()
.swapRegions( w, min.x + 1, min.y + 1, min.z + 1, manager.getWorld(), offset.getX(), offset.getY(),
offset.getZ(), targetX - 1, targetY - 1,
targetZ - 1 );
return new TransitionResult( true, 0 );
}
+12 -10
View File
@@ -47,20 +47,22 @@ public class ChestLoot
final IMaterials materials = AEApi.instance().definitions().materials();
materials.certusQuartzCrystal().maybeStack( 1 ).ifPresent( is ->
{
event.getTable().addPool( new LootPool( new LootEntry[] {
new LootEntryItem( is.getItem(), 2, 3, new LootFunction[] {
new SetMetadata( null, new RandomValueRange( is.getItemDamage() ) ) }, new LootCondition[] {
new RandomChance( 1 ) }, "AE2 Crystal_" + is.getItemDamage() )
}, new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Crystals" ) );
event.getTable()
.addPool( new LootPool( new LootEntry[] {
new LootEntryItem( is.getItem(), 2, 3, new LootFunction[] {
new SetMetadata( null, new RandomValueRange( is.getItemDamage() ) ) }, new LootCondition[] {
new RandomChance( 1 ) }, "AE2 Crystal_" + is.getItemDamage() )
}, new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Crystals" ) );
} );
materials.certusQuartzDust().maybeStack( 1 ).ifPresent( is ->
{
event.getTable().addPool( new LootPool( new LootEntryItem[] {
new LootEntryItem( is.getItem(), 2, 3, new LootFunction[] {
new SetMetadata( null, new RandomValueRange( is.getItemDamage() ) ) }, new LootCondition[] {
new RandomChance( 1 ) }, "AE2 Dust_" + is.getItemDamage() )
}, new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 DUSTS" ) );
event.getTable()
.addPool( new LootPool( new LootEntryItem[] {
new LootEntryItem( is.getItem(), 2, 3, new LootFunction[] {
new SetMetadata( null, new RandomValueRange( is.getItemDamage() ) ) }, new LootCondition[] {
new RandomChance( 1 ) }, "AE2 Dust_" + is.getItemDamage() )
}, new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 DUSTS" ) );
} );
}
@@ -777,8 +777,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
if( details.isCraftable() )
{
FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ),
details.getOutput( ic, this.getWorld() ), ic );
FMLCommonHandler.instance()
.firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ),
details.getOutput( ic, this.getWorld() ), ic );
for( int x = 0; x < ic.getSizeInventory(); x++ )
{
@@ -156,8 +156,10 @@ public class QuantumCluster implements ILocatable, IAECluster
}
}
sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().grid().createGridConnection( sideA.getNode(),
sideB.getNode() ) );
sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance()
.grid()
.createGridConnection( sideA.getNode(),
sideB.getNode() ) );
}
catch( final FailedConnectionException e )
{
@@ -222,7 +222,7 @@ public abstract class PartAbstractFormationPlane<T extends IAEStack<T>> extends
{
return out;
}
@Override
public void readFromNBT( final NBTTagCompound data )
{
@@ -239,9 +239,12 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
{
try
{
connections.getConnections().put( me.getGridNode(),
new TunnelConnection( me, AEApi.instance().grid().createGridConnection( this.outerProxy.getNode(),
me.outerProxy.getNode() ) ) );
connections.getConnections()
.put( me.getGridNode(),
new TunnelConnection( me, AEApi.instance()
.grid()
.createGridConnection( this.outerProxy.getNode(),
me.outerProxy.getNode() ) ) );
}
catch( final FailedConnectionException e )
{
@@ -105,8 +105,11 @@ public final class DisassembleRecipe extends net.minecraftforge.registries.IForg
{
ItemStack storageCellStack = maybeCellOutput.get();
// make sure the storage cell stackInSlot empty...
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null,
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance()
.registries()
.cell()
.getCellInventory( stackInSlot, null,
AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
if( cellInv != null )
{
final IItemList<IAEItemStack> list = cellInv
@@ -521,8 +521,10 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
{
try
{
return (int) ( this.getProxy().getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE,
PowerMultiplier.CONFIG ) / acceleratorTax );
return (int) ( this.getProxy()
.getEnergy()
.extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE,
PowerMultiplier.CONFIG ) / acceleratorTax );
}
catch( final GridAccessException e )
{
@@ -177,8 +177,11 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
{
if( existing.isEmpty() )
{
this.inv[slot] = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack(
reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack );
this.inv[slot] = AEApi.instance()
.storage()
.getStorageChannel( IItemStorageChannel.class )
.createStack(
reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack );
}
else
{
@@ -197,7 +197,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
if( c != null )
{
ItemHandlerUtil.copy( this.config, c, false );
//copy items back. The ConfigInventory may changed the items on insert
// copy items back. The ConfigInventory may changed the items on insert
ItemHandlerUtil.copy( c, this.config, false );
}
this.locked = false;
@@ -354,7 +354,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
}
return super.getCapability( capability, facing );
}
@Override
public ItemStack getItemStackRepresentation()
{
@@ -398,7 +398,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
}
}
@Override
public ItemStack getItemStackRepresentation()
{
@@ -97,8 +97,9 @@ public class TileSkyChest extends AEBaseInvTile implements ITickable
if( this.getPlayerOpen() == 1 )
{
this.getWorld().playSound( player, this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D, SoundEvents.BLOCK_CHEST_OPEN,
SoundCategory.BLOCKS, 0.5F, this.getWorld().rand.nextFloat() * 0.1F + 0.9F );
this.getWorld()
.playSound( player, this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D, SoundEvents.BLOCK_CHEST_OPEN,
SoundCategory.BLOCKS, 0.5F, this.getWorld().rand.nextFloat() * 0.1F + 0.9F );
this.markForUpdate();
}
}
@@ -120,8 +121,9 @@ public class TileSkyChest extends AEBaseInvTile implements ITickable
if( this.getPlayerOpen() == 0 )
{
this.getWorld().playSound( player, this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D, SoundEvents.BLOCK_CHEST_CLOSE,
SoundCategory.BLOCKS, 0.5F, this.getWorld().rand.nextFloat() * 0.1F + 0.9F );
this.getWorld()
.playSound( player, this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D, SoundEvents.BLOCK_CHEST_CLOSE,
SoundCategory.BLOCKS, 0.5F, this.getWorld().rand.nextFloat() * 0.1F + 0.9F );
this.markForUpdate();
}
}
@@ -203,8 +203,9 @@ public final class MeteoritePlacer
}
}
for( final Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class,
new AxisAlignedBB( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) )
for( final Object o : w.getWorld()
.getEntitiesWithinAABB( EntityItem.class,
new AxisAlignedBB( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) )
{
final Entity e = (Entity) o;
e.setDead();