Compare commits

...

33 Commits

Author SHA1 Message Date
thatsIch 817163dbf6 Merge pull request #1240 from bakaxyf/rv2
Update zh_CN.lang
2015-04-08 21:03:31 +02:00
thatsIch d164e279ef Merge pull request #1238 from thatsIch/b-1202-item-count
Fixes #1202: Now 10000x is the limit before being converted to next bigger unit
2015-04-08 15:35:07 +02:00
bakaxyf 4f9b8db6fc Update zh_CN.lang 2015-04-08 12:16:13 +08:00
thatsIch b58c92ebb6 Fixes #1202: Now 10000x items is the limit before being converted to next bigger unit
Added a new method to display a number in a long fashion.
Added respective unit tests for them
2015-04-07 23:46:52 +02:00
yueh 2667b8eac6 Merge pull request #1233 from yueh/fix-1230
Changed to LinkedHashSet to maintain insertion order
2015-04-07 12:50:27 +02:00
yueh 235fad439d Merge pull request #1228 from yueh/fix-1222
Changed the order as WATs are special and needing a position
2015-04-07 12:50:21 +02:00
yueh fcea444041 Changed to LinkedHashSet to maintain insertion order
Fixes #1230
2015-04-07 12:28:45 +02:00
yueh 80f56d4359 Changed the order as WATs are special and needing a position
Fixes #1222
2015-04-07 00:17:55 +02:00
thatsIch f14bfa7d53 Merge pull request #1227 from bakaxyf/rv2
Update zh_CN.lang
2015-04-06 22:42:57 +02:00
bakaxyf a7d55ee520 Update zh_CN.lang 2015-04-07 04:39:19 +08:00
thatsIch 7382897e8e Merge pull request #1225 from thatsIch/b-dev-jar-duplicates
Deobfuscated version for Developers contains no dupes anymore
2015-04-06 20:31:48 +02:00
thatsIch aac2b598ea Merge pull request #1221 from Adaptivity/rv2
Update ru_RU.lang
2015-04-06 20:30:44 +02:00
thatsIch 0f31cd43d2 Deobfuscated version for Developers contains no dupes anymore 2015-04-06 19:42:20 +02:00
yueh 788de6d432 Merge pull request #964 from yueh/fix-889
Fixes #889 possible dupe bug
2015-04-06 15:54:23 +02:00
thatsIch 04a6a683bc Merge pull request #1220 from thatsIch/e-1219-hardcoded-localizations
Fixes #1219: Improved localization options
2015-04-06 15:44:36 +02:00
thatsIch 25e433f7bd Merge pull request #1215 from thatsIch/e-1054-inscriber-api
Closes #1054: Adds an Inscriber API for Developers
2015-04-06 15:44:27 +02:00
Anton fbc44f47c8 Update ru_RU.lang 2015-04-06 16:32:05 +03:00
thatsIch 06bca227d0 Closes #1054: Adds an Inscriber API for Developers 2015-04-06 13:45:27 +02:00
thatsIch 8321a5fe1c Fixes #1219: Improved localization options 2015-04-06 13:37:40 +02:00
yueh 1bb8de3570 Merge pull request #1216 from yueh/cleanup-modifier-order
Modifier are now using a consistent order based on the java conventions
2015-04-06 13:31:21 +02:00
thatsIch 8666937117 Merge pull request #1210 from thatsIch/e-1207-channels
Fixes #1207 → Enables resource packs more fine tuned information in WAILA channel display
2015-04-06 13:09:54 +02:00
yueh eaf57bedf6 Modifier are now using a consistent order based on the java conventions 2015-04-06 00:35:42 +02:00
thatsIch a30ef4679c Fixes #1207 → Enables resource packs more fine tuned information in WAILA channel display 2015-04-05 23:06:31 +02:00
yueh 0ee2ca72ac Merge pull request #1206 from yueh/fix-1068
Stops AEBaseItemBlock from modifying the metadata before placing.
2015-04-05 20:47:31 +02:00
thatsIch 881bb919da Merge pull request #1205 from thatsIch/b-npe-on-random-smashing-button
Fixes NPE on random button smashing
2015-04-05 20:18:10 +02:00
thatsIch 5ecd68d5b6 Merge pull request #1209 from thatsIch/b-integration-with-gradle
Fixes integration bug for Resources between Gradle and IntelliJ, does not affect Eclipse
2015-04-05 20:18:03 +02:00
thatsIch e2d0e5d424 Dont use instance reference for static references 2015-04-05 15:59:23 +02:00
thatsIch e3bf7d63c0 Split one liner declarations 2015-04-05 15:57:37 +02:00
thatsIch 3fedcf273b Remove random semicolons 2015-04-05 15:56:10 +02:00
thatsIch 8042dbb3db Fixes integration bug for Resources between Gradle and IntelliJ, does not affect Eclipse 2015-04-05 15:25:26 +02:00
yueh e7e397c412 Stops AEBaseItemBlock from modifying the metadata before placing. 2015-04-05 14:01:42 +02:00
thatsIch ecc472a692 Fixes NPE on random button smashing 2015-04-05 13:07:19 +02:00
yueh 5416ea2365 Fixes 889 possible dupe bug
Adds a hotfix to prevent duping with portable cells.
Should possibly fix the NPE crash with switching slots on laggy servers.
2015-04-03 17:23:17 +02:00
161 changed files with 1603 additions and 550 deletions
+1
View File
@@ -22,6 +22,7 @@ apply from: 'gradle/scripts/propertyloader.gradle'
apply from: 'gradle/scripts/dependencies.gradle'
apply from: 'gradle/scripts/artifacts.gradle'
apply from: 'gradle/scripts/autoinstallruntime.gradle'
apply from: 'gradle/scripts/integration.gradle'
buildscript {
repositories {
+7
View File
@@ -0,0 +1,7 @@
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = true
}
}
@@ -29,8 +29,8 @@ public enum FuzzyMode
// Note that percentage damaged, is the inverse of percentage durability.
IGNORE_ALL( -1 ), PERCENT_99( 0 ), PERCENT_75( 25 ), PERCENT_50( 50 ), PERCENT_25( 75 );
final public float breakPoint;
final public float percentage;
public final float breakPoint;
public final float percentage;
FuzzyMode( float p )
{
@@ -35,7 +35,7 @@ public enum PowerUnits
/**
* unlocalized name for the power unit.
*/
final public String unlocalizedName;
public final String unlocalizedName;
/**
* please do not edit this value, it is set when AE loads its config files.
*/
@@ -57,7 +57,7 @@ public enum SecurityPermissions
*/
SECURITY;
final private String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase();
private final String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase();
public String getUnlocalizedName()
{
@@ -37,8 +37,8 @@ import appeng.api.features.ILocatable;
public class LocatableEventAnnounce extends Event
{
final public ILocatable target;
final public LocatableEvent change;
public final ILocatable target;
public final LocatableEvent change;
public LocatableEventAnnounce( ILocatable o, LocatableEvent ev )
{
@@ -0,0 +1,65 @@
package appeng.api.features;
import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import com.google.common.base.Optional;
/**
* Registration Records for {@link IInscriberRegistry}
*
* You have to pay attention though, that recipes are not mirrored,
* where the top and bottom slots are switching places.
*
* This is applied on runtime.
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public interface IInscriberRecipe
{
/**
* the current inputs
*
* @return inputs the inscriber will accept
*/
@Nonnull
List<ItemStack> getInputs();
/**
* gets the current output
*
* @return output that the recipe will produce
*/
@Nonnull
ItemStack getOutput();
/**
* gets the top optional
*
* @return item which is used top
*/
@Nonnull
Optional<ItemStack> getTopOptional();
/**
* gets the bottom optional
*
* @return item which is used bottom
*/
@Nonnull
Optional<ItemStack> getBottomOptional();
/**
* type of inscriber process
*
* @return type of process the inscriber is doing
*/
@Nonnull
InscriberProcessType getProcessType();
}
@@ -0,0 +1,88 @@
package appeng.api.features;
import java.util.Collection;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
/**
* Builder for an inscriber recipe
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public interface IInscriberRecipeBuilder
{
/**
* Creates an inscriber recipe with inputs.
* Needs to be invoked.
*
* @param inputs new inputs for the recipe
*
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withInputs( @Nonnull Collection<ItemStack> inputs );
/**
* Creates an inscriber recipe with output.
* Needs to be invoked.
*
* @param output new output for the recipe
*
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withOutput( @Nonnull ItemStack output );
/**
* Creates an inscriber recipe with top.
* Either this or bot needs to be invoked.
*
* @param topOptional new top for the recipe
*
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withTopOptional( @Nonnull ItemStack topOptional );
/**
* Creates an inscriber recipe with bot.
* Either this or top needs to be invoked.
*
* @param bottomOptional new bot for the recipe
*
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withBottomOptional( @Nonnull ItemStack bottomOptional );
/**
* Creates an inscriber recipe with type.
* Needs to be invoked.
*
* @param type new type for the recipe
*
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withProcessType( @Nonnull InscriberProcessType type );
/**
* Finalizes the process of making the recipe.
* Needs to be invoked to fetch inscriber recipe.
*
* @return legal inscriber recipe
*
* @throws IllegalStateException when input is not defined
* @throws IllegalStateException when input has no size
* @throws IllegalStateException when output is not defined
* @throws IllegalStateException when both optionals are not defined
* @throws IllegalStateException when process type is not defined
*/
@Nonnull
IInscriberRecipe build();
}
@@ -0,0 +1,69 @@
package appeng.api.features;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
/**
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public interface IInscriberRegistry
{
/**
* Current list of registered recipes, you can modify this if you want too.
* Will never contain a null recipe
*
* @return currentlyRegisteredRecipes
*/
@Nonnull
List<IInscriberRecipe> getRecipes();
/**
* Optional items which are used in the top or bottom slot
*
* @return set of all optional items
*/
@Nonnull
Set<ItemStack> getOptionals();
/**
* Get all registered items which are valid inputs
*
* @return set of all input items
*/
@Nonnull
Set<ItemStack> getInputs();
/**
* Extensible way to create an inscriber recipe
*
* @return builder for inscriber recipes
*/
@Nonnull
IInscriberRecipeBuilder builder();
/**
* add a new recipe the easy way, duplicates will not be added.
* Added recipes will be automatically added to the optionals and inputs.
*
* @param recipe new recipe
*
* @throws IllegalArgumentException if null is added
*/
void addRecipe( IInscriberRecipe recipe );
/**
* Removes a recipe from the registry
*
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense
*/
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
}
@@ -30,6 +30,12 @@ import appeng.api.storage.ICellRegistry;
import appeng.api.storage.IExternalStorageRegistry;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public interface IRegistryContainer
{
@@ -69,6 +75,11 @@ public interface IRegistryContainer
*/
IGrinderRegistry grinder();
/**
* Manage inscriber recipes via API
*/
IInscriberRegistry inscriber();
/**
* get access to the locatable registry
*/
@@ -0,0 +1,15 @@
package appeng.api.features;
public enum InscriberProcessType
{
/**
* uses the optionals as catalyst
*/
Inscribe,
/**
* spends the optionals
*/
Press
}
@@ -30,9 +30,9 @@ import net.minecraft.nbt.NBTTagCompound;
public class ResolverResult
{
final public String itemName;
final public int damageValue;
final public NBTTagCompound compound;
public final String itemName;
public final int damageValue;
public final NBTTagCompound compound;
public ResolverResult( String name, int damage )
{
+4 -4
View File
@@ -77,22 +77,22 @@ public enum AEColor
/**
* Unlocalized name for color.
*/
final public String unlocalizedName;
public final String unlocalizedName;
/**
* Darkest Variant of the color, nearly black; as a RGB HEX Integer
*/
final public int blackVariant;
public final int blackVariant;
/**
* The Variant of the color that is used to represent the color normally; as a RGB HEX Integer
*/
final public int mediumVariant;
public final int mediumVariant;
/**
* Lightest Variant of the color, nearly white; as a RGB HEX Integer
*/
final public int whiteVariant;
public final int whiteVariant;
AEColor( String unlocalizedName, int blackHex, int medHex, int whiteHex )
{
+8 -8
View File
@@ -196,7 +196,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public IFeatureHandler handler()
public final IFeatureHandler handler()
{
return this.handler;
}
@@ -279,7 +279,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
final public AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
{
ICustomCollision collisionHandler = null;
AxisAlignedBB b = null;
@@ -360,7 +360,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public boolean isOpaqueCube()
public final boolean isOpaqueCube()
{
return this.isOpaque;
}
@@ -421,7 +421,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
@@ -566,13 +566,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public boolean isNormalCube( IBlockAccess world, int x, int y, int z )
public final boolean isNormalCube( IBlockAccess world, int x, int y, int z )
{
return this.isFullSize;
}
@Override
final public boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
{
IOrientable rotatable = null;
@@ -630,7 +630,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
{
if( this.hasBlockTileEntity() )
{
@@ -787,7 +787,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
final public TileEntity createNewTileEntity( World var1, int var2 )
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
@@ -162,8 +162,6 @@ public class AEBaseItemBlock extends ItemBlock
forward = ForgeDirection.SOUTH;
if( up.offsetY == 0 )
forward = ForgeDirection.UP;
ori.setOrientation( forward, up );
}
if( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
@@ -81,8 +81,8 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
static public Class<? extends TileEntity> noTesrTile;
static public Class<? extends TileEntity> tesrTile;
public static Class<? extends TileEntity> noTesrTile;
public static Class<? extends TileEntity> tesrTile;
/**
* Immibis MB Support.
*/
@@ -270,7 +270,7 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
final protected void drawGuiContainerForegroundLayer( int x, int y )
protected final void drawGuiContainerForegroundLayer( int x, int y )
{
int ox = this.guiLeft; // (width - xSize) / 2;
int oy = this.guiTop; // (height - ySize) / 2;
@@ -285,7 +285,7 @@ public abstract class AEBaseGui extends GuiContainer
public abstract void drawFG( int offsetX, int offsetY, int mouseX, int mouseY );
@Override
final protected void drawGuiContainerBackgroundLayer( float f, int x, int y )
protected final void drawGuiContainerBackgroundLayer( float f, int x, int y )
{
int ox = this.guiLeft; // (width - xSize) / 2;
int oy = this.guiTop; // (height - ySize) / 2;
@@ -30,6 +30,7 @@ import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.me.SlotME;
import appeng.core.AEConfig;
import appeng.core.localization.ButtonToolTips;
public abstract class AEBaseMEGui extends AEBaseGui
@@ -63,14 +64,30 @@ public abstract class AEBaseMEGui extends AEBaseGui
if( myStack != null )
{
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
currentToolTip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) );
{
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() );
final String format = String.format( local, formattedAmount );
currentToolTip.add( "\u00a77" + format );
}
if( myStack.getCountRequestable() > 0 )
currentToolTip.add( "\u00a77Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) );
{
final String local = ButtonToolTips.ItemsRequestable.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() );
final String format = String.format( local, formattedAmount );
currentToolTip.add( "\u00a77" + format );
}
}
else if( stack.stackSize > BigNumber || ( stack.stackSize > 1 && stack.isItemDamaged() ) )
{
currentToolTip.add( "\u00a77Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) );
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize );
final String format = String.format( local, formattedAmount );
currentToolTip.add( "\u00a77" + format );
}
}
}
@@ -30,7 +30,7 @@ public class GuiMEPortableCell extends GuiMEMonitorable
public GuiMEPortableCell( InventoryPlayer inventoryPlayer, IPortableCell te )
{
super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, null ) );
super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, te ) );
}
int defaultGetMaxRows()
@@ -28,10 +28,10 @@ import appeng.util.ItemSorters;
public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
{
final public String unlocalizedName;
final public AppEngInternalInventory inv;
final public long id;
final public long sortBy;
public final String unlocalizedName;
public final AppEngInternalInventory inv;
public final long id;
public final long sortBy;
public ClientDCInternalInv( int size, long id, long sortBy, String unlocalizedName )
{
+5 -5
View File
@@ -49,11 +49,11 @@ import appeng.util.prioitylist.IPartitionList;
public class ItemRepo
{
final private IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
final private ArrayList<IAEItemStack> view = new ArrayList<IAEItemStack>();
final private ArrayList<ItemStack> dsp = new ArrayList<ItemStack>();
final private IScrollSource src;
final private ISortSource sortSrc;
private final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
private final ArrayList<IAEItemStack> view = new ArrayList<IAEItemStack>();
private final ArrayList<ItemStack> dsp = new ArrayList<ItemStack>();
private final IScrollSource src;
private final ISortSource sortSrc;
public int rowSize = 9;
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText;
import appeng.util.ReadableNumberConverter;
@@ -75,7 +76,7 @@ public class AppEngRenderItem extends RenderItem
if( is.stackSize == 0 )
{
String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? "+" : "Craft";
String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL11.GL_DEPTH_TEST );
GL11.glPushMatrix();
@@ -128,7 +129,7 @@ public class AppEngRenderItem extends RenderItem
}
else
{
return NUMBER_CONVERTER.toHumanReadableForm( originalSize );
return NUMBER_CONVERTER.toLongHumanReadableForm( originalSize );
}
}
}
@@ -77,7 +77,7 @@ public class BaseBlockRender
setOriMap();
}
static public void setOriMap()
public static void setOriMap()
{
// pointed up...
ORIENTATION_MAP[0][3][1] = 0;
@@ -309,7 +309,7 @@ public class BaseBlockRender
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
}
static public int getOrientation( ForgeDirection in, ForgeDirection forward, ForgeDirection up )
public static int getOrientation( ForgeDirection in, ForgeDirection forward, ForgeDirection up )
{
if( in == null || in == ForgeDirection.UNKNOWN // 1
|| forward == null || forward == ForgeDirection.UNKNOWN // 2
@@ -29,7 +29,7 @@ import appeng.client.texture.TmpFlippableIcon;
public class BlockRenderInfo
{
final public BaseBlockRender rendererInstance;
public final BaseBlockRender rendererInstance;
private final TmpFlippableIcon tmpTopIcon = new TmpFlippableIcon();
private final TmpFlippableIcon tmpBottomIcon = new TmpFlippableIcon();
private final TmpFlippableIcon tmpSouthIcon = new TmpFlippableIcon();
@@ -40,7 +40,7 @@ import appeng.util.Platform;
public class TESRWrapper extends TileEntitySpecialRenderer
{
final public RenderBlocks renderBlocksInstance = new RenderBlocks();
public final RenderBlocks renderBlocksInstance = new RenderBlocks();
final BaseBlockRender blkRender;
final double MAX_DISTANCE;
@@ -52,7 +52,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer
}
@Override
final public void renderTileEntityAt( TileEntity te, double x, double y, double z, float f )
public final void renderTileEntityAt( TileEntity te, double x, double y, double z, float f )
{
if( te instanceof AEBaseTile )
{
@@ -36,18 +36,24 @@ import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.features.IInscriberRecipe;
import appeng.api.util.IOrientable;
import appeng.block.AEBaseBlock;
import appeng.block.misc.BlockInscriber;
import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AELog;
import appeng.recipes.handlers.Inscribe.InscriberRecipe;
import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class RenderBlockInscriber extends BaseBlockRender
{
@@ -225,9 +231,9 @@ public class RenderBlockInscriber extends BaseBlockRender
if( is == null )
{
InscriberRecipe ir = inv.getTask();
IInscriberRecipe ir = inv.getTask();
if( ir != null )
is = ir.output.copy();
is = ir.getOutput().copy();
}
this.renderItem( is, 0.0f, block, tile, tess, x, y, z, f, renderer );
@@ -75,7 +75,7 @@ public enum CableBusTextures
PartWirelessSides( "PartWirelessSides" ), PartStorageSides( "PartStorageSides" ), PartStorageBack( "PartStorageBack" );
final private String name;
private final String name;
public IIcon IIcon;
CableBusTextures( String name )
@@ -88,7 +88,7 @@ public enum ExtraBlockTextures
BlockPaint2( "BlockPaint2" ), BlockPaint3( "BlockPaint3" );
final private String name;
private final String name;
public IIcon IIcon;
ExtraBlockTextures( String name )
@@ -38,7 +38,7 @@ public enum ExtraItemTextures
ToolColorApplicatorTip_Light( "ToolColorApplicatorTip_Light" );
final private String name;
private final String name;
public IIcon IIcon;
ExtraItemTextures( String name )
@@ -86,7 +86,7 @@ public abstract class AEBaseContainer extends Container
{
protected final InventoryPlayer invPlayer;
final protected BaseActionSource mySrc;
protected final BaseActionSource mySrc;
protected final HashSet<Integer> locked = new HashSet<Integer>();
final TileEntity tileEntity;
final IPart part;
@@ -327,7 +327,7 @@ public abstract class AEBaseContainer extends Container
return this.tileEntity;
}
final public void updateFullProgressBar( int idx, long value )
public final void updateFullProgressBar( int idx, long value )
{
if( this.syncData.containsKey( idx ) )
{
@@ -640,7 +640,7 @@ public abstract class AEBaseContainer extends Container
}
@Override
final public void updateProgressBar( int idx, int value )
public final void updateProgressBar( int idx, int value )
{
if( this.syncData.containsKey( idx ) )
{
@@ -29,7 +29,7 @@ import appeng.api.parts.IPart;
public class ContainerOpenContext
{
final public boolean isItem;
public final boolean isItem;
public World w;
public int x;
public int y;
@@ -25,16 +25,21 @@ import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
import appeng.api.definitions.IItemDefinition;
import appeng.api.features.IInscriberRecipe;
import appeng.container.guisync.GuiSync;
import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.recipes.handlers.Inscribe;
import appeng.recipes.handlers.Inscribe.InscriberRecipe;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class ContainerInscriber extends ContainerUpgradeable implements IProgressProvider
{
@@ -105,32 +110,32 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@Override
public boolean isValidForSlot( Slot s, ItemStack is )
{
ItemStack PlateA = this.ti.getStackInSlot( 0 );
ItemStack PlateB = this.ti.getStackInSlot( 1 );
ItemStack top = this.ti.getStackInSlot( 0 );
ItemStack bot = this.ti.getStackInSlot( 1 );
if( s == this.middle )
{
for( ItemStack i : Inscribe.PLATES )
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
{
if( Platform.isSameItemPrecise( i, is ) )
if( Platform.isSameItemPrecise( optional, is ) )
return false;
}
boolean matches = false;
boolean found = false;
for( InscriberRecipe i : Inscribe.RECIPES )
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
boolean matchA = ( PlateA == null && i.plateA == null ) || ( Platform.isSameItemPrecise( PlateA, i.plateA ) ) && // and...
( PlateB == null && i.plateB == null ) | ( Platform.isSameItemPrecise( PlateB, i.plateB ) );
boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and...
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) );
boolean matchB = ( PlateB == null && i.plateA == null ) || ( Platform.isSameItemPrecise( PlateB, i.plateA ) ) && // and...
( PlateA == null && i.plateB == null ) | ( Platform.isSameItemPrecise( PlateA, i.plateB ) );
boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and...
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) );
if( matchA || matchB )
{
matches = true;
for( ItemStack option : i.imprintable )
for( ItemStack option : recipe.getInputs() )
{
if( Platform.isSameItemPrecise( is, option ) )
found = true;
@@ -142,7 +147,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
return false;
}
if( ( s == this.top && PlateB != null ) || ( s == this.bottom && PlateA != null ) )
if( ( s == this.top && bot != null ) || ( s == this.bottom && top != null ) )
{
boolean isValid = false;
ItemStack otherSlot = null;
@@ -159,15 +164,15 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
}
// everything else
for( InscriberRecipe i : Inscribe.RECIPES )
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( Platform.isSameItemPrecise( i.plateA, otherSlot ) )
if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) )
{
isValid = Platform.isSameItemPrecise( is, i.plateB );
isValid = Platform.isSameItemPrecise( is, recipe.getBottomOptional().orNull() );
}
else if( Platform.isSameItemPrecise( i.plateB, otherSlot ) )
else if( Platform.isSameItemPrecise( recipe.getBottomOptional().orNull(), otherSlot ) )
{
isValid = Platform.isSameItemPrecise( is, i.plateA );
isValid = Platform.isSameItemPrecise( is, recipe.getTopOptional().orNull() );
}
if( isValid )
@@ -25,20 +25,33 @@ import net.minecraft.item.ItemStack;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.container.interfaces.IInventorySlotAware;
import appeng.util.Platform;
public class ContainerMEPortableCell extends ContainerMEMonitorable
{
final IPortableCell civ;
double powerMultiplier = 0.5;
int ticks = 0;
public double powerMultiplier = 0.5;
private final IPortableCell civ;
private int ticks = 0;
private final int slot;
public ContainerMEPortableCell( InventoryPlayer ip, IPortableCell monitorable )
{
super( ip, monitorable, false );
this.lockPlayerInventorySlot( ip.currentItem );
if( monitorable instanceof IInventorySlotAware )
{
int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot();
this.lockPlayerInventorySlot( slotIndex );
this.slot = slotIndex;
}
else
{
this.slot = -1;
this.lockPlayerInventorySlot( ip.currentItem );
}
this.civ = monitorable;
this.bindPlayerInventory( ip, 0, 0 );
}
@@ -46,7 +59,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
@Override
public void detectAndSendChanges()
{
ItemStack currentItem = this.getPlayerInv().getCurrentItem();
ItemStack currentItem = slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( slot );
if( this.civ != null )
{
@@ -0,0 +1,37 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.container.interfaces;
/**
* Any item providing a GUI and depending on an exact inventory slot.
*
* This interface is likely a volatile one until a general GUI refactoring occurred.
* Use it with care and expect changes.
*
*/
public interface IInventorySlotAware
{
/**
* This is needed to select the correct slot index.
*
* @return the inventory index of this portable cell.
*/
int getInventorySlot();
}
@@ -42,10 +42,15 @@ import appeng.api.implementations.items.IUpgradeModule;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.storage.ICellWorkbenchItem;
import appeng.items.misc.ItemEncodedPattern;
import appeng.recipes.handlers.Inscribe;
import appeng.util.Platform;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class SlotRestrictedInput extends AppEngSlot
{
@@ -144,8 +149,8 @@ public class SlotRestrictedInput extends AppEngSlot
return true;
}
for( ItemStack is : Inscribe.PLATES )
if( Platform.isSameItemPrecise( is, i ) )
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
if( Platform.isSameItemPrecise( optional, i ) )
return true;
return false;
@@ -224,7 +229,7 @@ public class SlotRestrictedInput extends AppEngSlot
return super.getStack();
}
static public boolean isMetalIngot( ItemStack i )
public static boolean isMetalIngot( ItemStack i )
{
if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) )
return true;
+2 -2
View File
@@ -55,7 +55,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public static final double TUNNEL_POWER_LOSS = 0.05;
public static final String VERSION = "@version@";
public static final String CHANNEL = "@aechannel@";
public final static String PACKET_CHANNEL = "AE";
public static final String PACKET_CHANNEL = "AE";
public static AEConfig instance;
public final IConfigManager settings = new ConfigManager( this );
public final EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
@@ -63,7 +63,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public final int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
public final int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
private final double WirelessHighWirelessCount = 64;
final private File configFile;
private final File configFile;
public int storageBiomeID = -1;
public int storageProviderID = -1;
public int formationPlaneEntityLimit = 128;
+3 -3
View File
@@ -55,9 +55,9 @@ import appeng.util.Platform;
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.7.10]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
public class AppEng
{
public final static String MOD_ID = "appliedenergistics2";
public final static String MOD_NAME = "Applied Energistics 2";
public final static String MOD_DEPENDENCIES =
public static final String MOD_ID = "appliedenergistics2";
public static final String MOD_NAME = "Applied Energistics 2";
public static final String MOD_DEPENDENCIES =
// a few mods, AE should load after, probably.
// required-after:AppliedEnergistics2API|all;
// "after:gregtech_addon;after:Mekanism;after:IC2;after:ThermalExpansion;after:BuildCraft|Core;" +
@@ -19,7 +19,7 @@
package appeng.core;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import appeng.core.features.IFeatureHandler;
@@ -27,7 +27,7 @@ import appeng.core.features.IFeatureHandler;
public final class FeatureHandlerRegistry
{
private final Set<IFeatureHandler> registry = new HashSet<IFeatureHandler>();
private final Set<IFeatureHandler> registry = new LinkedHashSet<IFeatureHandler>();
public void addFeatureHandler( IFeatureHandler feature )
{
@@ -19,7 +19,7 @@
package appeng.core;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import appeng.core.features.IAEFeature;
@@ -27,7 +27,7 @@ import appeng.core.features.IAEFeature;
public final class FeatureRegistry
{
private final Set<IAEFeature> registry = new HashSet<IAEFeature>();
private final Set<IAEFeature> registry = new LinkedHashSet<IAEFeature>();
public void addFeature( IAEFeature feature )
{
+1 -1
View File
@@ -121,7 +121,7 @@ import appeng.worldgen.QuartzWorldGen;
public final class Registration
{
final public static Registration INSTANCE = new Registration();
public static final Registration INSTANCE = new Registration();
private final RecipeHandler recipeHandler;
private final DefinitionConverter converter;
@@ -31,7 +31,7 @@ import appeng.core.AELog;
public class GridCacheRegistry implements IGridCacheRegistry
{
final private HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>>();
private final HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>>();
@Override
public void registerGridCache( Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation )
@@ -0,0 +1,170 @@
package appeng.core.features.registries;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import appeng.api.features.IInscriberRecipe;
import appeng.api.features.IInscriberRecipeBuilder;
import appeng.api.features.IInscriberRegistry;
import appeng.api.features.InscriberProcessType;
import appeng.core.features.registries.entries.InscriberRecipe;
/**
* @author thatsIch
* @version rv2
* @since rv2
*/
public final class InscriberRegistry implements IInscriberRegistry
{
private final List<IInscriberRecipe> recipes;
private final Set<ItemStack> optionals;
private final Set<ItemStack> inputs;
public InscriberRegistry()
{
this.inputs = new HashSet<ItemStack>();
this.optionals = new HashSet<ItemStack>();
this.recipes = new ArrayList<IInscriberRecipe>();
}
@Nonnull
@Override
public List<IInscriberRecipe> getRecipes()
{
return this.recipes;
}
@Nonnull
@Override
public Set<ItemStack> getOptionals()
{
return this.optionals;
}
@Nonnull
@Override
public Set<ItemStack> getInputs()
{
return this.inputs;
}
@Nonnull
@Override
public IInscriberRecipeBuilder builder()
{
return new Builder();
}
@Override
public void addRecipe( IInscriberRecipe recipe )
{
if( recipe == null )
throw new IllegalArgumentException( "Tried to add an invalid (null) inscriber recipe to the registry." );
this.recipes.add( recipe );
this.optionals.addAll( recipe.getTopOptional().asSet() );
this.optionals.addAll( recipe.getBottomOptional().asSet() );
this.inputs.addAll( recipe.getInputs() );
}
@Override
public void removeRecipe( IInscriberRecipe toBeRemovedRecipe )
{
for( final Iterator<IInscriberRecipe> iterator = this.recipes.iterator(); iterator.hasNext(); )
{
final IInscriberRecipe recipe = iterator.next();
if( recipe.equals( toBeRemovedRecipe ) )
{
iterator.remove();
}
}
}
/**
* Internal {@link IInscriberRecipeBuilder} implementation.
* Needs to be adapted to represent a correct {@link IInscriberRecipe}
*/
private static final class Builder implements IInscriberRecipeBuilder
{
private List<ItemStack> inputs;
private ItemStack output;
private ItemStack topOptional;
private ItemStack bottomOptional;
private InscriberProcessType type;
@Nonnull
@Override
public Builder withInputs( @Nonnull Collection<ItemStack> inputs )
{
this.inputs = new ArrayList<ItemStack>( inputs.size() );
this.inputs.addAll( inputs );
return this;
}
@Nonnull
@Override
public Builder withOutput( @Nonnull ItemStack output )
{
this.output = output;
return this;
}
@Nonnull
@Override
public Builder withTopOptional( @Nonnull ItemStack topOptional )
{
this.topOptional = topOptional;
return this;
}
@Nonnull
@Override
public Builder withBottomOptional( @Nonnull ItemStack bottomOptional )
{
this.bottomOptional = bottomOptional;
return this;
}
@Nonnull
@Override
public Builder withProcessType( @Nonnull InscriberProcessType type )
{
this.type = type;
return this;
}
@Nonnull
@Override
public IInscriberRecipe build()
{
if( this.inputs == null )
throw new IllegalStateException( "Input must be defined." );
if( this.inputs.size() == 0 )
throw new IllegalStateException( "Input must have a size." );
if( this.output == null )
throw new IllegalStateException( "Output must be defined." );
if ( this.topOptional == null && this.bottomOptional == null )
throw new IllegalStateException( "One optional must be defined." );
if ( this.type == null )
throw new IllegalStateException( "Process type must be defined." );
return new InscriberRecipe( this.inputs, this.output, this.topOptional, this.bottomOptional, this.type );
}
}
}
@@ -20,6 +20,7 @@ package appeng.core.features.registries;
import appeng.api.features.IGrinderRegistry;
import appeng.api.features.IInscriberRegistry;
import appeng.api.features.ILocatableRegistry;
import appeng.api.features.IMatterCannonAmmoRegistry;
import appeng.api.features.IP2PTunnelRegistry;
@@ -35,74 +36,88 @@ import appeng.api.storage.ICellRegistry;
import appeng.api.storage.IExternalStorageRegistry;
/**
* represents all registries
*
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class RegistryContainer implements IRegistryContainer
{
private final GrinderRecipeManager GrinderRecipes = new GrinderRecipeManager();
private final ExternalStorageRegistry ExternalStorageHandlers = new ExternalStorageRegistry();
private final CellRegistry CellRegistry = new CellRegistry();
private final LocatableRegistry LocatableRegistry = new LocatableRegistry();
private final SpecialComparisonRegistry SpecialComparisonRegistry = new SpecialComparisonRegistry();
private final WirelessRegistry WirelessRegistry = new WirelessRegistry();
private final GridCacheRegistry GridCacheRegistry = new GridCacheRegistry();
private final P2PTunnelRegistry P2PRegistry = new P2PTunnelRegistry();
private final MovableTileRegistry MovableReg = new MovableTileRegistry();
private final MatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry();
private final PlayerRegistry playerRegistry = new PlayerRegistry();
private final IGrinderRegistry grinder = new GrinderRecipeManager();
private final IInscriberRegistry inscriber = new InscriberRegistry();
private final IExternalStorageRegistry storage = new ExternalStorageRegistry();
private final ICellRegistry cell = new CellRegistry();
private final ILocatableRegistry locatable = new LocatableRegistry();
private final ISpecialComparisonRegistry comparison = new SpecialComparisonRegistry();
private final IWirelessTermRegistry wireless = new WirelessRegistry();
private final IGridCacheRegistry gridCache = new GridCacheRegistry();
private final IP2PTunnelRegistry p2ptunnel = new P2PTunnelRegistry();
private final IMovableRegistry movable = new MovableTileRegistry();
private final IMatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry();
private final IPlayerRegistry playerRegistry = new PlayerRegistry();
private final IRecipeHandlerRegistry recipeReg = new RecipeHandlerRegistry();
@Override
public IMovableRegistry movable()
{
return this.MovableReg;
return this.movable;
}
@Override
public IGridCacheRegistry gridCache()
{
return this.GridCacheRegistry;
return this.gridCache;
}
@Override
public IExternalStorageRegistry externalStorage()
{
return this.ExternalStorageHandlers;
return this.storage;
}
@Override
public ISpecialComparisonRegistry specialComparison()
{
return this.SpecialComparisonRegistry;
return this.comparison;
}
@Override
public IWirelessTermRegistry wireless()
{
return this.WirelessRegistry;
return this.wireless;
}
@Override
public ICellRegistry cell()
{
return this.CellRegistry;
return this.cell;
}
@Override
public IGrinderRegistry grinder()
{
return this.GrinderRecipes;
return this.grinder;
}
@Override
public IInscriberRegistry inscriber()
{
return this.inscriber;
}
@Override
public ILocatableRegistry locatable()
{
return this.LocatableRegistry;
return this.locatable;
}
@Override
public IP2PTunnelRegistry p2pTunnel()
{
return this.P2PRegistry;
return this.p2ptunnel;
}
@Override
@@ -25,8 +25,8 @@ import net.minecraft.tileentity.TileEntity;
public class WirelessRangeResult
{
final public float dist;
final public TileEntity te;
public final float dist;
public final TileEntity te;
public WirelessRangeResult( TileEntity t, float d )
{
@@ -30,7 +30,7 @@ import appeng.api.features.IWorldGen;
public final class WorldGenRegistry implements IWorldGen
{
static final public WorldGenRegistry INSTANCE = new WorldGenRegistry();
public static final WorldGenRegistry INSTANCE = new WorldGenRegistry();
final TypeSet[] types;
private WorldGenRegistry()
@@ -0,0 +1,26 @@
package appeng.core.features.registries.entries;
import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import appeng.api.features.InscriberProcessType;
/**
* inscribe recipes do not use up the provided optional upon craft
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public class InscriberInscribeRecipe extends InscriberRecipe
{
public InscriberInscribeRecipe( @Nonnull Collection<ItemStack> inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot )
{
super( inputs, output, top, bot, InscriberProcessType.Inscribe );
}
}
@@ -0,0 +1,120 @@
package appeng.core.features.registries.entries;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import com.google.common.base.Optional;
import appeng.api.features.IInscriberRecipe;
import appeng.api.features.InscriberProcessType;
/**
* Basic inscriber recipe
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public class InscriberRecipe implements IInscriberRecipe
{
@Nonnull
private final List<ItemStack> inputs;
@Nonnull
private final ItemStack output;
@Nonnull
private final Optional<ItemStack> maybeTop;
@Nonnull
private final Optional<ItemStack> maybeBot;
@Nonnull
private final InscriberProcessType type;
public InscriberRecipe( @Nonnull Collection<ItemStack> inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot, @Nonnull InscriberProcessType type )
{
this.inputs = new ArrayList<ItemStack>( inputs.size() );
this.inputs.addAll( inputs );
this.output = output;
this.maybeTop = Optional.fromNullable( top );
this.maybeBot = Optional.fromNullable( bot );
this.type = type;
}
@Nonnull
@Override
public final List<ItemStack> getInputs()
{
return this.inputs;
}
@Nonnull
@Override
public final ItemStack getOutput()
{
return this.output;
}
@Nonnull
@Override
public final Optional<ItemStack> getTopOptional()
{
return this.maybeTop;
}
@Nonnull
@Override
public final Optional<ItemStack> getBottomOptional()
{
return this.maybeBot;
}
@Nonnull
@Override
public final InscriberProcessType getProcessType()
{
return this.type;
}
@Override
public boolean equals( Object o )
{
if( this == o )
return true;
if( !(o instanceof IInscriberRecipe) )
return false;
IInscriberRecipe that = (IInscriberRecipe) o;
if( !this.inputs.equals( that.getInputs() ) )
return false;
if( !this.output.equals( that.getOutput() ) )
return false;
if( !this.maybeTop.equals( that.getTopOptional() ) )
return false;
if( !this.maybeBot.equals( that.getBottomOptional()) )
return false;
return this.type == that.getProcessType();
}
@Override
public int hashCode()
{
int result = this.inputs.hashCode();
result = 31 * result + this.output.hashCode();
result = 31 * result + this.maybeTop.hashCode();
result = 31 * result + this.maybeBot.hashCode();
result = 31 * result + this.type.hashCode();
return result;
}
}
@@ -58,7 +58,10 @@ public enum ButtonToolTips
Craft, Mod, DoesntDespawn, EmitterMode, CraftViaRedstone, EmitWhenCrafting, ReportInaccessibleItems, ReportInaccessibleItemsYes, ReportInaccessibleItemsNo,
BlockPlacement, BlockPlacementYes, BlockPlacementNo;
BlockPlacement, BlockPlacementYes, BlockPlacementNo,
// Used in the tooltips of the items in the terminal, when moused over
ItemsStored, ItemsRequestable;
final String root;
@@ -70,7 +70,13 @@ public enum GuiText
NoCraftingJobs, CPUs, FacadeCrafting, inWorldCraftingPresses, ChargedQuartzFind,
Included, Excluded, Partitioned, Precise, Fuzzy;
Included, Excluded, Partitioned, Precise, Fuzzy,
// Used in a terminal to indicate that an item is craftable
SmallFontCraft, LargeFontCraft,
// Used in a ME Interface when no appropriate TileEntity was detected near it
Nothing;
final String root;
@@ -43,7 +43,7 @@ public abstract class AppEngPacket
throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
}
final public int getPacketID()
public final int getPacketID()
{
return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal();
}
+21 -12
View File
@@ -250,15 +250,21 @@ public enum GuiBridge implements IGuiHandler
ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 );
GuiBridge ID = values()[ID_ORDINAL >> 4];
boolean stem = ( ( ID_ORDINAL >> 3 ) & 1 ) == 1;
if( ID.type.isItem() && stem )
if( ID.type.isItem() )
{
ItemStack it = player.inventory.getCurrentItem();
ItemStack it = null;
if( stem )
{
it = player.inventory.getCurrentItem();
}
else if( x >= 0 && x < player.inventory.mainInventory.length )
{
it = player.inventory.getStackInSlot( x );
}
Object myItem = this.getGuiObject( it, player, w, x, y, z );
if( myItem != null && ID.CorrectTileOrPart( myItem ) )
return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem );
}
if( ID.type.isTile() )
{
TileEntity TE = w.getTileEntity( x, y, z );
@@ -275,7 +281,6 @@ public enum GuiBridge implements IGuiHandler
return this.updateGui( ID.ConstructContainer( player.inventory, side, TE ), w, x, y, z, side, TE );
}
}
return new ContainerNull();
}
@@ -411,19 +416,24 @@ public enum GuiBridge implements IGuiHandler
ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 );
GuiBridge ID = values()[ID_ORDINAL >> 4];
boolean stem = ( ( ID_ORDINAL >> 3 ) & 1 ) == 1;
if( ID.type.isItem() && stem )
if( ID.type.isItem() )
{
ItemStack it = player.inventory.getCurrentItem();
ItemStack it = null;
if( stem )
{
it = player.inventory.getCurrentItem();
}
else if( x >= 0 && x < player.inventory.mainInventory.length )
{
it = player.inventory.getStackInSlot( x );
}
Object myItem = this.getGuiObject( it, player, w, x, y, z );
if( ID.CorrectTileOrPart( myItem ) )
if( myItem != null && ID.CorrectTileOrPart( myItem ) )
return ID.ConstructGui( player.inventory, side, myItem );
}
if( ID.type.isTile() )
{
TileEntity TE = w.getTileEntity( x, y, z );
if( TE instanceof IPartHost )
{
( (IPartHost) TE ).getPart( side );
@@ -437,7 +447,6 @@ public enum GuiBridge implements IGuiHandler
return ID.ConstructGui( player.inventory, side, TE );
}
}
return new GuiNull( new ContainerNull() );
}
@@ -40,11 +40,11 @@ import appeng.util.item.AEItemStack;
public class PacketAssemblerAnimation extends AppEngPacket
{
final public int x;
final public int y;
final public int z;
final public byte rate;
final public IAEItemStack is;
public final int x;
public final int y;
public final int z;
public final byte rate;
public final IAEItemStack is;
// automatic.
public PacketAssemblerAnimation( ByteBuf stream ) throws IOException
@@ -36,10 +36,10 @@ import appeng.services.compass.ICompassCallback;
public class PacketCompassRequest extends AppEngPacket implements ICompassCallback
{
final public long attunement;
final public int cx;
final public int cz;
final public int cdy;
public final long attunement;
public final int cx;
public final int cz;
public final int cdy;
EntityPlayer talkBackTo;
@@ -33,10 +33,10 @@ import appeng.hooks.CompassResult;
public class PacketCompassResponse extends AppEngPacket
{
final public long attunement;
final public int cx;
final public int cz;
final public int cdy;
public final long attunement;
public final int cx;
public final int cz;
public final int cdy;
public CompassResult cr;
@@ -50,8 +50,8 @@ public class PacketCompressedNBT extends AppEngPacket
// input.
final NBTTagCompound in;
// output...
final private ByteBuf data;
final private GZIPOutputStream compressFrame;
private final ByteBuf data;
private final GZIPOutputStream compressFrame;
int writtenBytes = 0;
boolean empty = true;
@@ -37,8 +37,8 @@ import appeng.util.Platform;
public class PacketConfigButton extends AppEngPacket
{
final public Settings option;
final public boolean rotationDirection;
public final Settings option;
public final boolean rotationDirection;
// automatic.
public PacketConfigButton( ByteBuf stream )
@@ -46,8 +46,8 @@ import appeng.util.Platform;
public class PacketCraftRequest extends AppEngPacket
{
final public long amount;
final public boolean heldShift;
public final long amount;
public final boolean heldShift;
// automatic.
public PacketCraftRequest( ByteBuf stream )
@@ -44,10 +44,10 @@ import appeng.util.item.AEItemStack;
public class PacketInventoryAction extends AppEngPacket
{
final public InventoryAction action;
final public int slot;
final public long id;
final public IAEItemStack slotItem;
public final InventoryAction action;
public final int slot;
public final long id;
public final IAEItemStack slotItem;
// automatic.
public PacketInventoryAction( ByteBuf stream ) throws IOException
@@ -36,9 +36,9 @@ import appeng.core.sync.network.INetworkInfo;
public class PacketMockExplosion extends AppEngPacket
{
final public double x;
final public double y;
final public double z;
public final double x;
public final double y;
public final double z;
// automatic.
public PacketMockExplosion( ByteBuf stream )
@@ -39,11 +39,11 @@ import appeng.util.item.AEItemStack;
public class PacketPatternSlot extends AppEngPacket
{
final public IAEItemStack slotItem;
public final IAEItemStack slotItem;
final public IAEItemStack[] pattern = new IAEItemStack[9];
public final IAEItemStack[] pattern = new IAEItemStack[9];
final public boolean shift;
public final boolean shift;
// automatic.
public PacketPatternSlot( ByteBuf stream ) throws IOException
@@ -45,7 +45,7 @@ import appeng.util.Platform;
public class PacketTransitionEffect extends AppEngPacket
{
final public boolean mode;
public final boolean mode;
final double x;
final double y;
final double z;
@@ -59,8 +59,8 @@ import appeng.helpers.IMouseWheelItem;
public class PacketValueConfig extends AppEngPacket
{
final public String Name;
final public String Value;
public final String Name;
public final String Value;
// automatic.
public PacketValueConfig( ByteBuf stream ) throws IOException
@@ -49,7 +49,7 @@ public class CraftingTreeProcess
final ICraftingPatternDetails details;
final CraftingJob job;
final Map<CraftingTreeNode, Long> nodes = new HashMap<CraftingTreeNode, Long>();
final private int depth;
private final int depth;
public boolean possible = true;
World world;
long crafts = 0;
@@ -40,7 +40,7 @@ import appeng.helpers.Reflected;
import appeng.util.Platform;
final public class EntityChargedQuartz extends AEBaseEntityItem
public final class EntityChargedQuartz extends AEBaseEntityItem
{
int delay = 0;
@@ -25,7 +25,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
final public class EntityFloatingItem extends EntityItem
public final class EntityFloatingItem extends EntityItem
{
public static int ageStatic = 0;
@@ -37,7 +37,7 @@ import appeng.core.features.AEFeature;
import appeng.util.Platform;
final public class EntityGrowingCrystal extends EntityItem
public final class EntityGrowingCrystal extends EntityItem
{
private int progress_1000 = 0;
@@ -39,10 +39,10 @@ import appeng.helpers.Reflected;
import appeng.util.Platform;
final public class EntitySingularity extends AEBaseEntityItem
public final class EntitySingularity extends AEBaseEntityItem
{
static private int randTickSeed = 0;
private static int randTickSeed = 0;
@Reflected
public EntitySingularity( World w )
@@ -44,7 +44,7 @@ import appeng.helpers.Reflected;
import appeng.util.Platform;
final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData
public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData
{
@Reflected
public EntityTinyTNTPrimed( World w )
+1 -1
View File
@@ -87,7 +87,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
{
public static final ThreadLocal<Boolean> DISABLE_FACADE_OCCLUSION = new ThreadLocal<Boolean>();
private final static Cuboid6[] SIDE_TESTS = new Cuboid6[] {
private static final Cuboid6[] SIDE_TESTS = new Cuboid6[] {
new Cuboid6( 6.0 / 16.0, 0, 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0 ), // DOWN(0, -1, 0),
@@ -48,7 +48,7 @@ import appeng.util.Platform;
public class FMPPlacementHelper implements IPartHost
{
final private static CableBusStorage NULL_STORAGE = new NullStorage();
private static final CableBusStorage NULL_STORAGE = new NullStorage();
private boolean hasPart = false;
private TileMultipart myMP;
private CableBusPart myPart;
+3 -3
View File
@@ -33,9 +33,9 @@ public enum PartRegistry
{
QuartzTorchPart( "ae2_torch", BlockQuartzTorch.class, QuartzTorchPart.class ), CableBusPart( "ae2_cablebus", BlockCableBus.class, CableBusPart.class );
final private String name;
final private Class<? extends AEBaseBlock> blk;
final private Class<? extends TMultiPart> part;
private final String name;
private final Class<? extends AEBaseBlock> blk;
private final Class<? extends TMultiPart> part;
PartRegistry( String name, Class<? extends AEBaseBlock> blk, Class<? extends TMultiPart> part )
{
@@ -100,7 +100,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{
static final Set<Block> badBlocks = new HashSet<Block>();
static private boolean interfaceRequest = false;
private static boolean interfaceRequest = false;
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
final IAEItemStack[] requireWork = new IAEItemStack[] { null, null, null, null, null, null, null, null };
final MultiCraftingTracker craftingTracker;
@@ -178,7 +178,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
}
@Override
synchronized public boolean isValidItemForSlot( int slotIndex, ItemStack i, World w )
public synchronized boolean isValidItemForSlot( int slotIndex, ItemStack i, World w )
{
if( !this.isCrafting )
{
+4 -4
View File
@@ -30,10 +30,10 @@ import appeng.api.util.AEColor;
public class Splotch
{
final public ForgeDirection side;
final public boolean lumen;
final public AEColor color;
final private int pos;
public final ForgeDirection side;
public final boolean lumen;
public final AEColor color;
private final int pos;
public Splotch( AEColor col, boolean lit, ForgeDirection side, Vec3 Pos )
{
@@ -48,10 +48,11 @@ import appeng.api.storage.data.IItemList;
import appeng.api.util.AECableType;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.IConfigManager;
import appeng.container.interfaces.IInventorySlotAware;
import appeng.tile.networking.TileWireless;
public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, IInventorySlotAware
{
public final ItemStack effectiveItem;
@@ -64,6 +65,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
IWirelessAccessPoint myWap;
double sqRange = Double.MAX_VALUE;
double myRange = Double.MAX_VALUE;
private final int inventorySlot;
public WirelessTerminalGuiObject( IWirelessTermHandler wh, ItemStack is, EntityPlayer ep, World w, int x, int y, int z )
{
@@ -71,6 +73,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
this.effectiveItem = is;
this.myPlayer = ep;
this.wth = wh;
this.inventorySlot = x;
ILocatable obj = null;
@@ -332,4 +335,11 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
}
return false;
}
@Override
public int getInventorySlot()
{
return inventorySlot;
}
}
@@ -29,7 +29,7 @@ import net.minecraft.world.World;
import appeng.entity.EntityTinyTNTPrimed;
final public class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem
public final class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem
{
@Override
@@ -31,7 +31,7 @@ import net.minecraft.world.WorldServer;
import appeng.util.Platform;
final public class DispenserBlockTool extends BehaviorDefaultDispenseItem
public final class DispenserBlockTool extends BehaviorDefaultDispenseItem
{
@Override
@@ -34,7 +34,7 @@ import appeng.items.tools.powered.ToolMassCannon;
import appeng.util.Platform;
final public class DispenserMatterCannon extends BehaviorDefaultDispenseItem
public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem
{
@Override
+6 -6
View File
@@ -64,11 +64,11 @@ public class TickHandler
public static final TickHandler INSTANCE = new TickHandler();
final Queue<Callable> serverQueue = new LinkedList<Callable>();
final Multimap<World, CraftingJob> craftingJobs = LinkedListMultimap.create();
final private WeakHashMap<World, Queue<Callable>> callQueue = new WeakHashMap<World, Queue<Callable>>();
final private HandlerRep server = new HandlerRep();
final private HandlerRep client = new HandlerRep();
final private HashMap<Integer, PlayerColor> cliPlayerColors = new HashMap<Integer, PlayerColor>();
final private HashMap<Integer, PlayerColor> srvPlayerColors = new HashMap<Integer, PlayerColor>();
private final WeakHashMap<World, Queue<Callable>> callQueue = new WeakHashMap<World, Queue<Callable>>();
private final HandlerRep server = new HandlerRep();
private final HandlerRep client = new HandlerRep();
private final HashMap<Integer, PlayerColor> cliPlayerColors = new HashMap<Integer, PlayerColor>();
private final HashMap<Integer, PlayerColor> srvPlayerColors = new HashMap<Integer, PlayerColor>();
CableRenderMode crm = CableRenderMode.Standard;
public HashMap<Integer, PlayerColor> getPlayerColors()
@@ -288,7 +288,7 @@ public class TickHandler
}
static public class PlayerColor
public static class PlayerColor
{
public final AEColor myColor;
@@ -36,15 +36,21 @@ import codechicken.nei.api.IOverlayHandler;
import codechicken.nei.api.IRecipeOverlayRenderer;
import codechicken.nei.recipe.TemplateRecipeHandler;
import appeng.api.AEApi;
import appeng.api.features.IInscriberRecipe;
import appeng.client.gui.implementations.GuiInscriber;
import appeng.core.localization.GuiText;
import appeng.recipes.handlers.Inscribe;
import appeng.recipes.handlers.Inscribe.InscriberRecipe;
import static codechicken.lib.gui.GuiDraw.changeTexture;
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
{
@@ -59,7 +65,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
{
if( ( outputId.equals( "inscriber" ) ) && ( this.getClass() == NEIInscriberRecipeHandler.class ) )
{
for( InscriberRecipe recipe : Inscribe.RECIPES )
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
cachedRecipe.computeVisuals();
@@ -75,9 +81,9 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
@Override
public void loadCraftingRecipes( ItemStack result )
{
for( InscriberRecipe recipe : Inscribe.RECIPES )
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( NEIServerUtils.areStacksSameTypeCrafting( recipe.output, result ) )
if( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
cachedRecipe.computeVisuals();
@@ -89,7 +95,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
@Override
public void loadUsageRecipes( ItemStack ingredient )
{
for( InscriberRecipe recipe : Inscribe.RECIPES )
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
@@ -162,19 +168,22 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public final ArrayList<PositionedStack> ingredients;
public final PositionedStack result;
public CachedInscriberRecipe( InscriberRecipe recipe )
public CachedInscriberRecipe( IInscriberRecipe recipe )
{
this.result = new PositionedStack( recipe.output, 108, 29 );
this.result = new PositionedStack( recipe.getOutput(), 108, 29 );
this.ingredients = new ArrayList<PositionedStack>();
if( recipe.plateA != null )
this.ingredients.add( new PositionedStack( recipe.plateA, 40, 5 ) );
for( ItemStack top : recipe.getTopOptional().asSet() )
{
this.ingredients.add( new PositionedStack( top, 40, 5 ) );
}
if( recipe.imprintable != null )
this.ingredients.add( new PositionedStack( recipe.imprintable, 40 + 18, 28 ) );
this.ingredients.add( new PositionedStack( recipe.getInputs(), 40 + 18, 28 ) );
if( recipe.plateB != null )
this.ingredients.add( new PositionedStack( recipe.plateB, 40, 51 ) );
for( ItemStack bot : recipe.getBottomOptional().asSet() )
{
this.ingredients.add( new PositionedStack( bot, 40, 51 ) );
}
}
@Override
@@ -56,7 +56,7 @@ public class RB extends BaseModule implements IRB
private class RBWrapper implements appeng.api.util.IOrientable
{
final private IOrientable internal;
private final IOrientable internal;
public RBWrapper( IOrientable ww )
{
@@ -32,7 +32,6 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import appeng.api.parts.IPart;
import appeng.core.localization.GuiText;
import appeng.core.localization.WailaText;
import appeng.parts.networking.PartCableSmart;
import appeng.parts.networking.PartDenseCable;
@@ -82,7 +81,8 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
final byte usedChannels = this.getUsedChannels( part, tag, this.cache );
final byte maxChannels = (byte) ( ( part instanceof PartDenseCable ) ? 32 : 8 );
currentToolTip.add( usedChannels + " " + GuiText.Of.getLocal() + ' ' + maxChannels + ' ' + WailaText.Channels.getLocal() );
final String formattedToolTip = String.format( WailaText.Channels.getLocal(), usedChannels, maxChannels );
currentToolTip.add( formattedToolTip );
}
return currentToolTip;
@@ -92,7 +92,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
final String formatCurrentPower = Platform.formatPowerLong( internalCurrentPower, false );
final String formatMaxPower = Platform.formatPowerLong( internalMaxPower, false );
currentToolTip.add( WailaText.Contains + ": " + formatCurrentPower + " / " + formatMaxPower );
currentToolTip.add( WailaText.Contains.getLocal() + ": " + formatCurrentPower + " / " + formatMaxPower );
}
}
@@ -35,23 +35,32 @@ import appeng.api.storage.MEMonitorHandler;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.IConfigManager;
import appeng.container.interfaces.IInventorySlotAware;
import appeng.me.storage.CellInventory;
import appeng.util.ConfigManager;
import appeng.util.IConfigManagerHost;
import appeng.util.Platform;
public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implements IPortableCell
public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implements IPortableCell, IInventorySlotAware
{
private final ItemStack target;
private final IAEItemPowerStorage ips;
private final int inventorySlot;
public PortableCellViewer( ItemStack is )
public PortableCellViewer( ItemStack is, int slot )
{
super( CellInventory.getCell( is, null ) );
this.ips = (IAEItemPowerStorage) is.getItem();
this.target = is;
this.inventorySlot = slot;
}
@Override
public int getInventorySlot()
{
return inventorySlot;
}
@Override
@@ -301,19 +301,22 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
if( stack.getItem() == this )
{
PartType pt = this.getTypeByStack( stack );
switch( pt )
if ( pt != null )
{
case ImportBus:
importBus = true;
if( u == pt )
group = true;
break;
case ExportBus:
exportBus = true;
if( u == pt )
group = true;
break;
default:
switch( pt )
{
case ImportBus:
importBus = true;
if( u == pt )
group = true;
break;
case ExportBus:
exportBus = true;
if( u == pt )
group = true;
break;
default:
}
}
}
}
@@ -82,7 +82,7 @@ import appeng.util.item.AEItemStack;
public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem
{
final static Map<Integer, AEColor> ORE_TO_COLOR = new HashMap<Integer, AEColor>();
static final Map<Integer, AEColor> ORE_TO_COLOR = new HashMap<Integer, AEColor>();
static
{
@@ -186,6 +186,6 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
@Override
public IGuiItemObject getGuiObject( ItemStack is, World w, int x, int y, int z )
{
return new PortableCellViewer( is );
return new PortableCellViewer( is, x );
}
}
@@ -116,7 +116,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
{
NBTTagCompound data = Platform.openNbtData( is );
double currentStorage = data.getDouble( this.POWER_NBT_KEY );
double currentStorage = data.getDouble( POWER_NBT_KEY );
double maxStorage = this.getAEMaxPower( is );
switch( op )
@@ -126,19 +126,19 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
if( currentStorage > maxStorage )
{
double diff = currentStorage - maxStorage;
data.setDouble( this.POWER_NBT_KEY, maxStorage );
data.setDouble( POWER_NBT_KEY, maxStorage );
return diff;
}
data.setDouble( this.POWER_NBT_KEY, currentStorage );
data.setDouble( POWER_NBT_KEY, currentStorage );
return 0;
case EXTRACT:
if( currentStorage > adjustment )
{
currentStorage -= adjustment;
data.setDouble( this.POWER_NBT_KEY, currentStorage );
data.setDouble( POWER_NBT_KEY, currentStorage );
return adjustment;
}
data.setDouble( this.POWER_NBT_KEY, 0 );
data.setDouble( POWER_NBT_KEY, 0 );
return currentStorage;
default:
break;
@@ -30,7 +30,7 @@ import appeng.api.util.IReadOnlyCollection;
public class GridNodeCollection implements IReadOnlyCollection<IGridNode>
{
final private Map<Class<? extends IGridHost>, MachineSet> machines;
private final Map<Class<? extends IGridHost>, MachineSet> machines;
public GridNodeCollection( Map<Class<? extends IGridHost>, MachineSet> machines )
{
+1 -1
View File
@@ -25,7 +25,7 @@ import appeng.api.networking.IGridVisitor;
public class GridPropagator implements IGridVisitor
{
final private Grid g;
private final Grid g;
public GridPropagator( Grid g )
{
+1 -1
View File
@@ -89,7 +89,7 @@ import appeng.util.ItemSorters;
public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler<IAEStack>
{
final public static ExecutorService CRAFTING_POOL;
public static final ExecutorService CRAFTING_POOL;
static final Comparator<ICraftingPatternDetails> COMPARATOR = new Comparator<ICraftingPatternDetails>()
{
@Override
+3 -3
View File
@@ -58,14 +58,14 @@ import appeng.me.energy.EnergyWatcher;
public class EnergyGridCache implements IEnergyGrid
{
final public TreeSet<EnergyThreshold> interests = new TreeSet<EnergyThreshold>();
public final TreeSet<EnergyThreshold> interests = new TreeSet<EnergyThreshold>();
final double AvgLength = 40.0;
final Set<IAEPowerStorage> providers = new LinkedHashSet<IAEPowerStorage>();
final Set<IAEPowerStorage> requesters = new LinkedHashSet<IAEPowerStorage>();
final Multiset<IEnergyGridProvider> energyGridProviders = HashMultiset.create();
final IGrid myGrid;
final private HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<IGridNode, IEnergyWatcher>();
final private Set<IEnergyGrid> localSeen = new HashSet<IEnergyGrid>();
private final HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<IGridNode, IEnergyWatcher>();
private final Set<IEnergyGrid> localSeen = new HashSet<IEnergyGrid>();
/**
* estimated power available.
*/
+3 -3
View File
@@ -58,11 +58,11 @@ import appeng.me.storage.NetworkInventoryHandler;
public class GridStorageCache implements IStorageGrid
{
final public IGrid myGrid;
public final IGrid myGrid;
final HashSet<ICellProvider> activeCellProviders = new HashSet<ICellProvider>();
final HashSet<ICellProvider> inactiveCellProviders = new HashSet<ICellProvider>();
final private SetMultimap<IAEStack, ItemWatcher> interests = HashMultimap.create();
final public GenericInterestManager<ItemWatcher> interestManager = new GenericInterestManager<ItemWatcher>( this.interests );
private final SetMultimap<IAEStack, ItemWatcher> interests = HashMultimap.create();
public final GenericInterestManager<ItemWatcher> interestManager = new GenericInterestManager<ItemWatcher>( this.interests );
private final NetworkMonitor<IAEItemStack> itemMonitor = new NetworkMonitor<IAEItemStack>( this, StorageChannel.ITEMS );
private final NetworkMonitor<IAEFluidStack> fluidMonitor = new NetworkMonitor<IAEFluidStack>( this, StorageChannel.FLUIDS );
private final HashMap<IGridNode, IStackWatcher> watchers = new HashMap<IGridNode, IStackWatcher>();
+3 -3
View File
@@ -39,9 +39,9 @@ import appeng.me.storage.ItemWatcher;
public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
{
private final static Deque<NetworkMonitor<?>> DEPTH = new LinkedList<NetworkMonitor<?>>();
final private GridStorageCache myGridCache;
final private StorageChannel myChannel;
private static final Deque<NetworkMonitor<?>> DEPTH = new LinkedList<NetworkMonitor<?>>();
private final GridStorageCache myGridCache;
private final StorageChannel myChannel;
boolean sendEvent = false;
public NetworkMonitor( GridStorageCache cache, StorageChannel chan )
+3 -3
View File
@@ -43,9 +43,9 @@ public class P2PCache implements IGridCache
{
final IGrid myGrid;
final private HashMap<Long, PartP2PTunnel> inputs = new HashMap<Long, PartP2PTunnel>();
final private Multimap<Long, PartP2PTunnel> outputs = LinkedHashMultimap.create();
final private TunnelCollection NullColl = new TunnelCollection<PartP2PTunnel>( null, null );
private final HashMap<Long, PartP2PTunnel> inputs = new HashMap<Long, PartP2PTunnel>();
private final Multimap<Long, PartP2PTunnel> outputs = LinkedHashMultimap.create();
private final TunnelCollection NullColl = new TunnelCollection<PartP2PTunnel>( null, null );
public P2PCache( IGrid g )
{
+2 -2
View File
@@ -43,8 +43,8 @@ public class SecurityCache implements ISecurityGrid
{
public final IGrid myGrid;
final private List<ISecurityProvider> securityProvider = new ArrayList<ISecurityProvider>();
final private HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms = new HashMap<Integer, EnumSet<SecurityPermissions>>();
private final List<ISecurityProvider> securityProvider = new ArrayList<ISecurityProvider>();
private final HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms = new HashMap<Integer, EnumSet<SecurityPermissions>>();
private long securityKey = -1;
public SecurityCache( IGrid g )
+2 -2
View File
@@ -29,8 +29,8 @@ import appeng.parts.p2p.PartP2PTunnelME;
public class Connections implements Callable
{
final public HashMap<IGridNode, TunnelConnection> connections = new HashMap<IGridNode, TunnelConnection>();
final private PartP2PTunnelME me;
public final HashMap<IGridNode, TunnelConnection> connections = new HashMap<IGridNode, TunnelConnection>();
private final PartP2PTunnelME me;
public boolean create = false;
public boolean destroy = false;
@@ -26,8 +26,8 @@ import appeng.parts.p2p.PartP2PTunnelME;
public class TunnelConnection
{
final public PartP2PTunnelME tunnel;
final public IGridConnection c;
public final PartP2PTunnelME tunnel;
public final IGridConnection c;
public TunnelConnection( PartP2PTunnelME t, IGridConnection con )
{
@@ -31,7 +31,7 @@ import appeng.util.Platform;
public abstract class MBCalculator
{
final private IAEMultiBlock target;
private final IAEMultiBlock target;
public MBCalculator( IAEMultiBlock t )
{
@@ -88,9 +88,9 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
final int[] usedOps = new int[3];
final Map<ICraftingPatternDetails, TaskProgress> tasks = new HashMap<ICraftingPatternDetails, TaskProgress>();
// INSTANCE sate
final private LinkedList<TileCraftingTile> tiles = new LinkedList<TileCraftingTile>();
final private LinkedList<TileCraftingTile> storage = new LinkedList<TileCraftingTile>();
final private LinkedList<TileCraftingMonitorTile> status = new LinkedList<TileCraftingMonitorTile>();
private final LinkedList<TileCraftingTile> tiles = new LinkedList<TileCraftingTile>();
private final LinkedList<TileCraftingTile> storage = new LinkedList<TileCraftingTile>();
private final LinkedList<TileCraftingMonitorTile> status = new LinkedList<TileCraftingMonitorTile>();
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object>();
public ICraftingLink myLastLink;
public String myName = "";

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