Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3dd81433ac | |||
| 369a82889c | |||
| 22b965e15a | |||
| 0b86887962 | |||
| db7296c0a1 | |||
| d1f2625262 | |||
| b756a3f564 | |||
| dfa595ad2a | |||
| 0519f60cb0 | |||
| 81c32d5181 | |||
| b609b08f98 | |||
| 50f141edbd | |||
| 0542a58e4b | |||
| 58db877006 | |||
| dff3364eb5 | |||
| 88310cf04b | |||
| d81eb1fe2d | |||
| d8f452b665 | |||
| ec05bd994c | |||
| dff48c07c9 | |||
| 234d97b8ce | |||
| 9bf8b4388f | |||
| b31f2df58d | |||
| 14df50dbf3 | |||
| 6aeca93b85 | |||
| 3143c871d0 | |||
| 7f7c71a22e | |||
| 05f522580b | |||
| 926af89029 | |||
| f1248c4c33 | |||
| bd2ee1c5ea | |||
| 8ef286b9d6 | |||
| 4b4693498d | |||
| e41d6a0289 | |||
| c8d716d39f | |||
| 33c1535bfa | |||
| 1067d30264 | |||
| 96145e75f4 | |||
| 2ba6dad3b2 | |||
| a870393edb | |||
| d04bc2fb3c | |||
| 9d52e85afa | |||
| 3745e6ce8d | |||
| a4c38263d1 | |||
| c1a7a35192 | |||
| eb98ec891b | |||
| 69a5507f96 | |||
| a1f43ff51a | |||
| da91585d69 | |||
| f138a68f3e | |||
| 30191eb5ba | |||
| 4552394f6e | |||
| 9c3d3db3fb | |||
| 9c1c9056f1 | |||
| b5582688a3 | |||
| 34597a4e21 | |||
| e0b32d2641 | |||
| 6baf952904 | |||
| f132ae3678 | |||
| 720b38442e | |||
| 136f5d7314 | |||
| a83e4b7c3d | |||
| 1bb0109c45 | |||
| 4744dfab78 | |||
| 7dedd4700f | |||
| 95fb894ba3 | |||
| 621ddc5535 | |||
| ece09a956b | |||
| db5493f60b | |||
| f0482dd391 | |||
| c53b3b5dfc | |||
| ad16550a86 | |||
| 99e4928542 | |||
| 43995a4b32 | |||
| 53f448e578 |
@@ -1,6 +1,6 @@
|
||||
# Applied Energistics 2
|
||||
|
||||
## Table of Content
|
||||
## Table of Contents
|
||||
|
||||
* [About](#about)
|
||||
* [Contacts](#contacts)
|
||||
|
||||
@@ -79,6 +79,7 @@ jar {
|
||||
minecraft {
|
||||
version = config.minecraft_version + "-" + config.forge_version
|
||||
|
||||
replaceIn "AEConfig.java"
|
||||
replace "@version@", project.version
|
||||
replace "@aechannel@", config.aechannel
|
||||
|
||||
|
||||
+6
-6
@@ -14,12 +14,11 @@ forge_version=10.13.2.1291
|
||||
# APIs used for development #
|
||||
#########################################################
|
||||
cb_minecraft_version=1.7.10
|
||||
fmp_version=1.1.1.321
|
||||
code_chicken_lib_version=1.1.1.110
|
||||
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.9_1.7.10
|
||||
bc_version=6.4.2
|
||||
bc_version=6.4.3
|
||||
|
||||
#########################################################
|
||||
# API Stubs #
|
||||
@@ -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_rotarycraft_version=V5c
|
||||
api_waila_version=1.5.10_1.7.10
|
||||
@@ -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"
|
||||
compile "appeng:RotaryCraft:${config.api_rotarycraft_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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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." );
|
||||
|
||||
@@ -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 → 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 );
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
||||
* @param src action source
|
||||
* @return returns the number of items not added.
|
||||
*/
|
||||
public StackType injectItems(StackType input, Actionable type, BaseActionSource src);
|
||||
StackType injectItems( StackType input, Actionable type, BaseActionSource src );
|
||||
|
||||
/**
|
||||
* Extract the specified item from the ME Inventory
|
||||
@@ -60,7 +60,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
||||
* simulate, or perform action?
|
||||
* @return returns the number of items extracted, null
|
||||
*/
|
||||
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src);
|
||||
StackType extractItems( StackType request, Actionable mode, BaseActionSource src );
|
||||
|
||||
/**
|
||||
* request a full report of all available items, storage.
|
||||
@@ -69,11 +69,11 @@ public interface IMEInventory<StackType extends IAEStack>
|
||||
* the IItemList the results will be written too
|
||||
* @return returns same list that was passed in, is passed out
|
||||
*/
|
||||
public IItemList<StackType> getAvailableItems(IItemList<StackType> out);
|
||||
IItemList<StackType> getAvailableItems( IItemList<StackType> out );
|
||||
|
||||
/**
|
||||
* @return the type of channel your handler should be part of
|
||||
*/
|
||||
public StorageChannel getChannel();
|
||||
StorageChannel getChannel();
|
||||
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ import appeng.api.storage.data.IItemList;
|
||||
public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>, IBaseMonitor<T>
|
||||
{
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
/**
|
||||
* This method is discouraged when accessing data via a IMEMonitor
|
||||
*/
|
||||
public IItemList<T> getAvailableItems(IItemList out);
|
||||
@Override
|
||||
@Deprecated
|
||||
IItemList<T> getAvailableItems( IItemList out );
|
||||
|
||||
/**
|
||||
* Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -70,8 +70,8 @@ import appeng.parts.NullCableBusContainer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.networking.TileCableBusTESR;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
import appeng.transformer.annotations.integration.Method;
|
||||
import appeng.transformer.annotations.Integration.Interface;
|
||||
import appeng.transformer.annotations.Integration.Method;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -163,10 +164,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
|
||||
{
|
||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
||||
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
|
||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,10 +87,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
|
||||
{
|
||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
||||
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
|
||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -33,21 +33,47 @@ import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ContainerIOPort extends ContainerUpgradeable
|
||||
{
|
||||
|
||||
final TileIOPort ioPort;
|
||||
|
||||
@GuiSync(2)
|
||||
@GuiSync( 2 )
|
||||
public FullnessMode fMode = FullnessMode.EMPTY;
|
||||
@GuiSync(3)
|
||||
@GuiSync( 3 )
|
||||
public OperationMode opMode = OperationMode.EMPTY;
|
||||
|
||||
public ContainerIOPort(InventoryPlayer ip, TileIOPort te) {
|
||||
public ContainerIOPort( InventoryPlayer ip, TileIOPort te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.ioPort = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupConfig()
|
||||
{
|
||||
int offX = 19;
|
||||
int offY = 17;
|
||||
|
||||
IInventory cells = this.upgradeable.getInventoryByName( "cells" );
|
||||
|
||||
for ( int y = 0; y < 3; y++ )
|
||||
for ( int x = 0; x < 2; x++ )
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this.invPlayer ) );
|
||||
|
||||
offX = 122;
|
||||
offY = 17;
|
||||
for ( int y = 0; y < 3; y++ )
|
||||
for ( int x = 0; x < 2; x++ )
|
||||
this.addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) );
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHeight()
|
||||
{
|
||||
@@ -66,30 +92,6 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupConfig()
|
||||
{
|
||||
int offX = 19;
|
||||
int offY = 17;
|
||||
|
||||
IInventory cells = this.upgradeable.getInventoryByName( "cells" );
|
||||
|
||||
for (int y = 0; y < 3; y++)
|
||||
for (int x = 0; x < 2; x++)
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this.invPlayer ) );
|
||||
|
||||
offX = 122;
|
||||
offY = 17;
|
||||
for (int y = 0; y < 3; y++)
|
||||
for (int x = 0; x < 2; x++)
|
||||
this.addSlotToContainer( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) );
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() );
|
||||
this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() );
|
||||
this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
@@ -104,5 +106,4 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
|
||||
this.standardDetectAndSendChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,9 +55,6 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
public static final double TUNNEL_POWER_LOSS = 0.05;
|
||||
|
||||
public String latestVersion = VERSION;
|
||||
public long latestTimeStamp = 0;
|
||||
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String CHANNEL = "@aechannel@";
|
||||
|
||||
@@ -128,7 +125,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
// AE
|
||||
"CertusQuartz", "Wheat", "Fluix",
|
||||
// Other Mod Ores
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium" };
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium", "Zinc" };
|
||||
|
||||
public double oreDoublePercentage = 90.0;
|
||||
|
||||
@@ -149,7 +146,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
public boolean disableColoredCableRecipesInNEI = true;
|
||||
|
||||
public boolean updatable = false;
|
||||
final private File myPath;
|
||||
final private File configFile;
|
||||
|
||||
public double meteoriteClusterChance = 0.1;
|
||||
public double meteoriteSpawnChance = 0.3;
|
||||
@@ -224,22 +221,20 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
public String getFilePath()
|
||||
{
|
||||
return this.myPath.toString();
|
||||
return this.configFile.toString();
|
||||
}
|
||||
|
||||
public AEConfig(String path) {
|
||||
super( new File( path + "AppliedEnergistics2.cfg" ) );
|
||||
this.myPath = new File( path + "AppliedEnergistics2.cfg" );
|
||||
public AEConfig( File configFile ) {
|
||||
super( configFile );
|
||||
this.configFile = configFile;
|
||||
|
||||
FMLCommonHandler.instance().bus().register( this );
|
||||
|
||||
final double DEFAULT_BC_EXCHANGE = 5.0;
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
|
||||
|
||||
PowerUnits.MJ.conversionRatio = this.get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE );
|
||||
PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
|
||||
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
|
||||
@@ -340,19 +335,6 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
this.craftingCalculationTimePerTick );
|
||||
}
|
||||
|
||||
if ( this.isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
this.latestVersion = this.get( "VersionChecker", "LatestVersion", "" ).getString();
|
||||
this.latestTimeStamp = Long.parseLong( this.get( "VersionChecker", "LatestTimeStamp", "" ).getString() );
|
||||
}
|
||||
catch (NumberFormatException err)
|
||||
{
|
||||
this.latestTimeStamp = 0;
|
||||
}
|
||||
}
|
||||
|
||||
this.updatable = true;
|
||||
}
|
||||
|
||||
@@ -411,12 +393,6 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
if ( this.isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
this.get( "VersionChecker", "LatestVersion", this.latestVersion ).set( this.latestVersion );
|
||||
this.get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( this.latestTimeStamp ) );
|
||||
}
|
||||
|
||||
if ( this.isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
{
|
||||
this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -22,8 +22,6 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
@@ -37,8 +35,11 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
import appeng.core.crash.CrashEnhancement;
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
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;
|
||||
@@ -47,6 +48,7 @@ import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.server.AECommand;
|
||||
import appeng.services.VersionChecker;
|
||||
import appeng.services.version.VersionCheckerConfig;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -70,7 +72,7 @@ public class AppEng
|
||||
|
||||
private final IMCHandler imcHandler;
|
||||
|
||||
private String configPath;
|
||||
private File configDirectory;
|
||||
|
||||
public AppEng()
|
||||
{
|
||||
@@ -78,12 +80,12 @@ public class AppEng
|
||||
|
||||
this.imcHandler = new IMCHandler();
|
||||
|
||||
FMLCommonHandler.instance().registerCrashCallable( new CrashEnhancement( CrashInfo.MOD_VERSION ) );
|
||||
FMLCommonHandler.instance().registerCrashCallable( new ModCrashEnhancement( CrashInfo.MOD_VERSION ) );
|
||||
}
|
||||
|
||||
public String getConfigPath()
|
||||
public final File getConfigDirectory()
|
||||
{
|
||||
return this.configPath;
|
||||
return this.configDirectory;
|
||||
}
|
||||
|
||||
public boolean isIntegrationEnabled( IntegrationType integrationName )
|
||||
@@ -104,11 +106,16 @@ public class AppEng
|
||||
CommonHelper.proxy.missingCoreMod();
|
||||
}
|
||||
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
this.configPath = event.getModConfigurationDirectory().getPath() + File.separator + "AppliedEnergistics2" + File.separator;
|
||||
Stopwatch watch = Stopwatch.createStarted();
|
||||
this.configDirectory = new File(event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2");
|
||||
|
||||
AEConfig.instance = new AEConfig( this.configPath );
|
||||
FacadeConfig.instance = new FacadeConfig( this.configPath );
|
||||
final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg");
|
||||
final File facadeFile = new File( this.configDirectory, "Facades.cfg" );
|
||||
final File versionFile = new File( this.configDirectory, "VersionChecker.cfg" );
|
||||
|
||||
AEConfig.instance = new AEConfig( configFile );
|
||||
FacadeConfig.instance = new FacadeConfig( facadeFile );
|
||||
final VersionCheckerConfig versionCheckerConfig = new VersionCheckerConfig( versionFile );
|
||||
|
||||
AELog.info( "Pre Initialization ( started )" );
|
||||
|
||||
@@ -121,19 +128,23 @@ public class AppEng
|
||||
|
||||
Registration.INSTANCE.preInitialize( event );
|
||||
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
if ( versionCheckerConfig.isEnabled() )
|
||||
{
|
||||
AELog.info( "Starting VersionChecker" );
|
||||
this.startService( "AE2 VersionChecker", new Thread( new VersionChecker() ) );
|
||||
final VersionChecker versionChecker = new VersionChecker( versionCheckerConfig );
|
||||
final Thread versionCheckerThread = new Thread( versionChecker );
|
||||
|
||||
this.startService( "AE2 VersionChecker", versionCheckerThread );
|
||||
}
|
||||
|
||||
AELog.info( "Pre Initialization ( ended after " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
AELog.info( "Pre Initialization ( ended after " + watch.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
private void startService( String serviceName, Thread thread )
|
||||
{
|
||||
thread.setName( serviceName );
|
||||
thread.setPriority( Thread.MIN_PRIORITY );
|
||||
|
||||
AELog.info( "Starting " + serviceName );
|
||||
thread.start();
|
||||
}
|
||||
|
||||
@@ -157,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();
|
||||
|
||||
@@ -35,8 +35,8 @@ public class FacadeConfig extends Configuration
|
||||
public static FacadeConfig instance;
|
||||
final Pattern replacementPattern;
|
||||
|
||||
public FacadeConfig(String path) {
|
||||
super( new File( path + "Facades.cfg" ) );
|
||||
public FacadeConfig( File facadeFile ) {
|
||||
super( facadeFile );
|
||||
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,6 @@ package appeng.core;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -41,6 +37,10 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -546,7 +546,7 @@ public final class Registration
|
||||
ItemMultiMaterial.instance.makeUnique();
|
||||
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) )
|
||||
this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" );
|
||||
this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigDirectory() ), "index.recipe" );
|
||||
else
|
||||
this.recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -61,7 +61,7 @@ public class WorldSettings extends Configuration
|
||||
|
||||
private static WorldSettings instance;
|
||||
private final List<Integer> storageCellDims = new ArrayList<Integer>();
|
||||
private final File aeFolder;
|
||||
private final File spawnDataFolder;
|
||||
private final CompassService compass;
|
||||
private final PlayerMappings mappings;
|
||||
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
||||
@@ -70,8 +70,8 @@ public class WorldSettings extends Configuration
|
||||
|
||||
public WorldSettings( File aeFolder )
|
||||
{
|
||||
super( new File( aeFolder.getPath() + File.separatorChar + "settings.cfg" ) );
|
||||
this.aeFolder = aeFolder;
|
||||
super( new File( aeFolder.getPath(), "settings.cfg" ) );
|
||||
this.spawnDataFolder = new File( aeFolder, SPAWNDATA_FOLDER );
|
||||
this.compass = new CompassService( aeFolder );
|
||||
|
||||
for ( int dimID : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
|
||||
@@ -101,7 +101,7 @@ public class WorldSettings extends Configuration
|
||||
{
|
||||
File world = DimensionManager.getCurrentSaveRootDirectory();
|
||||
|
||||
File aeBaseFolder = new File( world.getPath() + File.separatorChar + "AE2" );
|
||||
File aeBaseFolder = new File( world.getPath(), "AE2" );
|
||||
|
||||
if ( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
|
||||
{
|
||||
@@ -161,7 +161,7 @@ public class WorldSettings extends Configuration
|
||||
throw new RuntimeException( "Invalid Request" );
|
||||
|
||||
NBTTagCompound data = null;
|
||||
File file = new File( this.aeFolder, SPAWNDATA_FOLDER + File.separatorChar + dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||
|
||||
if ( file.isFile() )
|
||||
{
|
||||
@@ -227,7 +227,7 @@ public class WorldSettings extends Configuration
|
||||
if ( !Thread.holdsLock( WorldSettings.class ) )
|
||||
throw new RuntimeException( "Invalid Request" );
|
||||
|
||||
File file = new File( this.aeFolder, SPAWNDATA_FOLDER + File.separatorChar + dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||
FileOutputStream fileOutputStream = null;
|
||||
|
||||
try
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+6
-31
@@ -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 );
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public enum AEFeature
|
||||
|
||||
MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"),
|
||||
|
||||
VersionChecker("Services"), UnsupportedDeveloperTools("Misc", false), Creative("Misc"),
|
||||
UnsupportedDeveloperTools("Misc", false), Creative("Misc"),
|
||||
|
||||
GrinderLogging("Misc", false), Logging("Misc"), IntegrationLogging("Misc", false), CustomRecipes("Crafting", false), WebsiteRecipes("Misc", false),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.core.features.registries;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -37,20 +38,20 @@ import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
|
||||
public final class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
private final List<IGrinderEntry> recipes;
|
||||
private final Map<ItemStack, String> ores;
|
||||
private final Map<ItemStack, String> ingots;
|
||||
private final Map<String, ItemStack> dusts;
|
||||
|
||||
public final List<IGrinderEntry> RecipeList;
|
||||
|
||||
private ItemStack copy(ItemStack is)
|
||||
public GrinderRecipeManager()
|
||||
{
|
||||
if ( is != null )
|
||||
return is.copy();
|
||||
return null;
|
||||
}
|
||||
|
||||
public GrinderRecipeManager() {
|
||||
this.RecipeList = new ArrayList<IGrinderEntry>();
|
||||
this.recipes = new ArrayList<IGrinderEntry>();
|
||||
this.ores = new HashMap<ItemStack, String>();
|
||||
this.ingots = new HashMap<ItemStack, String>();
|
||||
this.dusts = new HashMap<String, ItemStack>();
|
||||
|
||||
this.addOre( "Coal", new ItemStack( Items.coal ) );
|
||||
this.addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) );
|
||||
@@ -78,20 +79,11 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
public List<IGrinderEntry> getRecipes()
|
||||
{
|
||||
this.log( "API - getRecipes" );
|
||||
return this.RecipeList;
|
||||
}
|
||||
|
||||
private void injectRecipe(AppEngGrinderRecipe appEngGrinderRecipe)
|
||||
{
|
||||
for (IGrinderEntry gr : this.RecipeList)
|
||||
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
return;
|
||||
|
||||
this.RecipeList.add( appEngGrinderRecipe );
|
||||
return this.recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(ItemStack in, ItemStack out, int cost)
|
||||
public void addRecipe( ItemStack in, ItemStack out, int cost )
|
||||
{
|
||||
if ( in == null || out == null )
|
||||
{
|
||||
@@ -104,40 +96,54 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, int cost)
|
||||
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int cost )
|
||||
{
|
||||
if ( in == null || (optional == null && out == null) )
|
||||
if ( in == null || ( optional == null && out == null ) )
|
||||
{
|
||||
this.log( "Invalid Grinder Recipe Specified." );
|
||||
return;
|
||||
}
|
||||
|
||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
|
||||
+ Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost)
|
||||
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost )
|
||||
{
|
||||
if ( in == null || (optional == null && out == null && optional2 == null) )
|
||||
if ( in == null || ( optional == null && out == null && optional2 == null ) )
|
||||
{
|
||||
this.log( "Invalid Grinder Recipe Specified." );
|
||||
return;
|
||||
}
|
||||
|
||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
|
||||
+ Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
||||
}
|
||||
|
||||
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
|
||||
{
|
||||
for ( IGrinderEntry gr : this.recipes )
|
||||
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
return;
|
||||
|
||||
this.recipes.add( appEngGrinderRecipe );
|
||||
}
|
||||
|
||||
private ItemStack copy( ItemStack is )
|
||||
{
|
||||
if ( is != null )
|
||||
return is.copy();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGrinderEntry getRecipeForInput(ItemStack input)
|
||||
public IGrinderEntry getRecipeForInput( ItemStack input )
|
||||
{
|
||||
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
|
||||
if ( input != null )
|
||||
{
|
||||
for (IGrinderEntry r : this.RecipeList)
|
||||
for ( IGrinderEntry r : this.recipes )
|
||||
{
|
||||
if ( Platform.isSameItem( input, r.getInput() ) )
|
||||
{
|
||||
@@ -152,12 +158,12 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
return null;
|
||||
}
|
||||
|
||||
public void log(String o)
|
||||
public void log( String o )
|
||||
{
|
||||
AELog.grinder( o );
|
||||
}
|
||||
|
||||
private int getDustToOreRatio(String name)
|
||||
private int getDustToOreRatio( String name )
|
||||
{
|
||||
if ( name.equals( "Obsidian" ) )
|
||||
return 1;
|
||||
@@ -168,52 +174,48 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
return 2;
|
||||
}
|
||||
|
||||
public final Map<ItemStack, String> Ores = new HashMap<ItemStack, String>();
|
||||
public final Map<ItemStack, String> Ingots = new HashMap<ItemStack, String>();
|
||||
public final Map<String, ItemStack> Dusts = new HashMap<String, ItemStack>();
|
||||
|
||||
private void addOre(String name, ItemStack item)
|
||||
private void addOre( String name, ItemStack item )
|
||||
{
|
||||
if ( item == null )
|
||||
return;
|
||||
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.Ores.put( item, name );
|
||||
this.ores.put( item, name );
|
||||
|
||||
if ( this.Dusts.containsKey( name ) )
|
||||
if ( this.dusts.containsKey( name ) )
|
||||
{
|
||||
ItemStack is = this.Dusts.get( name ).copy();
|
||||
ItemStack is = this.dusts.get( name ).copy();
|
||||
int ratio = this.getDustToOreRatio( name );
|
||||
if ( ratio > 1 )
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
||||
this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
this.addRecipe( item, is, 8 );
|
||||
}
|
||||
}
|
||||
|
||||
private void addIngot(String name, ItemStack item)
|
||||
private void addIngot( String name, ItemStack item )
|
||||
{
|
||||
if ( item == null )
|
||||
return;
|
||||
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.Ingots.put( item, name );
|
||||
this.ingots.put( item, name );
|
||||
|
||||
if ( this.Dusts.containsKey( name ) )
|
||||
if ( this.dusts.containsKey( name ) )
|
||||
{
|
||||
this.addRecipe( item, this.Dusts.get( name ), 4 );
|
||||
this.addRecipe( item, this.dusts.get( name ), 4 );
|
||||
}
|
||||
}
|
||||
|
||||
private void addDust(String name, ItemStack item)
|
||||
private void addDust( String name, ItemStack item )
|
||||
{
|
||||
if ( item == null )
|
||||
return;
|
||||
if ( this.Dusts.containsKey( name ) )
|
||||
if ( this.dusts.containsKey( name ) )
|
||||
{
|
||||
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
return;
|
||||
@@ -221,9 +223,9 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
|
||||
this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.Dusts.put( name, item );
|
||||
this.dusts.put( name, item );
|
||||
|
||||
for (Entry<ItemStack, String> d : this.Ores.entrySet())
|
||||
for ( Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||
if ( name.equals( d.getValue() ) )
|
||||
{
|
||||
ItemStack is = item.copy();
|
||||
@@ -233,23 +235,23 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
||||
this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
this.addRecipe( d.getKey(), is, 8 );
|
||||
}
|
||||
|
||||
for (Entry<ItemStack, String> d : this.Ingots.entrySet())
|
||||
for ( Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||
if ( name.equals( d.getValue() ) )
|
||||
this.addRecipe( d.getKey(), item, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oreRegistered(String name, ItemStack item)
|
||||
public void oreRegistered( String name, ItemStack item )
|
||||
{
|
||||
if ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) )
|
||||
{
|
||||
for (String ore : AEConfig.instance.grinderOres)
|
||||
for ( String ore : AEConfig.instance.grinderOres )
|
||||
{
|
||||
if ( name.equals( "ore" + ore ) )
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ public final class LocatableRegistry implements ILocatableRegistry
|
||||
* Find a locate-able object by its serial.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Object findLocatableBySerial( long ser )
|
||||
{
|
||||
return this.set.get( ser );
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -47,7 +47,7 @@ public enum Stats
|
||||
return this.stat;
|
||||
}
|
||||
|
||||
private Stats() {
|
||||
Stats() {
|
||||
}
|
||||
|
||||
public void addToPlayer(EntityPlayer player, int howMany)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.core.sync;
|
||||
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
@@ -50,101 +51,101 @@ import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketTransitionEffect;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
|
||||
|
||||
public class AppEngPacketHandlerBase
|
||||
{
|
||||
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
|
||||
|
||||
public static final Map<Class, PacketTypes> REVERSE_LOOKUP = new HashMap<Class, AppEngPacketHandlerBase.PacketTypes>();
|
||||
|
||||
public enum PacketTypes
|
||||
{
|
||||
PACKET_COMPASS_REQUEST(PacketCompassRequest.class),
|
||||
PACKET_COMPASS_REQUEST( PacketCompassRequest.class ),
|
||||
|
||||
PACKET_COMPASS_RESPONSE(PacketCompassResponse.class),
|
||||
PACKET_COMPASS_RESPONSE( PacketCompassResponse.class ),
|
||||
|
||||
PACKET_INVENTORY_ACTION(PacketInventoryAction.class),
|
||||
PACKET_INVENTORY_ACTION( PacketInventoryAction.class ),
|
||||
|
||||
PACKET_ME_INVENTORY_UPDATE(PacketMEInventoryUpdate.class),
|
||||
PACKET_ME_INVENTORY_UPDATE( PacketMEInventoryUpdate.class ),
|
||||
|
||||
PACKET_CONFIG_BUTTON(PacketConfigButton.class),
|
||||
PACKET_CONFIG_BUTTON( PacketConfigButton.class ),
|
||||
|
||||
PACKET_MULTIPART(PacketMultiPart.class),
|
||||
PACKET_MULTIPART( PacketMultiPart.class ),
|
||||
|
||||
PACKET_PART_PLACEMENT(PacketPartPlacement.class),
|
||||
PACKET_PART_PLACEMENT( PacketPartPlacement.class ),
|
||||
|
||||
PACKET_LIGHTNING(PacketLightning.class),
|
||||
PACKET_LIGHTNING( PacketLightning.class ),
|
||||
|
||||
PACKET_MATTER_CANNON(PacketMatterCannon.class),
|
||||
PACKET_MATTER_CANNON( PacketMatterCannon.class ),
|
||||
|
||||
PACKET_MOCK_EXPLOSION(PacketMockExplosion.class),
|
||||
PACKET_MOCK_EXPLOSION( PacketMockExplosion.class ),
|
||||
|
||||
PACKET_VALUE_CONFIG(PacketValueConfig.class),
|
||||
PACKET_VALUE_CONFIG( PacketValueConfig.class ),
|
||||
|
||||
PACKET_TRANSITION_EFFECT(PacketTransitionEffect.class),
|
||||
PACKET_TRANSITION_EFFECT( PacketTransitionEffect.class ),
|
||||
|
||||
PACKET_PROGRESS_VALUE(PacketProgressBar.class),
|
||||
PACKET_PROGRESS_VALUE( PacketProgressBar.class ),
|
||||
|
||||
PACKET_CLICK(PacketClick.class),
|
||||
PACKET_CLICK( PacketClick.class ),
|
||||
|
||||
PACKET_NEW_STORAGE_DIMENSION(PacketNewStorageDimension.class),
|
||||
PACKET_NEW_STORAGE_DIMENSION( PacketNewStorageDimension.class ),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class),
|
||||
PACKET_SWITCH_GUIS( PacketSwitchGuis.class ),
|
||||
|
||||
PACKET_SWAP_SLOTS(PacketSwapSlots.class),
|
||||
PACKET_SWAP_SLOTS( PacketSwapSlots.class ),
|
||||
|
||||
PACKET_PATTERN_SLOT(PacketPatternSlot.class),
|
||||
PACKET_PATTERN_SLOT( PacketPatternSlot.class ),
|
||||
|
||||
PACKET_RECIPE_NEI(PacketNEIRecipe.class),
|
||||
PACKET_RECIPE_NEI( PacketNEIRecipe.class ),
|
||||
|
||||
PACKET_PARTIAL_ITEM(PacketPartialItem.class),
|
||||
PACKET_PARTIAL_ITEM( PacketPartialItem.class ),
|
||||
|
||||
PACKET_CRAFTING_REQUEST(PacketCraftRequest.class),
|
||||
PACKET_CRAFTING_REQUEST( PacketCraftRequest.class ),
|
||||
|
||||
PACKET_ASSEMBLER_ANIMATION(PacketAssemblerAnimation.class),
|
||||
PACKET_ASSEMBLER_ANIMATION( PacketAssemblerAnimation.class ),
|
||||
|
||||
PACKET_COMPRESSED_NBT(PacketCompressedNBT.class),
|
||||
PACKET_COMPRESSED_NBT( PacketCompressedNBT.class ),
|
||||
|
||||
PACKET_PAINTED_ENTITY(PacketPaintedEntity.class);
|
||||
PACKET_PAINTED_ENTITY( PacketPaintedEntity.class );
|
||||
|
||||
final public Class pc;
|
||||
final public Constructor con;
|
||||
private final Class<? extends AppEngPacket> packetClass;
|
||||
private final Constructor<? extends AppEngPacket> packetConstructor;
|
||||
|
||||
private PacketTypes(Class c) {
|
||||
this.pc = c;
|
||||
PacketTypes( Class<? extends AppEngPacket> c )
|
||||
{
|
||||
this.packetClass = c;
|
||||
|
||||
Constructor x = null;
|
||||
Constructor<? extends AppEngPacket> x = null;
|
||||
try
|
||||
{
|
||||
x = this.pc.getConstructor( ByteBuf.class );
|
||||
x = this.packetClass.getConstructor( ByteBuf.class );
|
||||
}
|
||||
catch (NoSuchMethodException ignored)
|
||||
catch( NoSuchMethodException ignored )
|
||||
{
|
||||
}
|
||||
catch (SecurityException ignored)
|
||||
catch( SecurityException ignored )
|
||||
{
|
||||
}
|
||||
|
||||
this.con = x;
|
||||
AppEngPacketHandlerBase.REVERSE_LOOKUP.put( this.pc, this );
|
||||
this.packetConstructor = x;
|
||||
REVERSE_LOOKUP.put( this.packetClass, this );
|
||||
|
||||
if ( this.con == null )
|
||||
if( this.packetConstructor == null )
|
||||
throw new RuntimeException( "Invalid Packet Class, must be constructable on DataInputStream" );
|
||||
}
|
||||
|
||||
public AppEngPacket parsePacket(ByteBuf in) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
||||
public static PacketTypes getPacket( int id )
|
||||
{
|
||||
return (AppEngPacket) this.con.newInstance( in );
|
||||
return ( values() )[id];
|
||||
}
|
||||
|
||||
public static PacketTypes getPacket(int id)
|
||||
public static PacketTypes getID( Class<? extends AppEngPacket> c )
|
||||
{
|
||||
return (values())[id];
|
||||
return REVERSE_LOOKUP.get( c );
|
||||
}
|
||||
|
||||
public static PacketTypes getID(Class<? extends AppEngPacket> c)
|
||||
public AppEngPacket parsePacket( ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
||||
{
|
||||
return AppEngPacketHandlerBase.REVERSE_LOOKUP.get( c );
|
||||
return this.packetConstructor.newInstance( in );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -29,13 +29,15 @@ import appeng.core.WorldSettings;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.services.helpers.ICompassCallback;
|
||||
import appeng.services.compass.ICompassCallback;
|
||||
|
||||
public class PacketCompassRequest extends AppEngPacket implements ICompassCallback
|
||||
{
|
||||
|
||||
final public long attunement;
|
||||
final public int cx, cz, cdy;
|
||||
final public int cx;
|
||||
final public int cz;
|
||||
final public int cdy;
|
||||
|
||||
EntityPlayer talkBackTo;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user