Compare commits

...

32 Commits

Author SHA1 Message Date
thatsIch db7296c0a1 Final classes with private constructor 2015-03-26 13:57:31 +01:00
thatsIch d1f2625262 Fixes #1099 Client crash on load up due to FML quirks 2015-03-26 13:57:08 +01:00
thatsIch b756a3f564 Final classes with private constructor 2015-03-26 12:25:44 +01:00
thatsIch dfa595ad2a Split logic of crash enhancement 2015-03-26 12:23:55 +01:00
thatsIch 0519f60cb0 protected member in final class 2015-03-26 12:15:57 +01:00
thatsIch 81c32d5181 Multiple variables in one declaration 2015-03-26 12:13:34 +01:00
thatsIch b609b08f98 Null checks before instanceof 2015-03-26 12:12:40 +01:00
thatsIch 50f141edbd Merge pull request #1094 from thatsIch/e-waila-api
Replace deobf version of Waila with an API stub
2015-03-26 11:34:36 +01:00
thatsIch 0542a58e4b Merge pull request #1086 from thatsIch/b-1061-mekanism
Fixes #1061 Recipes are properly registered with new Mekanism
2015-03-26 11:34:16 +01:00
thatsIch 58db877006 Replaced dynamic regular expressions with compiled pattern 2015-03-26 11:33:08 +01:00
thatsIch dff3364eb5 Replace not needed StringBuffer with String concatenation 2015-03-26 11:24:09 +01:00
thatsIch 88310cf04b Single character string concatentation 2015-03-26 11:23:22 +01:00
thatsIch d81eb1fe2d Unnecessary null check before instanceof 2015-03-26 11:22:31 +01:00
thatsIch d8f452b665 Unnecessary enum modifiers 2015-03-26 11:21:55 +01:00
thatsIch ec05bd994c Typos or word-improvements 2015-03-26 11:20:31 +01:00
thatsIch dff48c07c9 finalized 2015-03-26 11:14:34 +01:00
thatsIch 234d97b8ce Security issues: public static collections 2015-03-26 11:13:24 +01:00
thatsIch 9bf8b4388f Extract ++ and -- from expressions 2015-03-26 11:07:26 +01:00
thatsIch b31f2df58d Unnecessary semicolons 2015-03-26 11:03:46 +01:00
thatsIch 14df50dbf3 Unnecessary modifier in interfaces 2015-03-26 11:03:30 +01:00
thatsIch 6aeca93b85 Unnecessary modifier in enums 2015-03-26 11:03:15 +01:00
thatsIch 3143c871d0 this access 2015-03-26 11:01:57 +01:00
thatsIch 7f7c71a22e Unused imports 2015-03-26 10:58:13 +01:00
thatsIch 05f522580b Unnecessary Javadoc link point to containing class 2015-03-26 10:53:09 +01:00
thatsIch 926af89029 Missing @Override annotation 2015-03-26 10:50:34 +01:00
thatsIch f1248c4c33 Unused imports 2015-03-26 10:49:48 +01:00
thatsIch bd2ee1c5ea Assignment replaceable with operator assignment 2015-03-26 10:41:45 +01:00
thatsIch 8ef286b9d6 Replace call to simple setter from within class with inlined version 2015-03-26 10:27:07 +01:00
thatsIch 4b4693498d Replace call to simple getter from within class with inlined version 2015-03-26 10:23:59 +01:00
thatsIch e41d6a0289 Use StringBuilder for creating appended Strings in a loop 2015-03-26 10:15:33 +01:00
thatsIch c8d716d39f Replace deobf version of Waila with an API stub 2015-03-25 20:53:27 +01:00
thatsIch 33c1535bfa Fixes #1061 Most recipes are properly registered with new Mekanism. 2015-03-25 12:24:21 +01:00
167 changed files with 606 additions and 420 deletions
+2 -2
View File
@@ -18,7 +18,6 @@ fmp_version=1.1.1.324
code_chicken_lib_version=1.1.3.127
code_chicken_core_version=1.0.4.35
nei_version=1.0.4.90
waila_version=1.5.10_1.7.10
bc_version=6.4.3
#########################################################
@@ -33,9 +32,10 @@ api_craftguide_version=1
api_ic2_version=1
api_immibis_version=1
api_invtweaks_version=1
api_mekansim_version=1
api_mekansim_version=1.7.10-8.0.1.198
api_mfr_version=1
api_railcraft_version=1
api_rblocks_version=1
api_rf_version=2
api_rotarycraft_version=1
api_waila_version=1.5.10_1.7.10
+3 -3
View File
@@ -43,22 +43,22 @@ dependencies {
compile "codechicken:CodeChickenCore:${config.cb_minecraft_version}-${config.code_chicken_core_version}:dev"
compile "codechicken:NotEnoughItems:${config.cb_minecraft_version}-${config.nei_version}:dev"
compile "mcp.mobius.waila:Waila:${config.waila_version}:dev"
compile "com.mod-buildcraft:buildcraft:${config.bc_version}:dev"
// self compiled APIs
compile(group: 'api', name: 'betterstorage', version: "${config.api_betterstorage_version}")
compile(group: 'api', name: 'coloredlightscore', version: "${config.api_coloredlightscore_version}")
compile(group: 'api', name: 'craftguide', version: "${config.api_craftguide_version}")
compile(group: 'api', name: 'ic2', version: "${config.api_ic2_version}")
compile(group: 'api', name: 'immibis', version: "${config.api_immibis_version}")
compile(group: 'api', name: 'invtweaks', version: "${config.api_invtweaks_version}")
compile(group: 'api', name: 'mekansim', version: "${config.api_mekansim_version}")
compile(group: 'api', name: 'mekanism', version: "${config.api_mekansim_version}", classifier: 'api')
compile(group: 'api', name: 'mfr', version: "${config.api_mfr_version}")
compile(group: 'api', name: 'railcraft', version: "${config.api_railcraft_version}")
compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}")
compile(group: 'api', name: 'rf', version: "${config.api_rf_version}")
compile(group: 'api', name: 'rotarycraft', version: "${config.api_rotarycraft_version}")
compile "appeng:Waila:${config.api_waila_version}:api"
testCompile "junit:junit:4.11"
}
@@ -29,7 +29,7 @@ public enum AccessRestriction
private final int permissionBit;
private AccessRestriction(int v) {
AccessRestriction( int v ) {
this.permissionBit = v;
}
@@ -31,7 +31,7 @@ public enum FuzzyMode
final public float breakPoint;
final public float percentage;
private FuzzyMode(float p) {
FuzzyMode( float p ) {
this.percentage = p;
this.breakPoint = p / 100.0f;
}
@@ -32,7 +32,7 @@ public enum PowerUnits
RF("gui.appliedenergistics2.units.thermalexpansion"), // ThermalExpansion - Redstone Flux
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
private PowerUnits(String un) {
PowerUnits( String un ) {
this.unlocalizedName = un;
}
+1 -1
View File
@@ -62,7 +62,7 @@ public enum Settings
return this.values;
}
private Settings( EnumSet set )
Settings( EnumSet set )
{
if ( set == null || set.isEmpty() )
throw new RuntimeException( "Invalid configuration." );
+1 -1
View File
@@ -46,7 +46,7 @@ public enum Upgrades
public final int myTier;
public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
private Upgrades( int tier )
Upgrades( int tier )
{
this.myTier = tier;
}
@@ -36,42 +36,42 @@ public interface IGrinderEntry
*
* @return input that the grinder will accept.
*/
public ItemStack getInput();
ItemStack getInput();
/**
* lets you change the grinder recipe by changing its input.
*
* @param input input item
*/
public void setInput(ItemStack input);
void setInput( ItemStack input );
/**
* gets the current output
*
* @return output that the grinder will produce
*/
public ItemStack getOutput();
ItemStack getOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
public ItemStack getOptionalOutput();
ItemStack getOptionalOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
public ItemStack getSecondOptionalOutput();
ItemStack getSecondOptionalOutput();
/**
* allows you to change the output.
*
* @param output output item
*/
public void setOutput(ItemStack output);
void setOutput( ItemStack output );
/**
* stack, and 0.0-1.0 chance that it will be generated.
@@ -79,14 +79,14 @@ public interface IGrinderEntry
* @param output output item
* @param chance generation chance
*/
public void setOptionalOutput(ItemStack output, float chance);
void setOptionalOutput( ItemStack output, float chance );
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
* @return chance of optional output
*/
public float getOptionalChance();
float getOptionalChance();
/**
* stack, and 0.0-1.0 chance that it will be generated.
@@ -94,26 +94,26 @@ public interface IGrinderEntry
* @param output second optional output item
* @param chance second optional output chance
*/
public void setSecondOptionalOutput(ItemStack output, float chance);
void setSecondOptionalOutput( ItemStack output, float chance );
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
* @return second optional output chance
*/
public float getSecondOptionalChance();
float getSecondOptionalChance();
/**
* Energy cost, in turns.
*
* @return number of turns it takes to produce the output from the input.
*/
public int getEnergyCost();
int getEnergyCost();
/**
* Allows you to adjust the number of turns
*
* @param c number of turns to produce output.
*/
public void setEnergyCost(int c);
void setEnergyCost( int c );
}
@@ -23,10 +23,11 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
import java.util.List;
import net.minecraft.item.ItemStack;
/**
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
*/
@@ -38,7 +39,7 @@ public interface IGrinderRegistry
*
* @return currentlyRegisteredRecipes
*/
public List<IGrinderEntry> getRecipes();
List<IGrinderEntry> getRecipes();
/**
* add a new recipe the easy way, in &#8594; out, how many turns., duplicates will not be added.
@@ -47,7 +48,7 @@ public interface IGrinderRegistry
* @param out output
* @param turns amount of turns to turn the input into the output
*/
public void addRecipe(ItemStack in, ItemStack out, int turns);
void addRecipe( ItemStack in, ItemStack out, int turns );
/**
* add a new recipe with optional outputs, duplicates will not be added.
@@ -79,6 +80,6 @@ public interface IGrinderRegistry
* @param input input
* @return identified recipe or null
*/
public IGrinderEntry getRecipeForInput(ItemStack input);
IGrinderEntry getRecipeForInput( ItemStack input );
}
@@ -26,8 +26,8 @@ package appeng.api.features;
public interface IItemComparison
{
public boolean sameAsPrecise(IItemComparison comp);
boolean sameAsPrecise( IItemComparison comp );
public boolean sameAsFuzzy(IItemComparison comp);
boolean sameAsFuzzy( IItemComparison comp );
}
@@ -48,6 +48,6 @@ public interface IItemComparisonProvider
* @param stack item
* @return true, if getComparison will return a valid IItemComparison Object
*/
public boolean canHandle(ItemStack stack);
boolean canHandle( ItemStack stack );
}
@@ -23,7 +23,9 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
import appeng.api.config.TunnelType;
/**
@@ -41,7 +43,7 @@ public interface IP2PTunnelRegistry
* @param type
* - the type of tunnel
*/
public abstract void addNewAttunement(ItemStack trigger, TunnelType type);
void addNewAttunement( ItemStack trigger, TunnelType type );
/**
* returns null if no attunement can be found.
@@ -58,7 +58,7 @@ public interface IRecipeHandlerRegistry
/**
* @return a new recipe handler, which can be used to parse, and read recipe files.
*/
public IRecipeHandler createNewRecipehandler();
IRecipeHandler createNewRecipehandler();
/**
* resolve sub items by name.
@@ -45,6 +45,6 @@ public interface ISpecialComparisonRegistry
*
* @param prov comparison provider
*/
public void addComparisonProvider(IItemComparisonProvider prov);
void addComparisonProvider( IItemComparisonProvider prov );
}
@@ -29,16 +29,16 @@ import net.minecraft.world.WorldProvider;
public interface IWorldGen
{
public enum WorldGenType
enum WorldGenType
{
CertusQuartz, ChargedCertusQuartz, Meteorites
}
public void disableWorldGenForProviderID(WorldGenType type, Class<? extends WorldProvider> provider);
void disableWorldGenForProviderID( WorldGenType type, Class<? extends WorldProvider> provider );
public void enableWorldGenForDimension(WorldGenType type, int dimID);
void enableWorldGenForDimension( WorldGenType type, int dimID );
public void disableWorldGenForDimension(WorldGenType type, int dimID);
void disableWorldGenForDimension( WorldGenType type, int dimID );
boolean isWorldGenEnabled(WorldGenType type, World w);
@@ -28,5 +28,5 @@ import net.minecraft.item.ItemStack;
public interface IGuiItemObject
{
public ItemStack getItemStack();
ItemStack getItemStack();
}
@@ -23,7 +23,9 @@
package appeng.api.implementations.items;
import net.minecraft.item.ItemStack;
import appeng.api.config.AccessRestriction;
import appeng.api.networking.energy.IAEPowerStorage;
@@ -39,7 +41,7 @@ public interface IAEItemPowerStorage
*
* @return amount unable to be stored
*/
public double injectAEPower(ItemStack is, double amt);
double injectAEPower( ItemStack is, double amt );
/**
* Attempt to extract power from the device, it will extract what it can and
@@ -48,17 +50,17 @@ public interface IAEItemPowerStorage
* @param amt to be extracted power from device
* @return what it could extract
*/
public double extractAEPower(ItemStack is, double amt);
double extractAEPower( ItemStack is, double amt );
/**
* @return the current maximum power ( this can change :P )
*/
public double getAEMaxPower(ItemStack is);
double getAEMaxPower( ItemStack is );
/**
* @return the current AE Power Level, this may exceed getMEMaxPower()
*/
public double getAECurrentPower(ItemStack is);
double getAECurrentPower( ItemStack is );
/**
* Control the power flow by telling what the network can do, either add? or
@@ -66,6 +68,6 @@ public interface IAEItemPowerStorage
*
* @return access restriction of network
*/
public AccessRestriction getPowerFlow(ItemStack is);
AccessRestriction getPowerFlow( ItemStack is );
}
@@ -40,7 +40,7 @@ public interface IGrid
* @param iface face
* @return the IGridCache you requested.
*/
public <C extends IGridCache> C getCache(Class<? extends IGridCache> iface);
<C extends IGridCache> C getCache( Class<? extends IGridCache> iface );
/**
* Post an event into the network event bus.
@@ -49,7 +49,7 @@ public interface IGrid
* - event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEvent(MENetworkEvent ev);
MENetworkEvent postEvent( MENetworkEvent ev );
/**
* Post an event into the network event bus, but direct it at a single node.
@@ -58,7 +58,7 @@ public interface IGrid
* event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEventTo(IGridNode node, MENetworkEvent ev);
MENetworkEvent postEventTo( IGridNode node, MENetworkEvent ev );
/**
* get a list of the diversity of classes, you can use this to better detect which machines your interested in,
@@ -66,7 +66,7 @@ public interface IGrid
*
* @return IReadOnlyCollection of all available host types (Of Type IGridHost).
*/
public IReadOnlyCollection<Class<? extends IGridHost>> getMachinesClasses();
IReadOnlyCollection<Class<? extends IGridHost>> getMachinesClasses();
/**
* Get machines on the network.
@@ -74,7 +74,7 @@ public interface IGrid
* @param gridHostClass class of the grid host
* @return IMachineSet of all nodes belonging to hosts of specified class.
*/
public IMachineSet getMachines(Class<? extends IGridHost> gridHostClass);
IMachineSet getMachines( Class<? extends IGridHost> gridHostClass );
/**
* @return IReadOnlyCollection for all nodes on the network, node visitors are preferred.
@@ -84,11 +84,11 @@ public interface IGrid
/**
* @return true if the last node has been removed from the grid.
*/
public boolean isEmpty();
boolean isEmpty();
/**
* @return the node considered the pivot point of the grid.
*/
public IGridNode getPivot();
IGridNode getPivot();
}
@@ -23,13 +23,15 @@
package appeng.api.networking;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import java.util.EnumSet;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.EnumSet;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
/**
* An Implementation is required to create your node for IGridHost
@@ -85,7 +87,7 @@ public interface IGridBlock
* @param grid grid
* @param channelsInUse used channels
*/
public void setNetworkStatus(IGrid grid, int channelsInUse);
void setNetworkStatus( IGrid grid, int channelsInUse );
/**
* Determine which sides of the block can be connected too, only used when isWorldAccessible returns true, not used
@@ -108,5 +110,5 @@ public interface IGridBlock
*
* @return the render item stack to use to render this node, null is valid, and will not show this node.
*/
public ItemStack getMachineRepresentation();
ItemStack getMachineRepresentation();
}
@@ -32,6 +32,6 @@ public interface IGridConnectionVisitor extends IGridVisitor
* @param n
* the connection.
*/
public void visitConnection(IGridConnection n);
void visitConnection( IGridConnection n );
}
@@ -23,8 +23,10 @@
package appeng.api.networking;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.util.AECableType;
@@ -48,7 +50,7 @@ public interface IGridHost
* @return a new IGridNode, create these with
* AEApi.INSTANCE().createGridNode( MyIGridBlock )
*/
public IGridNode getGridNode(ForgeDirection dir);
IGridNode getGridNode( ForgeDirection dir );
/**
* Determines how cables render when they connect to this block. Priority is
@@ -56,11 +58,11 @@ public interface IGridHost
*
* @param dir direction
*/
public AECableType getCableConnectionType(ForgeDirection dir);
AECableType getCableConnectionType( ForgeDirection dir );
/**
* break this host, its violating security rules, just break your block, or part.
*/
public void securityBreak();
void securityBreak();
}
@@ -39,6 +39,6 @@ public interface IGridVisitor
*
* @return true to continue visiting nodes beyond this node.
*/
public boolean visitNode(IGridNode n);
boolean visitNode( IGridNode n );
}
@@ -32,6 +32,6 @@ public interface ICraftingCallback
* @param job
* - final job
*/
public void calculationComplete(ICraftingJob job);
void calculationComplete( ICraftingJob job );
}
@@ -40,17 +40,17 @@ public interface IAEPowerStorage extends IEnergySource
*
* @return amount of power which was unable to be stored
*/
public double injectAEPower(double amt, Actionable mode);
double injectAEPower( double amt, Actionable mode );
/**
* @return the current maximum power ( this can change :P )
*/
public double getAEMaxPower();
double getAEMaxPower();
/**
* @return the current AE Power Level, this may exceed getMEMaxPower()
*/
public double getAECurrentPower();
double getAECurrentPower();
/**
* Checked on network reset to see if your block can be used as a public power storage ( use getPowerFlow to control
@@ -58,13 +58,13 @@ public interface IAEPowerStorage extends IEnergySource
*
* @return true if it can be used as a public power storage
*/
public boolean isAEPublicPowerStorage();
boolean isAEPublicPowerStorage();
/**
* Control the power flow by telling what the network can do, either add? or subtract? or both!
*
* @return access restriction what the network can do
*/
public AccessRestriction getPowerFlow();
AccessRestriction getPowerFlow();
}
@@ -36,18 +36,18 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
/**
* @return the current calculated idle energy drain each tick, is used internally to drain power for each tick.
*/
public double getIdlePowerUsage();
double getIdlePowerUsage();
/**
* @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of
* extractPower.
*/
public double getAvgPowerUsage();
double getAvgPowerUsage();
/**
* @return the average energy injected into the system per tick, for the last 10 ticks.
*/
public double getAvgPowerInjection();
double getAvgPowerInjection();
/**
* AE maintains an idle draw of power separate from active power draw, it condenses this into a single operation
@@ -59,7 +59,7 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
*
* @return if the network is powered or not.
*/
public boolean isNetworkPowered();
boolean isNetworkPowered();
/**
* AE will accept any power, and store it, to maintain sanity please don't send more then 10,000 at a time.
@@ -78,14 +78,14 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
* should the action be simulated or performed?
* @return the amount of power that the network has OVER the limit.
*/
public double injectPower(double amt, Actionable mode);
double injectPower( double amt, Actionable mode );
/**
* this is should be considered an estimate, and not relied upon for real calculations.
*
* @return estimated available power.
*/
public double getStoredPower();
double getStoredPower();
/**
* this is should be considered an estimate, and not relied upon for real calculations.
@@ -100,6 +100,6 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
*
* @return Amount of power required to charge the grid, in AE.
*/
public double getEnergyDemand(double maxRequired);
double getEnergyDemand( double maxRequired );
}
@@ -36,16 +36,16 @@ public interface IEnergyGridProvider
/**
* internal use only
*/
public double extractAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
/**
* internal use only
*/
public double injectAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
/**
* internal use only
*/
public double getEnergyDemand(double d, Set<IEnergyGrid> seen);
double getEnergyDemand( double d, Set<IEnergyGrid> seen );
}
@@ -36,6 +36,6 @@ public interface IEnergySource
* @param mode should the action be simulated or performed?
* @return returns extracted power.
*/
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier);
double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier );
}
@@ -33,7 +33,7 @@ public enum CableRenderMode
public final boolean transparentFacades;
public final boolean opaqueFacades;
private CableRenderMode(boolean hideFacades) {
CableRenderMode( boolean hideFacades ) {
this.transparentFacades = hideFacades;
this.opaqueFacades = !hideFacades;
}
@@ -23,12 +23,13 @@
package appeng.api.recipes;
import java.util.List;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RecipeError;
import appeng.api.exceptions.RegistrationError;
import java.util.List;
public interface ICraftHandler
{
@@ -39,7 +40,7 @@ public interface ICraftHandler
* @param output parsed outputs
* @throws RecipeError
*/
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError;
void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError;
/**
* called when all recipes are parsed, and your required to register your recipe.
@@ -47,6 +48,6 @@ public interface ICraftHandler
* @throws RegistrationError
* @throws MissingIngredientError
*/
public void register() throws RegistrationError, MissingIngredientError;
void register() throws RegistrationError, MissingIngredientError;
}
@@ -23,7 +23,9 @@
package appeng.api.recipes;
import net.minecraft.item.ItemStack;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RegistrationError;
@@ -55,27 +57,27 @@ public interface IIngredient {
*
* @return true if this slot contains no ItemStack, this is passed as "_"
*/
public boolean isAir();
boolean isAir();
/**
* @return The Name Space of the item. Prefer getItemStack or getItemStackSet
*/
public String getNameSpace();
String getNameSpace();
/**
* @return The Name of the item. Prefer getItemStack or getItemStackSet
*/
public String getItemName();
String getItemName();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getDamageValue();
int getDamageValue();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getQty();
int getQty();
/**
* Bakes the lists in for faster runtime look-ups.
@@ -31,6 +31,6 @@ public interface ISubItemResolver
* @param fullName name of sub item
* @return either a ResolveResult, or a ResolverResultSet
*/
public Object resolveItemByName(String namespace, String fullName);
Object resolveItemByName( String namespace, String fullName );
}
@@ -40,7 +40,7 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
*
* @return the access
*/
public AccessRestriction getAccess();
AccessRestriction getAccess();
/**
* determine if a particular item is prioritized for this inventory handler, if it is, then it will be added to this
@@ -50,7 +50,7 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
* - item that might be added
* @return if its prioritized
*/
public boolean isPrioritized(StackType input);
boolean isPrioritized( StackType input );
/**
* determine if an item can be accepted and stored.
@@ -59,23 +59,23 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
* - item that might be added
* @return if the item can be added
*/
public boolean canAccept(StackType input);
boolean canAccept( StackType input );
/**
* determine what the priority of the inventory is.
*
* @return the priority, zero is default, positive and negative are supported.
*/
public int getPriority();
int getPriority();
/**
* pass back value for blinkCell.
*
* @return the slot index for the cell that this represents in the storage unit, the method on the
* {@link ICellContainer} will be called with this value, only trust the return value of this method if you
* are the implementer of the {@link IMEInventoryHandler}.
* are the implementer of this.
*/
public int getSlot();
int getSlot();
/**
* AE Uses a two pass placement system, the first pass checks contents and tries to find a place where the item
@@ -86,5 +86,5 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
* - pass number ( 1 or 2 )
* @return true, if this inventory is valid for this pass.
*/
public boolean validForPass(int i);
boolean validForPass( int i );
}
@@ -43,7 +43,7 @@ public enum StorageChannel
public final Class<? extends IAEStack> type;
private StorageChannel( Class<? extends IAEStack> t ) {
StorageChannel( Class<? extends IAEStack> t ) {
this.type = t;
}
@@ -54,7 +54,7 @@ public interface IAEFluidStack extends IAEStack<IAEFluidStack>
* @return the copy.
*/
@Override
public IAEFluidStack copy();
IAEFluidStack copy();
/**
* Combines two IAEItemStacks via addition.
@@ -44,7 +44,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
*
* @return new ItemStack
*/
public ItemStack getItemStack();
ItemStack getItemStack();
/**
* create a AE Item clone
@@ -52,7 +52,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
* @return the copy
*/
@Override
public IAEItemStack copy();
IAEItemStack copy();
/**
* is there NBT Data for this item?
@@ -23,7 +23,9 @@
package appeng.api.storage.data;
import net.minecraft.nbt.NBTTagCompound;
import appeng.api.features.IItemComparison;
/**
@@ -37,7 +39,7 @@ public interface IAETagCompound
/**
* @return a copy ( the copy will not be a IAETagCompound, it will be a NBTTagCompound )
*/
public NBTTagCompound getNBTTagCompoundCopy();
NBTTagCompound getNBTTagCompoundCopy();
/**
* compare to other NBTTagCompounds or IAETagCompounds
@@ -23,10 +23,11 @@
package appeng.api.storage.data;
import appeng.api.config.FuzzyMode;
import java.util.Collection;
import appeng.api.config.FuzzyMode;
/**
* Represents a list of items in AE.
*
@@ -42,7 +43,7 @@ public interface IItemContainer<StackType extends IAEStack>
*
* @param option added stack
*/
public void add(StackType option); // adds stack as is
void add( StackType option ); // adds stack as is
/**
* @param i compared item
@@ -55,11 +56,11 @@ public interface IItemContainer<StackType extends IAEStack>
* @param input compared item
* @return a list of relevant fuzzy matched stacks
*/
public Collection<StackType> findFuzzy(StackType input, FuzzyMode fuzzy);
Collection<StackType> findFuzzy( StackType input, FuzzyMode fuzzy );
/**
* @return true if there are no items in the list
*/
public boolean isEmpty();
boolean isEmpty();
}
@@ -41,14 +41,14 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
*
* @param option stacktype option
*/
public void addStorage(StackType option); // adds a stack as stored
void addStorage( StackType option ); // adds a stack as stored
/**
* add a stack to the list as craftable, this will merge the stack with an item already in the list if found.
*
* @param option stacktype option
*/
public void addCrafting(StackType option);
void addCrafting( StackType option );
/**
* add a stack to the list, stack size is used to add to requestable, this will merge the stack with an item already
@@ -56,7 +56,7 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
*
* @param option stacktype option
*/
public void addRequestable(StackType option); // adds a stack as requestable
void addRequestable( StackType option ); // adds a stack as requestable
/**
* @return the first item in the list
@@ -72,7 +72,7 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
* allows you to iterate the list.
*/
@Override
public Iterator<StackType> iterator();
Iterator<StackType> iterator();
/**
* resets stack sizes to 0.
@@ -56,7 +56,7 @@ public interface AEItemDefinition
ItemStack stack(int stackSize);
/**
* Compare {@link ItemStack} with this {@link AEItemDefinition}
* Compare {@link ItemStack} with this
*
* @param comparableItem compared item
* @return true if the item stack is a matching item.
@@ -23,10 +23,10 @@
package appeng.api.util;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Set;
import net.minecraft.nbt.NBTTagCompound;
/**
* Used to adjust settings on an object,
*
@@ -70,9 +70,9 @@ public interface IConfigManager
/**
* write all settings to the NBT Tag so they can be read later.
*
* @param dest to be written nbt tag
* @param destination to be written nbt tag
*/
void writeToNBT(NBTTagCompound dest);
void writeToNBT(NBTTagCompound destination);
/**
* Only works after settings have been registered
@@ -48,8 +48,14 @@ public class GuiCraftAmount extends AEBaseGui
GuiButton next;
GuiButton plus1, plus10, plus100, plus1000;
GuiButton minus1, minus10, minus100, minus1000;
GuiButton plus1;
GuiButton plus10;
GuiButton plus100;
GuiButton plus1000;
GuiButton minus1;
GuiButton minus10;
GuiButton minus100;
GuiButton minus1000;
GuiBridge OriginalGui;
@@ -25,14 +25,14 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi;
import appeng.api.config.SortDir;
import appeng.api.config.SortOrder;
@@ -309,7 +309,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
int lines = 0;
boolean active = false, scheduled = false;
boolean active = false;
boolean scheduled = false;
if ( stored != null && stored.getStackSize() > 0 )
{
@@ -328,10 +329,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if ( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
{
int bgcol = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
int startX = (x * (1 + sectionLength) + xo) * 2;
int startY = ((y * offY + yo) - 3) * 2;
drawRect( startX, startY, startX + (sectionLength * 2), startY + (offY * 2) - 2, bgcol);
drawRect( startX, startY, startX + (sectionLength * 2), startY + (offY * 2) - 2, bgColor);
}
int negY = ((lines - 1) * 5) / 2;
@@ -47,8 +47,14 @@ public class GuiLevelEmitter extends GuiUpgradeable
GuiNumberBox level;
GuiButton plus1, plus10, plus100, plus1000;
GuiButton minus1, minus10, minus100, minus1000;
GuiButton plus1;
GuiButton plus10;
GuiButton plus100;
GuiButton plus1000;
GuiButton minus1;
GuiButton minus10;
GuiButton minus100;
GuiButton minus1000;
GuiImgButton levelMode;
GuiImgButton craftingMode;
@@ -97,7 +97,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
GuiImgButton SortByBox;
GuiImgButton SortDirBox;
GuiImgButton searchBoxSettings, terminalStyleBox;
GuiImgButton searchBoxSettings;
GuiImgButton terminalStyleBox;
final boolean viewCell;
final ItemStack[] myCurrentViewCells = new ItemStack[5];
@@ -173,7 +173,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
int viewEnd = viewStart + 5 * 4;
String ToolTip = "";
String toolTip = "";
int toolPosX = 0;
int toolPosY = 0;
@@ -199,11 +199,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
if ( this.tooltip == z - viewStart )
{
ToolTip = Platform.getItemDisplayName( this.repo.getItem( z ) );
toolTip = Platform.getItemDisplayName( this.repo.getItem( z ) );
ToolTip = ToolTip + ( '\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize()));
toolTip += ( '\n' + GuiText.Installed.getLocal() + ": " + ( refStack.getStackSize() ) );
if ( refStack.getCountRequestable() > 0 )
ToolTip = ToolTip + ( '\n' + GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( refStack.getCountRequestable(), true ));
toolTip += ( '\n' + GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( refStack.getCountRequestable(), true ) );
toolPosX = x * sectionLength + xo + sectionLength - 8;
toolPosY = y * 18 + yo;
@@ -222,10 +222,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
}
if ( this.tooltip >= 0 && ToolTip.length() > 0 )
if ( this.tooltip >= 0 && toolTip.length() > 0 )
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
this.drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip );
this.drawTooltip( toolPosX, toolPosY + 10, 0, toolTip );
GL11.glPopAttrib();
}
@@ -51,8 +51,14 @@ public class GuiPriority extends AEBaseGui
GuiNumberBox priority;
GuiTabButton originalGuiBtn;
GuiButton plus1, plus10, plus100, plus1000;
GuiButton minus1, minus10, minus100, minus1000;
GuiButton plus1;
GuiButton plus10;
GuiButton plus100;
GuiButton plus1000;
GuiButton minus1;
GuiButton minus10;
GuiButton minus100;
GuiButton minus1000;
GuiBridge OriginalGui;
@@ -46,7 +46,11 @@ public class GuiSecurity extends GuiMEMonitorable
this.standardSize = this.xSize;
}
GuiToggleButton inject, extract, craft, build, security;
GuiToggleButton inject;
GuiToggleButton extract;
GuiToggleButton craft;
GuiToggleButton build;
GuiToggleButton security;
@Override
public void initGui()
@@ -54,6 +54,7 @@ import appeng.core.localization.ButtonToolTips;
public class GuiImgButton extends GuiButton implements ITooltip
{
private static final Pattern COMPILE = Pattern.compile( "%s" );
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
private static Map<EnumPair, ButtonAppearance> appearances;
private final Enum buttonSetting;
public boolean halfSize = false;
@@ -281,7 +282,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
if ( this.fillVar != null )
value = COMPILE.matcher( value ).replaceFirst( this.fillVar );
value = value.replace( "\\n", "\n" );
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
StringBuilder sb = new StringBuilder( value );
int i = sb.lastIndexOf( "\n" );
@@ -19,6 +19,8 @@
package appeng.client.gui.widgets;
import java.util.regex.Pattern;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
@@ -30,6 +32,7 @@ import appeng.client.texture.ExtraBlockTextures;
public class GuiToggleButton extends GuiButton implements ITooltip
{
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
private final int iconIdxOn;
private final int iconIdxOff;
@@ -94,7 +97,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
if ( value == null || value.isEmpty() )
value = this.displayHint;
value = value.replace( "\\n", "\n" );
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
StringBuilder sb = new StringBuilder( value );
int i = sb.lastIndexOf( "\n" );
@@ -39,7 +39,7 @@ public class SlotDisconnected extends AppEngSlot
@Override
public ItemStack getDisplayStack()
{
if ( Platform.isClient() )// && (which == PlaceableItemType.ENCODED_PATTERN) )
if ( Platform.isClient() )
{
ItemStack is = super.getStack();
if ( is != null && is.getItem() instanceof ItemEncodedPattern )
@@ -606,9 +606,15 @@ public class BaseBlockRender
{
Tessellator tess = Tessellator.instance;
double offsetX = 0.0, offsetY = 0.0, offsetZ = 0.0;
double layerAX = 0.0, layerAY = 0.0, layerAZ = 0.0;
double layerBX = 0.0, layerBY = 0.0, layerBZ = 0.0;
double offsetX = 0.0;
double offsetY = 0.0;
double offsetZ = 0.0;
double layerAX = 0.0;
double layerAY = 0.0;
double layerAZ = 0.0;
double layerBX = 0.0;
double layerBY = 0.0;
double layerBZ = 0.0;
boolean flip = false;
switch (orientation)
@@ -19,6 +19,7 @@
package appeng.client.render;
import java.util.HashMap;
import java.util.Map;
import org.lwjgl.opengl.GL11;
@@ -48,7 +49,7 @@ public class BusRenderer implements IItemRenderer
public static final BusRenderer INSTANCE = new BusRenderer();
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
public static final HashMap<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
private static final Map<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
public IPart getRenderer(ItemStack is, IPartItem c)
{
@@ -45,7 +45,9 @@ public class CableRenderHelper
private void setSide(ForgeDirection s)
{
ForgeDirection ax, ay, az;
ForgeDirection ax;
ForgeDirection ay;
ForgeDirection az;
switch (s)
{
@@ -205,7 +207,9 @@ public class CableRenderHelper
IPart part = cableBusContainer.getPart( s );
if ( part != null )
{
ForgeDirection ax, ay, az;
ForgeDirection ax;
ForgeDirection ay;
ForgeDirection az;
switch (s)
{
@@ -688,7 +688,8 @@ public class RenderBlocksWorkaround extends RenderBlocks
for (int k = -1; k <= 1; k++)
{
this.lightHashTmp[o++] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k );
this.lightHashTmp[o] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k );
o++;
}
return Arrays.hashCode( this.lightHashTmp );
@@ -35,7 +35,7 @@ import appeng.block.AEBaseBlock;
import appeng.core.AELog;
@SideOnly(Side.CLIENT)
public class WorldRender implements ISimpleBlockRenderingHandler
public final class WorldRender implements ISimpleBlockRenderingHandler
{
private final RenderBlocks renderer = new RenderBlocks();
@@ -91,11 +91,13 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
int spin = 0;
int max = 5;
while (walrus != cmt.getUp() && max-- > 0)
while (walrus != cmt.getUp() && max > 0)
{
max--;
spin++;
walrus = Platform.rotateAround( walrus, side );
}
max--;
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glTranslated( side.offsetX * 0.69, side.offsetY * 0.69, side.offsetZ * 0.69 );
@@ -118,7 +118,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
{
if ( cr.spin )
{
now = now % 100000;
now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
}
else
@@ -139,14 +139,14 @@ public class RenderBlockSkyCompass extends BaseBlockRender
}
else
{
now = now % 1000000;
now %= 1000000;
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
}
}
else
{
now = now % 100000;
now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
}
@@ -195,7 +195,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
{
if ( cr.spin )
{
now = now % 100000;
now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
}
else
@@ -204,7 +204,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
}
else
{
now = now % 1000000;
now %= 1000000;
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
}
@@ -68,9 +68,10 @@ public class VibrantFX extends EntityFX
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.particleScale *= 0.95;
if ( this.particleMaxAge-- <= 0 || this.particleScale < 0.1 )
if ( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
{
this.setDead();
}
this.particleMaxAge--;
}
}
@@ -101,7 +101,7 @@ public enum CableBusTextures
return this.name;
}
private CableBusTextures(String name) {
CableBusTextures( String name ) {
this.name = name;
}
@@ -111,7 +111,7 @@ public enum ExtraBlockTextures
return this.name;
}
private ExtraBlockTextures(String name) {
ExtraBlockTextures( String name ) {
this.name = name;
}
@@ -49,7 +49,7 @@ public enum ExtraItemTextures
return this.name;
}
private ExtraItemTextures(String name) {
ExtraItemTextures( String name ) {
this.name = name;
}
@@ -172,7 +172,8 @@ public abstract class AEBaseContainer extends Container
int page = 0;
for (byte[] packet : miniPackets)
{
PacketPartialItem ppi = new PacketPartialItem( page++, miniPackets.size(), packet );
PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
page++;
NetworkHandler.instance.sendToServer( ppi );
}
}
@@ -818,7 +819,7 @@ public abstract class AEBaseContainer extends Container
}
// get target item.
IAEItemStack slotItem = this.getTargetStack();
IAEItemStack slotItem = this.clientRequestedTargetItem;
switch (action)
{
@@ -28,7 +28,9 @@ public class ContainerOpenContext
{
public World w;
public int x, y, z;
public int x;
public int y;
public int z;
public ForgeDirection side;
final public boolean isItem;
@@ -223,7 +223,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
for (int w = 0; w < 7; w++)
for (int z = 0; z < 9; z++)
this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset++, x + z * 18, y + w * 18 ) );
{
this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) );
offset++;
}
for (int zz = 0; zz < 3; zz++)
for (int z = 0; z < 8; z++)
@@ -114,7 +114,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
IBiometricCard bc = (IBiometricCard) a.getItem();
for (SecurityPermissions sp : bc.getPermissions( a ))
this.security = this.security | (1 << sp.ordinal());
this.security |= ( 1 << sp.ordinal() );
}
this.updatePowerStatus();
@@ -59,7 +59,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
this.upgradeable = te;
World w = null;
int xCoord = 0, yCoord = 0, zCoord = 0;
int xCoord = 0;
int yCoord = 0;
int zCoord = 0;
if ( te instanceof TileEntity )
{
@@ -126,7 +126,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
{
super.onPickupFromSlot( p, is );
// actually necessary to cleanup this case...
p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() );
p.openContainer.onCraftMatrixChanged( this.craftInv );
return request;
}
}
@@ -157,7 +157,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
// shouldn't be necessary...
p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() );
p.openContainer.onCraftMatrixChanged( this.craftInv );
return is;
}
@@ -178,10 +178,12 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
if ( Platform.isServer() )
{
// set new items onto the crafting table...
for ( int x = 0; x < this.getCraftingMatrix().getSizeInventory(); x++ )
for ( int x = 0; x < this.craftInv.getSizeInventory(); x++ )
{
if ( this.getCraftingMatrix().getStackInSlot( x ) == null )
this.getCraftingMatrix().setInventorySlotContents( x, set[x] );
if ( this.craftInv.getStackInSlot( x ) == null )
{
this.craftInv.setInventorySlotContents( x, set[x] );
}
else if ( set[x] != null )
{
// eek! put it back!
@@ -61,7 +61,7 @@ public class SlotRestrictedInput extends AppEngSlot
public final int IIcon;
private PlacableItemType(int o) {
PlacableItemType( int o ) {
this.IIcon = o;
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ import appeng.core.features.AEFeature;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
public class AELog
public final class AELog
{
public static final FMLRelaunchLog instance = FMLRelaunchLog.log;
+1 -1
View File
@@ -39,7 +39,7 @@ import appeng.me.GridConnection;
import appeng.me.GridNode;
import appeng.util.Platform;
public class Api implements IAppEngApi
public final class Api implements IAppEngApi
{
public static final Api INSTANCE = new Api();
+4 -3
View File
@@ -37,8 +37,9 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import com.google.common.base.Stopwatch;
import appeng.core.crash.CrashEnhancement;
import appeng.core.crash.CrashInfo;
import appeng.core.crash.IntegrationCrashEnhancement;
import appeng.core.crash.ModCrashEnhancement;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
@@ -79,7 +80,7 @@ public class AppEng
this.imcHandler = new IMCHandler();
FMLCommonHandler.instance().registerCrashCallable( new CrashEnhancement( CrashInfo.MOD_VERSION ) );
FMLCommonHandler.instance().registerCrashCallable( new ModCrashEnhancement( CrashInfo.MOD_VERSION ) );
}
public final File getConfigDirectory()
@@ -167,7 +168,7 @@ public class AppEng
Registration.INSTANCE.postInit( event );
IntegrationRegistry.INSTANCE.postInit();
FMLCommonHandler.instance().registerCrashCallable( new CrashEnhancement( CrashInfo.INTEGRATION ) );
FMLCommonHandler.instance().registerCrashCallable( new IntegrationCrashEnhancement() );
CommonHelper.proxy.postInit();
AEConfig.instance.save();
+7 -5
View File
@@ -32,9 +32,6 @@ import java.util.Map;
import java.util.UUID;
import java.util.WeakHashMap;
import com.google.common.base.Optional;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
@@ -44,6 +41,9 @@ import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import com.google.common.base.Optional;
import com.mojang.authlib.GameProfile;
import appeng.api.util.WorldCoord;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketNewStorageDimension;
@@ -402,7 +402,8 @@ public class WorldSettings extends Configuration
private long nextGridStorage()
{
long r = this.lastGridStorage++;
long r = this.lastGridStorage;
this.lastGridStorage++;
this.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) );
return r;
}
@@ -444,7 +445,8 @@ public class WorldSettings extends Configuration
private long nextPlayer()
{
long r = this.lastPlayer++;
long r = this.lastPlayer;
this.lastPlayer++;
this.get( "Counters", "lastPlayer", this.lastPlayer ).set( this.lastPlayer );
return r;
}
@@ -21,52 +21,27 @@ package appeng.core.crash;
import cpw.mods.fml.common.ICrashCallable;
import appeng.core.AEConfig;
import appeng.integration.IntegrationRegistry;
public class CrashEnhancement implements ICrashCallable
abstract class BaseCrashEnhancement implements ICrashCallable
{
private final String name;
private final String value;
private final String ModVersion = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion;
public CrashEnhancement( CrashInfo Output )
public BaseCrashEnhancement( String name, String value )
{
if ( Output == CrashInfo.MOD_VERSION )
{
this.name = "AE2 Version";
this.value = this.ModVersion;
}
else if ( Output == CrashInfo.INTEGRATION )
{
this.name = "AE2 Integration";
this.value = IntegrationRegistry.INSTANCE.getStatus();
}
else
{
this.name = "AE2_UNKNOWN";
this.value = "UNKNOWN_VALUE";
}
this.name = name;
this.value = value;
}
@Override
public String call() throws Exception
public final String call() throws Exception
{
return this.value;
}
@Override
public String getLabel()
public final String getLabel()
{
return this.name;
}
}
@@ -0,0 +1,13 @@
package appeng.core.crash;
import appeng.integration.IntegrationRegistry;
public class IntegrationCrashEnhancement extends BaseCrashEnhancement
{
public IntegrationCrashEnhancement()
{
super( "AE2 Integration", IntegrationRegistry.INSTANCE.getStatus() );
}
}
@@ -0,0 +1,19 @@
package appeng.core.crash;
import appeng.core.AEConfig;
public class ModCrashEnhancement extends BaseCrashEnhancement
{
private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion;
public ModCrashEnhancement( CrashInfo output )
{
super( "AE2 Version", MOD_VERSION );
}
}
@@ -78,13 +78,13 @@ public enum AEFeature
public final boolean isVisible;
public final boolean defaultValue;
private AEFeature(String cat) {
AEFeature( String cat ) {
this.category = cat;
this.isVisible = !this.name().equals( "Core" );
this.defaultValue = true;
}
private AEFeature(String cat, boolean defaultValue) {
AEFeature( String cat, boolean defaultValue ) {
this.category = cat;
this.isVisible = !this.name().equals( "Core" );
this.defaultValue = defaultValue;
@@ -20,6 +20,7 @@ package appeng.core.features;
import java.util.EnumSet;
import java.util.regex.Pattern;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
@@ -44,6 +45,10 @@ import appeng.util.Platform;
public class AEFeatureHandler implements AEItemDefinition
{
private static final Pattern PATTERN_ITEM_MULTI_PART = Pattern.compile( "ItemMultiPart", Pattern.LITERAL );
private static final Pattern PATTERN_ITEM_MULTI_MATERIAL = Pattern.compile( "ItemMultiMaterial", Pattern.LITERAL );
private static final Pattern PATTERN_QUARTZ = Pattern.compile( "Quartz", Pattern.LITERAL );
private final EnumSet<AEFeature> features;
private final String subName;
@@ -149,9 +154,9 @@ public class AEFeatureHandler implements AEItemDefinition
String name = o.getSimpleName();
if ( name.startsWith( "ItemMultiPart" ) )
name = name.replace( "ItemMultiPart", "ItemPart" );
name = PATTERN_ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
else if ( name.startsWith( "ItemMultiMaterial" ) )
name = name.replace( "ItemMultiMaterial", "ItemMaterial" );
name = PATTERN_ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
if ( subName != null )
{
@@ -161,9 +166,9 @@ public class AEFeatureHandler implements AEItemDefinition
return "ItemPart.P2PTunnel";
if ( subName.equals( "CertusQuartzTools" ) )
return name.replace( "Quartz", "CertusQuartz" );
return PATTERN_QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
if ( subName.equals( "NetherQuartzTools" ) )
return name.replace( "Quartz", "NetherQuartz" );
return PATTERN_QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
name += '.' + subName;
}
@@ -19,11 +19,17 @@
package appeng.core.features;
import java.util.regex.Pattern;
import com.google.common.base.Optional;
public class FeatureNameExtractor
{
private static final Pattern PATTERN_ITEM_MULTI_PART = Pattern.compile( "ItemMultiPart", Pattern.LITERAL );
private static final Pattern PATTERN_ITEM_MULTI_MATERIAL = Pattern.compile( "ItemMultiMaterial", Pattern.LITERAL );
private static final Pattern PATTERN_QUARTZ = Pattern.compile( "Quartz", Pattern.LITERAL );
private final Class<?> clazz;
private final Optional<String> subName;
@@ -39,11 +45,11 @@ public class FeatureNameExtractor
if ( name.startsWith( "ItemMultiPart" ) )
{
name = name.replace( "ItemMultiPart", "ItemPart" );
name = PATTERN_ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
}
else if ( name.startsWith( "ItemMultiMaterial" ) )
{
name = name.replace( "ItemMultiMaterial", "ItemMaterial" );
name = PATTERN_ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
}
if ( this.subName.isPresent() )
@@ -57,11 +63,11 @@ public class FeatureNameExtractor
}
else if ( subName.equals( "CertusQuartzTools" ) )
{
return name.replace( "Quartz", "CertusQuartz" );
return PATTERN_QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
}
else if ( subName.equals( "NetherQuartzTools" ) )
{
return name.replace( "Quartz", "NetherQuartz" );
return PATTERN_QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
}
name += '.' + subName;
@@ -25,7 +25,7 @@ import net.minecraft.world.WorldProvider;
import appeng.api.features.IWorldGen;
public class WorldGenRegistry implements IWorldGen
public final class WorldGenRegistry implements IWorldGen
{
private static class TypeSet
@@ -50,7 +50,7 @@ public enum TickRates
public int min;
public int max;
private TickRates(int min, int max) {
TickRates( int min, int max ) {
this.min = min;
this.max = max;
}
@@ -109,7 +109,8 @@ public enum Achievements
public final ItemStack stack;
public final AchievementType type;
private final int x, y;
private final int x;
private final int y;
private Achievement parent;
private Achievement stat;
@@ -130,7 +131,7 @@ public enum Achievements
return this.stat;
}
private Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type )
Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type )
{
this.stack = (which != null) ? which.stack( AEColor.Transparent, 1 ) : null;
this.type = type;
@@ -138,7 +139,7 @@ public enum Achievements
this.y = y;
}
private Achievements( int x, int y, AEItemDefinition which, AchievementType type )
Achievements( int x, int y, AEItemDefinition which, AchievementType type )
{
this.stack = (which != null) ? which.stack( 1 ) : null;
this.type = type;
@@ -146,7 +147,7 @@ public enum Achievements
this.y = y;
}
private Achievements( int x, int y, ItemStack which, AchievementType type )
Achievements( int x, int y, ItemStack which, AchievementType type )
{
this.stack = which;
this.type = type;
@@ -48,7 +48,7 @@ public class PlayerStatsRegistration
private final boolean isAchievementFeatureEnabled;
/**
* Constructs a {@link appeng.core.stats.PlayerStatsRegistration} with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
* Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
*
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
+1 -1
View File
@@ -47,7 +47,7 @@ public enum Stats
return this.stat;
}
private Stats() {
Stats() {
}
public void addToPlayer(EntityPlayer player, int howMany)
+13 -11
View File
@@ -18,9 +18,6 @@
package appeng.core.sync;
import static appeng.core.sync.GuiHostType.ITEM;
import static appeng.core.sync.GuiHostType.ITEM_OR_WORLD;
import static appeng.core.sync.GuiHostType.WORLD;
import java.lang.reflect.Constructor;
@@ -118,6 +115,10 @@ import appeng.tile.storage.TileIOPort;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
import static appeng.core.sync.GuiHostType.ITEM;
import static appeng.core.sync.GuiHostType.ITEM_OR_WORLD;
import static appeng.core.sync.GuiHostType.WORLD;
public enum GuiBridge implements IGuiHandler
{
GUI_Handler(),
@@ -195,7 +196,7 @@ public enum GuiBridge implements IGuiHandler
private GuiHostType type;
private SecurityPermissions requiredPermission;
private GuiBridge() {
GuiBridge() {
this.Tile = null;
this.Gui = null;
this.Container = null;
@@ -209,24 +210,25 @@ public enum GuiBridge implements IGuiHandler
{
if ( Platform.isClient() )
{
String start = this.Container.getName();
String GuiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
if ( start.equals( GuiClass ) )
final String start = this.Container.getName();
String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
if ( start.equals( guiClass ) )
throw new RuntimeException( "Unable to find gui class" );
this.Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), GuiClass );
this.Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), guiClass );
if ( this.Gui == null )
throw new RuntimeException( "Cannot Load class: " + GuiClass );
throw new RuntimeException( "Cannot Load class: " + guiClass );
}
}
private GuiBridge(Class _Container, SecurityPermissions requiredPermission) {
GuiBridge( Class _Container, SecurityPermissions requiredPermission ) {
this.requiredPermission = requiredPermission;
this.Container = _Container;
this.Tile = null;
this.getGui();
}
private GuiBridge(Class _Container, Class _Tile, GuiHostType type, SecurityPermissions requiredPermission) {
GuiBridge( Class _Container, Class _Tile, GuiHostType type, SecurityPermissions requiredPermission ) {
this.requiredPermission = requiredPermission;
this.Container = _Container;
this.type = type;
@@ -38,7 +38,9 @@ import appeng.util.item.AEItemStack;
public class PacketAssemblerAnimation extends AppEngPacket
{
final public int x, y, z;
final public int x;
final public int y;
final public int z;
final public byte rate;
final public IAEItemStack is;
@@ -35,7 +35,9 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
{
final public long attunement;
final public int cx, cz, cdy;
final public int cx;
final public int cz;
final public int cdy;
EntityPlayer talkBackTo;
@@ -32,7 +32,9 @@ public class PacketCompassResponse extends AppEngPacket
{
final public long attunement;
final public int cx, cz, cdy;
final public int cx;
final public int cz;
final public int cdy;
public CompassResult cr;
@@ -93,7 +93,7 @@ public class PacketNEIRecipe extends AppEngPacket
EntityPlayerMP pmp = ( EntityPlayerMP ) player;
Container con = pmp.openContainer;
if ( con != null && con instanceof IContainerCraftingPacket )
if ( con instanceof IContainerCraftingPacket )
{
IContainerCraftingPacket cct = ( IContainerCraftingPacket ) con;
IGridNode node = cct.getNetworkNode();
@@ -32,7 +32,10 @@ import appeng.parts.PartPlacement;
public class PacketPartPlacement extends AppEngPacket
{
int x, y, z, face;
int x;
int y;
int z;
int face;
float eyeHeight;
// automatic.
@@ -18,15 +18,16 @@
package appeng.crafting;
import java.util.HashMap;
import java.util.HashSet;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Stopwatch;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import com.google.common.base.Stopwatch;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.IGrid;
@@ -177,7 +178,7 @@ public class CraftingJob implements Runnable, ICraftingJob
AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
}
AELog.crafting( "------------- " + this.getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
AELog.crafting( "------------- " + this.bytes + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
// if ( mode == Actionable.MODULATE )
// craftingInventory.moveItemsToStorage( storage );
}
@@ -203,7 +204,7 @@ public class CraftingJob implements Runnable, ICraftingJob
AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
}
AELog.crafting( "------------- " + this.getByteTotal() + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
AELog.crafting( "------------- " + this.bytes + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
}
catch (CraftBranchFailure e1)
{
@@ -292,7 +293,7 @@ public class CraftingJob implements Runnable, ICraftingJob
synchronized (this.monitor)
{
if ( this.isDone() )
if ( this.done )
return false;
this.watch.reset();
@@ -324,7 +325,7 @@ public class CraftingJob implements Runnable, ICraftingJob
public void handlePausing() throws InterruptedException
{
if ( this.incTime++ > 100 )
if ( this.incTime > 100 )
{
this.incTime = 0;
@@ -353,6 +354,7 @@ public class CraftingJob implements Runnable, ICraftingJob
if ( Thread.interrupted() )
throw new InterruptedException();
}
this.incTime++;
}
private void log(String string)
@@ -41,7 +41,7 @@ public class CraftingLinkNexus
public boolean isDead(IGrid g, CraftingGridCache craftingGridCache)
{
if ( this.isCanceled() || this.isDone() )
if ( this.canceled || this.done )
return true;
if ( this.req == null || this.cpu == null )
+1 -1
View File
@@ -33,7 +33,7 @@ import appeng.tile.AEBaseTile;
public class TileItemGen extends AEBaseTile implements IInventory
{
public static final Queue<ItemStack> POSSIBLE_ITEMS = new LinkedList<ItemStack>();
private static final Queue<ItemStack> POSSIBLE_ITEMS = new LinkedList<ItemStack>();
public TileItemGen() {
if ( POSSIBLE_ITEMS.isEmpty() )
@@ -60,11 +60,12 @@ final public class EntityChargedQuartz extends AEBaseEntityItem
if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldFluix ) )
return;
if ( Platform.isClient() && this.delay++ > 30 && AEConfig.instance.enableEffects )
if ( Platform.isClient() && this.delay > 30 && AEConfig.instance.enableEffects )
{
CommonHelper.proxy.spawnEffect( EffectType.Lightning, this.worldObj, this.posX, this.posY, this.posZ, null );
this.delay = 0;
}
this.delay++;
int j = MathHelper.floor_double( this.posX );
int i = MathHelper.floor_double( this.posY );
@@ -48,8 +48,9 @@ final public class EntityFloatingItem extends EntityItem
if ( !this.isDead && this.parent.isDead )
this.setDead();
if ( this.superDeath++ > 100 )
if ( this.superDeath > 100 )
this.setDead();
this.superDeath++;
this.age = ageStatic;
}
+12 -7
View File
@@ -18,25 +18,30 @@
package appeng.entity;
import net.minecraft.entity.Entity;
public class EntityIds
{
public final class EntityIds
{
public static final int TINY_TNT = 10;
public static final int SINGULARITY = 11;
public static final int CHARGED_QUARTZ = 12;
public static final int GROWING_CRYSTAL = 13;
public static int get(Class<? extends Entity> droppedEntity)
private EntityIds()
{
if ( droppedEntity == EntityTinyTNTPrimed.class )
}
public static int get( Class<? extends Entity> droppedEntity )
{
if( droppedEntity == EntityTinyTNTPrimed.class )
return TINY_TNT;
if ( droppedEntity == EntitySingularity.class )
if( droppedEntity == EntitySingularity.class )
return SINGULARITY;
if ( droppedEntity == EntityChargedQuartz.class )
if( droppedEntity == EntityChargedQuartz.class )
return CHARGED_QUARTZ;
if ( droppedEntity == EntityGrowingCrystal.class )
if( droppedEntity == EntityGrowingCrystal.class )
return GROWING_CRYSTAL;
throw new RuntimeException( "Missing entity id: " + droppedEntity.getName() );
@@ -118,7 +118,8 @@ final public class EntitySingularity extends AEBaseEntityItem
ItemStack Output = AEApi.instance().materials().materialQESingularity.stack( 2 );
NBTTagCompound cmp = Platform.openNbtData( Output );
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed++ ) % 100 );
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
randTickSeed++;
item.stackSize--;
this.worldObj.spawnEntityInWorld( new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, Output ) );
@@ -91,7 +91,7 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
this.setDead();
}
if ( this.fuse-- <= 0 )
if ( this.fuse <= 0 )
{
this.setDead();
@@ -104,6 +104,7 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
{
this.worldObj.spawnParticle( "smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D );
}
this.fuse--;
}
// override :P
+4 -2
View File
@@ -40,7 +40,7 @@ public enum PartRegistry
return this.name;
}
private PartRegistry(String name, Class<? extends AEBaseBlock> blk, Class<? extends TMultiPart> part) {
PartRegistry( String name, Class<? extends AEBaseBlock> blk, Class<? extends TMultiPart> part ) {
this.name = name;
this.blk = blk;
this.part = part;
@@ -67,7 +67,9 @@ public enum PartRegistry
for (PartRegistry pr : values())
{
if ( pr.equals( c ) )
return pr.getName();
{
return pr.name;
}
}
throw new RuntimeException( "Invalid PartName" );
}
@@ -313,7 +313,8 @@ public class MeteoritePlacer
int verticalBits = 0;
final int cx, cz;
final int cx;
final int cz;
public ChunkOnly(World w, int cx, int cz) {
super( w );
@@ -657,7 +658,7 @@ public class MeteoritePlacer
{
this.put( w, x, y, z, this.skychest );
TileEntity te = w.getTileEntity( x, y, z );
if ( te != null && te instanceof IInventory )
if ( te instanceof IInventory )
{
InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, ForgeDirection.UP );
@@ -232,12 +232,18 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
int offset = 0;
this.condensedInputs = new IAEItemStack[tmpInputs.size()];
for (IAEItemStack io : tmpInputs.values())
this.condensedInputs[offset++] = io;
{
this.condensedInputs[offset] = io;
offset++;
}
offset = 0;
this.condensedOutputs = new IAEItemStack[tmpOutputs.size()];
for (IAEItemStack io : tmpOutputs.values())
this.condensedOutputs[offset++] = io;
{
this.condensedOutputs[offset] = io;
offset++;
}
}
@Override

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