Code Formatting
This commit is contained in:
@@ -37,12 +37,16 @@ public enum Upgrades
|
||||
/**
|
||||
* Gold Tier Upgrades.
|
||||
*/
|
||||
CAPACITY( 0 ), REDSTONE( 0 ), CRAFTING( 0 ),
|
||||
CAPACITY( 0 ),
|
||||
REDSTONE( 0 ),
|
||||
CRAFTING( 0 ),
|
||||
|
||||
/**
|
||||
* Diamond Tier Upgrades.
|
||||
*/
|
||||
FUZZY( 1 ), SPEED( 1 ), INVERTER( 1 );
|
||||
FUZZY( 1 ),
|
||||
SPEED( 1 ),
|
||||
INVERTER( 1 );
|
||||
|
||||
private final int tier;
|
||||
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
|
||||
|
||||
@@ -121,6 +121,6 @@ public interface IParts
|
||||
IItemDefinition fluidLevelEmitter();
|
||||
|
||||
IItemDefinition fluidAnnihilationPlane();
|
||||
|
||||
|
||||
IItemDefinition fluidFormationnPlane();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ public interface IP2PTunnelRegistry
|
||||
* @param type - the type of tunnel. Nullable, but then ignored
|
||||
*/
|
||||
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type );
|
||||
|
||||
void addNewAttunement( @Nonnull String ModId, @Nullable TunnelType type );
|
||||
|
||||
void addNewAttunement( @Nonnull Capability<?> cap, @Nullable TunnelType type );
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,6 @@ import appeng.api.networking.IGridHost;
|
||||
public interface INetworkTool extends IGuiItemObject
|
||||
{
|
||||
IGridHost getGridHost(); // null for most purposes.
|
||||
|
||||
|
||||
IItemHandler getInventory();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface IPartHost extends ICustomCableConnection
|
||||
* @return null if the item failed to add, the side it was placed on other wise ( may different for cables,
|
||||
* {@link AEPartLocation}.UNKNOWN )
|
||||
*/
|
||||
AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer owner, EnumHand hand );
|
||||
AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer owner, EnumHand hand );
|
||||
|
||||
/**
|
||||
* Get part by side ( center is {@link AEPartLocation}.UNKNOWN )
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
/**
|
||||
* TODO: Consider removing and replacing with capabilities.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ import appeng.api.exceptions.MissingIngredientException;
|
||||
import appeng.api.exceptions.RecipeException;
|
||||
import appeng.api.exceptions.RegistrationException;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public interface ICraftHandler
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.api.exceptions.MissingIngredientException;
|
||||
import appeng.api.exceptions.RegistrationException;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public interface IIngredient
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.io.BufferedReader;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public interface IRecipeLoader
|
||||
{
|
||||
|
||||
@@ -74,25 +74,30 @@ public enum AEColor
|
||||
|
||||
TRANSPARENT( "gui.appliedenergistics2.Fluix", null, 0x1B2344, 0x895CA8, 0xD7BBEC );
|
||||
|
||||
public static final List<AEColor> VALID_COLORS = Arrays.asList( WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK );
|
||||
public static final List<AEColor> VALID_COLORS = Arrays.asList( WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE,
|
||||
BLUE, BROWN, GREEN, RED, BLACK );
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #blackVariant dark variant} of the apprioriate AE color.
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #blackVariant dark
|
||||
* variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_DARK = 1;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #mediumVariant medium variant} of the apprioriate AE color.
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #mediumVariant medium
|
||||
* variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_MEDIUM = 2;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #whiteVariant bright variant} of the apprioriate AE color.
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #whiteVariant bright
|
||||
* variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_BRIGHT = 3;
|
||||
|
||||
/**
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get a color between the {@link #mediumVariant medium}
|
||||
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get a color between the
|
||||
* {@link #mediumVariant medium}
|
||||
* and {@link #whiteVariant bright variant} of the apprioriate AE color.
|
||||
*/
|
||||
public static final int TINTINDEX_MEDIUM_BRIGHT = 4;
|
||||
@@ -141,7 +146,8 @@ public enum AEColor
|
||||
{
|
||||
switch( tintIndex )
|
||||
{
|
||||
// Please note that tintindex 0 is hardcoded for the block breaking particles. Returning anything other than -1 for tintindex=0 here
|
||||
// Please note that tintindex 0 is hardcoded for the block breaking particles. Returning anything other than
|
||||
// -1 for tintindex=0 here
|
||||
// will cause issues with those particles
|
||||
case 0:
|
||||
return -1;
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
|
||||
|
||||
/**
|
||||
* Implement on Tile or part to customize if the info gui opens, or an action is preformed.
|
||||
*/
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -83,13 +83,13 @@ public class UVLightmapJsonTest
|
||||
}
|
||||
|
||||
}.setLightLevel( 0.2f ).setCreativeTab( CreativeTabs.DECORATIONS ).setRegistryName( uvlblockR );
|
||||
|
||||
|
||||
final Item uvlblockItem = new ItemBlock( uvlblock ).setRegistryName( uvlblockR );
|
||||
|
||||
|
||||
FeatureFactory fact = Api.INSTANCE.definitions().getRegistry();
|
||||
fact.addBootstrapComponent( (IBlockRegistrationComponent) ( side, registry ) -> registry.register( uvlblock ) );
|
||||
fact.addBootstrapComponent( (IItemRegistrationComponent) ( side, registry ) -> registry.register( uvlblockItem ) );
|
||||
fact.addBootstrapComponent( new ItemVariantsComponent( uvlblockItem, Arrays.asList( uvlblockR ) ));
|
||||
fact.addBootstrapComponent( new ItemVariantsComponent( uvlblockItem, Arrays.asList( uvlblockR ) ) );
|
||||
fact.addBootstrapComponent( new ItemModelComponent( uvlblockItem, ImmutableMap.of( 0, new ModelResourceLocation( uvlblockR, "inventory" ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
|
||||
package appeng.core.worlddata;
|
||||
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
public class SpatialDimensionManagerTest
|
||||
{
|
||||
private static final BlockPos CONTENT = new BlockPos(1, 1, 1);
|
||||
|
||||
private static final BlockPos CONTENT = new BlockPos( 1, 1, 1 );
|
||||
|
||||
private static final int ID_1 = 0;
|
||||
private static final int ID_2 = 1;
|
||||
private static final int ID_3 = 2;
|
||||
@@ -21,42 +24,40 @@ public class SpatialDimensionManagerTest
|
||||
private static final int ID_A = 9;
|
||||
private static final int ID_B = 10;
|
||||
private static final int ID_C = 11;
|
||||
|
||||
|
||||
private static final BlockPos POS_1 = new BlockPos( -320, 64, -320);
|
||||
private static final BlockPos POS_2 = new BlockPos( 192, 64, -320);
|
||||
private static final BlockPos POS_3 = new BlockPos( -320, 64, 192);
|
||||
private static final BlockPos POS_4 = new BlockPos( 192, 64, 192);
|
||||
|
||||
private static final BlockPos POS_5 = new BlockPos( -832, 64, -320);
|
||||
private static final BlockPos POS_6 = new BlockPos( 704, 64, -320);
|
||||
private static final BlockPos POS_7 = new BlockPos( -832, 64, 192);
|
||||
private static final BlockPos POS_8 = new BlockPos( 704, 64, 192);
|
||||
private static final BlockPos POS_1 = new BlockPos( -320, 64, -320 );
|
||||
private static final BlockPos POS_2 = new BlockPos( 192, 64, -320 );
|
||||
private static final BlockPos POS_3 = new BlockPos( -320, 64, 192 );
|
||||
private static final BlockPos POS_4 = new BlockPos( 192, 64, 192 );
|
||||
|
||||
private static final BlockPos POS_5 = new BlockPos( -832, 64, -320 );
|
||||
private static final BlockPos POS_6 = new BlockPos( 704, 64, -320 );
|
||||
private static final BlockPos POS_7 = new BlockPos( -832, 64, 192 );
|
||||
private static final BlockPos POS_8 = new BlockPos( 704, 64, 192 );
|
||||
|
||||
private static final BlockPos POS_9 = new BlockPos( -320, 64, -832 );
|
||||
private static final BlockPos POS_A = new BlockPos( 192, 64, -832 );
|
||||
private static final BlockPos POS_B = new BlockPos( -320, 64, 704 );
|
||||
private static final BlockPos POS_C = new BlockPos( 192, 64, 704 );
|
||||
|
||||
private static final BlockPos POS_9 = new BlockPos( -320, 64, -832);
|
||||
private static final BlockPos POS_A = new BlockPos( 192, 64, -832);
|
||||
private static final BlockPos POS_B = new BlockPos( -320, 64, 704);
|
||||
private static final BlockPos POS_C = new BlockPos( 192, 64, 704);
|
||||
|
||||
|
||||
@Test
|
||||
public void testBlockPosGeneration()
|
||||
{
|
||||
SpatialDimensionManager manager = new SpatialDimensionManager( null );
|
||||
|
||||
Assert.assertEquals( ID_1, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_2, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_3, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_4, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_5, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_6, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_7, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_8, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_9, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_A, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_B, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
Assert.assertEquals( ID_C, manager.createNewCellDimension( CONTENT, -1 ));
|
||||
|
||||
|
||||
Assert.assertEquals( ID_1, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_2, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_3, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_4, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_5, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_6, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_7, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_8, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_9, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_A, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_B, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
Assert.assertEquals( ID_C, manager.createNewCellDimension( CONTENT, -1 ) );
|
||||
|
||||
Assert.assertEquals( POS_1, manager.getCellDimensionOrigin( ID_1 ) );
|
||||
Assert.assertEquals( POS_2, manager.getCellDimensionOrigin( ID_2 ) );
|
||||
Assert.assertEquals( POS_3, manager.getCellDimensionOrigin( ID_3 ) );
|
||||
|
||||
Reference in New Issue
Block a user