Compare commits
63 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 |
@@ -1,6 +1,6 @@
|
|||||||
# Applied Energistics 2
|
# Applied Energistics 2
|
||||||
|
|
||||||
## Table of Content
|
## Table of Contents
|
||||||
|
|
||||||
* [About](#about)
|
* [About](#about)
|
||||||
* [Contacts](#contacts)
|
* [Contacts](#contacts)
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ jar {
|
|||||||
minecraft {
|
minecraft {
|
||||||
version = config.minecraft_version + "-" + config.forge_version
|
version = config.minecraft_version + "-" + config.forge_version
|
||||||
|
|
||||||
|
replaceIn "AEConfig.java"
|
||||||
replace "@version@", project.version
|
replace "@version@", project.version
|
||||||
replace "@aechannel@", config.aechannel
|
replace "@aechannel@", config.aechannel
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -14,12 +14,11 @@ forge_version=10.13.2.1291
|
|||||||
# APIs used for development #
|
# APIs used for development #
|
||||||
#########################################################
|
#########################################################
|
||||||
cb_minecraft_version=1.7.10
|
cb_minecraft_version=1.7.10
|
||||||
fmp_version=1.1.1.321
|
fmp_version=1.1.1.324
|
||||||
code_chicken_lib_version=1.1.1.110
|
code_chicken_lib_version=1.1.3.127
|
||||||
code_chicken_core_version=1.0.4.35
|
code_chicken_core_version=1.0.4.35
|
||||||
nei_version=1.0.4.90
|
nei_version=1.0.4.90
|
||||||
waila_version=1.5.9_1.7.10
|
bc_version=6.4.3
|
||||||
bc_version=6.4.2
|
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# API Stubs #
|
# API Stubs #
|
||||||
@@ -33,9 +32,10 @@ api_craftguide_version=1
|
|||||||
api_ic2_version=1
|
api_ic2_version=1
|
||||||
api_immibis_version=1
|
api_immibis_version=1
|
||||||
api_invtweaks_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_mfr_version=1
|
||||||
api_railcraft_version=1
|
api_railcraft_version=1
|
||||||
api_rblocks_version=1
|
api_rblocks_version=1
|
||||||
api_rf_version=2
|
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:CodeChickenCore:${config.cb_minecraft_version}-${config.code_chicken_core_version}:dev"
|
||||||
compile "codechicken:NotEnoughItems:${config.cb_minecraft_version}-${config.nei_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"
|
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: 'betterstorage', version: "${config.api_betterstorage_version}")
|
||||||
compile(group: 'api', name: 'coloredlightscore', version: "${config.api_coloredlightscore_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: 'craftguide', version: "${config.api_craftguide_version}")
|
||||||
compile(group: 'api', name: 'ic2', version: "${config.api_ic2_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: 'immibis', version: "${config.api_immibis_version}")
|
||||||
compile(group: 'api', name: 'invtweaks', version: "${config.api_invtweaks_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: 'mfr', version: "${config.api_mfr_version}")
|
||||||
compile(group: 'api', name: 'railcraft', version: "${config.api_railcraft_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: 'rblocks', version: "${config.api_rblocks_version}")
|
||||||
compile(group: 'api', name: 'rf', version: "${config.api_rf_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"
|
testCompile "junit:junit:4.11"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public enum AccessRestriction
|
|||||||
|
|
||||||
private final int permissionBit;
|
private final int permissionBit;
|
||||||
|
|
||||||
private AccessRestriction(int v) {
|
AccessRestriction( int v ) {
|
||||||
this.permissionBit = v;
|
this.permissionBit = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public enum FuzzyMode
|
|||||||
final public float breakPoint;
|
final public float breakPoint;
|
||||||
final public float percentage;
|
final public float percentage;
|
||||||
|
|
||||||
private FuzzyMode(float p) {
|
FuzzyMode( float p ) {
|
||||||
this.percentage = p;
|
this.percentage = p;
|
||||||
this.breakPoint = p / 100.0f;
|
this.breakPoint = p / 100.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public enum PowerUnits
|
|||||||
RF("gui.appliedenergistics2.units.thermalexpansion"), // ThermalExpansion - Redstone Flux
|
RF("gui.appliedenergistics2.units.thermalexpansion"), // ThermalExpansion - Redstone Flux
|
||||||
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
|
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
|
||||||
|
|
||||||
private PowerUnits(String un) {
|
PowerUnits( String un ) {
|
||||||
this.unlocalizedName = un;
|
this.unlocalizedName = un;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public enum Settings
|
|||||||
return this.values;
|
return this.values;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Settings( EnumSet set )
|
Settings( EnumSet set )
|
||||||
{
|
{
|
||||||
if ( set == null || set.isEmpty() )
|
if ( set == null || set.isEmpty() )
|
||||||
throw new RuntimeException( "Invalid configuration." );
|
throw new RuntimeException( "Invalid configuration." );
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public enum Upgrades
|
|||||||
public final int myTier;
|
public final int myTier;
|
||||||
public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
|
public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
|
||||||
|
|
||||||
private Upgrades( int tier )
|
Upgrades( int tier )
|
||||||
{
|
{
|
||||||
this.myTier = tier;
|
this.myTier = tier;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,42 +36,42 @@ public interface IGrinderEntry
|
|||||||
*
|
*
|
||||||
* @return input that the grinder will accept.
|
* @return input that the grinder will accept.
|
||||||
*/
|
*/
|
||||||
public ItemStack getInput();
|
ItemStack getInput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lets you change the grinder recipe by changing its input.
|
* lets you change the grinder recipe by changing its input.
|
||||||
*
|
*
|
||||||
* @param input input item
|
* @param input input item
|
||||||
*/
|
*/
|
||||||
public void setInput(ItemStack input);
|
void setInput( ItemStack input );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the current output
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @return output that the grinder will produce
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
public ItemStack getOutput();
|
ItemStack getOutput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the current output
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @return output that the grinder will produce
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
public ItemStack getOptionalOutput();
|
ItemStack getOptionalOutput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the current output
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @return output that the grinder will produce
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
public ItemStack getSecondOptionalOutput();
|
ItemStack getSecondOptionalOutput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows you to change the output.
|
* allows you to change the output.
|
||||||
*
|
*
|
||||||
* @param output output item
|
* @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.
|
* stack, and 0.0-1.0 chance that it will be generated.
|
||||||
@@ -79,14 +79,14 @@ public interface IGrinderEntry
|
|||||||
* @param output output item
|
* @param output output item
|
||||||
* @param chance generation chance
|
* @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.
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
*
|
*
|
||||||
* @return chance of optional output
|
* @return chance of optional output
|
||||||
*/
|
*/
|
||||||
public float getOptionalChance();
|
float getOptionalChance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stack, and 0.0-1.0 chance that it will be generated.
|
* 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 output second optional output item
|
||||||
* @param chance second optional output chance
|
* @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.
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
*
|
*
|
||||||
* @return second optional output chance
|
* @return second optional output chance
|
||||||
*/
|
*/
|
||||||
public float getSecondOptionalChance();
|
float getSecondOptionalChance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Energy cost, in turns.
|
* Energy cost, in turns.
|
||||||
*
|
*
|
||||||
* @return number of turns it takes to produce the output from the input.
|
* @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
|
* Allows you to adjust the number of turns
|
||||||
*
|
*
|
||||||
* @param c number of turns to produce output.
|
* @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;
|
package appeng.api.features;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
|
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
|
||||||
*/
|
*/
|
||||||
@@ -38,7 +39,7 @@ public interface IGrinderRegistry
|
|||||||
*
|
*
|
||||||
* @return currentlyRegisteredRecipes
|
* @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.
|
* 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 out output
|
||||||
* @param turns amount of turns to turn the input into the 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.
|
* add a new recipe with optional outputs, duplicates will not be added.
|
||||||
@@ -79,6 +80,6 @@ public interface IGrinderRegistry
|
|||||||
* @param input input
|
* @param input input
|
||||||
* @return identified recipe or null
|
* @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 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
|
* @param stack item
|
||||||
* @return true, if getComparison will return a valid IItemComparison Object
|
* @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;
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.config.TunnelType;
|
import appeng.api.config.TunnelType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +43,7 @@ public interface IP2PTunnelRegistry
|
|||||||
* @param type
|
* @param type
|
||||||
* - the type of tunnel
|
* - 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.
|
* 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.
|
* @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.
|
* resolve sub items by name.
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ public interface ISpecialComparisonRegistry
|
|||||||
*
|
*
|
||||||
* @param prov comparison provider
|
* @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 interface IWorldGen
|
||||||
{
|
{
|
||||||
|
|
||||||
public enum WorldGenType
|
enum WorldGenType
|
||||||
{
|
{
|
||||||
CertusQuartz, ChargedCertusQuartz, Meteorites
|
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);
|
boolean isWorldGenEnabled(WorldGenType type, World w);
|
||||||
|
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ import net.minecraft.item.ItemStack;
|
|||||||
public interface IGuiItemObject
|
public interface IGuiItemObject
|
||||||
{
|
{
|
||||||
|
|
||||||
public ItemStack getItemStack();
|
ItemStack getItemStack();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
|
|
||||||
package appeng.api.implementations.items;
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.config.AccessRestriction;
|
import appeng.api.config.AccessRestriction;
|
||||||
import appeng.api.networking.energy.IAEPowerStorage;
|
import appeng.api.networking.energy.IAEPowerStorage;
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ public interface IAEItemPowerStorage
|
|||||||
*
|
*
|
||||||
* @return amount unable to be stored
|
* @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
|
* 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
|
* @param amt to be extracted power from device
|
||||||
* @return what it could extract
|
* @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 )
|
* @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()
|
* @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
|
* 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
|
* @return access restriction of network
|
||||||
*/
|
*/
|
||||||
public AccessRestriction getPowerFlow(ItemStack is);
|
AccessRestriction getPowerFlow( ItemStack is );
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ public interface IGrid
|
|||||||
* @param iface face
|
* @param iface face
|
||||||
* @return the IGridCache you requested.
|
* @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.
|
* Post an event into the network event bus.
|
||||||
@@ -49,7 +49,7 @@ public interface IGrid
|
|||||||
* - event to post
|
* - event to post
|
||||||
* @return returns ev back to original poster
|
* @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.
|
* 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
|
* event to post
|
||||||
* @return returns ev back to original poster
|
* @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,
|
* 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).
|
* @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.
|
* Get machines on the network.
|
||||||
@@ -74,7 +74,7 @@ public interface IGrid
|
|||||||
* @param gridHostClass class of the grid host
|
* @param gridHostClass class of the grid host
|
||||||
* @return IMachineSet of all nodes belonging to hosts of specified class.
|
* @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.
|
* @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.
|
* @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.
|
* @return the node considered the pivot point of the grid.
|
||||||
*/
|
*/
|
||||||
public IGridNode getPivot();
|
IGridNode getPivot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,15 @@
|
|||||||
|
|
||||||
package appeng.api.networking;
|
package appeng.api.networking;
|
||||||
|
|
||||||
import appeng.api.parts.IPart;
|
|
||||||
import appeng.api.util.AEColor;
|
import java.util.EnumSet;
|
||||||
import appeng.api.util.DimensionalCoord;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
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
|
* An Implementation is required to create your node for IGridHost
|
||||||
@@ -85,7 +87,7 @@ public interface IGridBlock
|
|||||||
* @param grid grid
|
* @param grid grid
|
||||||
* @param channelsInUse used channels
|
* @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
|
* 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.
|
* @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
|
* @param n
|
||||||
* the connection.
|
* the connection.
|
||||||
*/
|
*/
|
||||||
public void visitConnection(IGridConnection n);
|
void visitConnection( IGridConnection n );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,10 @@
|
|||||||
|
|
||||||
package appeng.api.networking;
|
package appeng.api.networking;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.api.parts.IPart;
|
import appeng.api.parts.IPart;
|
||||||
import appeng.api.util.AECableType;
|
import appeng.api.util.AECableType;
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ public interface IGridHost
|
|||||||
* @return a new IGridNode, create these with
|
* @return a new IGridNode, create these with
|
||||||
* AEApi.INSTANCE().createGridNode( MyIGridBlock )
|
* 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
|
* Determines how cables render when they connect to this block. Priority is
|
||||||
@@ -56,11 +58,11 @@ public interface IGridHost
|
|||||||
*
|
*
|
||||||
* @param dir direction
|
* @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.
|
* 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.
|
* @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
|
* @param job
|
||||||
* - final 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
|
* @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 )
|
* @return the current maximum power ( this can change :P )
|
||||||
*/
|
*/
|
||||||
public double getAEMaxPower();
|
double getAEMaxPower();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current AE Power Level, this may exceed getMEMaxPower()
|
* @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
|
* 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
|
* @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!
|
* 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
|
* @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.
|
* @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
|
* @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of
|
||||||
* extractPower.
|
* extractPower.
|
||||||
*/
|
*/
|
||||||
public double getAvgPowerUsage();
|
double getAvgPowerUsage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the average energy injected into the system per tick, for the last 10 ticks.
|
* @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
|
* 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.
|
* @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.
|
* 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?
|
* should the action be simulated or performed?
|
||||||
* @return the amount of power that the network has OVER the limit.
|
* @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.
|
* this is should be considered an estimate, and not relied upon for real calculations.
|
||||||
*
|
*
|
||||||
* @return estimated available power.
|
* @return estimated available power.
|
||||||
*/
|
*/
|
||||||
public double getStoredPower();
|
double getStoredPower();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this is should be considered an estimate, and not relied upon for real calculations.
|
* 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.
|
* @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
|
* 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
|
* 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
|
* 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?
|
* @param mode should the action be simulated or performed?
|
||||||
* @return returns extracted power.
|
* @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 transparentFacades;
|
||||||
public final boolean opaqueFacades;
|
public final boolean opaqueFacades;
|
||||||
|
|
||||||
private CableRenderMode(boolean hideFacades) {
|
CableRenderMode( boolean hideFacades ) {
|
||||||
this.transparentFacades = hideFacades;
|
this.transparentFacades = hideFacades;
|
||||||
this.opaqueFacades = !hideFacades;
|
this.opaqueFacades = !hideFacades;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,12 +23,13 @@
|
|||||||
|
|
||||||
package appeng.api.recipes;
|
package appeng.api.recipes;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import appeng.api.exceptions.MissingIngredientError;
|
import appeng.api.exceptions.MissingIngredientError;
|
||||||
import appeng.api.exceptions.RecipeError;
|
import appeng.api.exceptions.RecipeError;
|
||||||
import appeng.api.exceptions.RegistrationError;
|
import appeng.api.exceptions.RegistrationError;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ICraftHandler
|
public interface ICraftHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ public interface ICraftHandler
|
|||||||
* @param output parsed outputs
|
* @param output parsed outputs
|
||||||
* @throws RecipeError
|
* @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.
|
* called when all recipes are parsed, and your required to register your recipe.
|
||||||
@@ -47,6 +48,6 @@ public interface ICraftHandler
|
|||||||
* @throws RegistrationError
|
* @throws RegistrationError
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientError
|
||||||
*/
|
*/
|
||||||
public void register() throws RegistrationError, MissingIngredientError;
|
void register() throws RegistrationError, MissingIngredientError;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
|
|
||||||
package appeng.api.recipes;
|
package appeng.api.recipes;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.exceptions.MissingIngredientError;
|
import appeng.api.exceptions.MissingIngredientError;
|
||||||
import appeng.api.exceptions.RegistrationError;
|
import appeng.api.exceptions.RegistrationError;
|
||||||
|
|
||||||
@@ -55,27 +57,27 @@ public interface IIngredient {
|
|||||||
*
|
*
|
||||||
* @return true if this slot contains no ItemStack, this is passed as "_"
|
* @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
|
* @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
|
* @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
|
* @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
|
* @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.
|
* Bakes the lists in for faster runtime look-ups.
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ public interface ISubItemResolver
|
|||||||
* @param fullName name of sub item
|
* @param fullName name of sub item
|
||||||
* @return either a ResolveResult, or a ResolverResultSet
|
* @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
|
* @param src action source
|
||||||
* @return returns the number of items not added.
|
* @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
|
* Extract the specified item from the ME Inventory
|
||||||
@@ -60,7 +60,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
|||||||
* simulate, or perform action?
|
* simulate, or perform action?
|
||||||
* @return returns the number of items extracted, null
|
* @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.
|
* 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
|
* the IItemList the results will be written too
|
||||||
* @return returns same list that was passed in, is passed out
|
* @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
|
* @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
|
* @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
|
* 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
|
* - item that might be added
|
||||||
* @return if its prioritized
|
* @return if its prioritized
|
||||||
*/
|
*/
|
||||||
public boolean isPrioritized(StackType input);
|
boolean isPrioritized( StackType input );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* determine if an item can be accepted and stored.
|
* 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
|
* - item that might be added
|
||||||
* @return if the item can 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.
|
* determine what the priority of the inventory is.
|
||||||
*
|
*
|
||||||
* @return the priority, zero is default, positive and negative are supported.
|
* @return the priority, zero is default, positive and negative are supported.
|
||||||
*/
|
*/
|
||||||
public int getPriority();
|
int getPriority();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pass back value for blinkCell.
|
* pass back value for blinkCell.
|
||||||
*
|
*
|
||||||
* @return the slot index for the cell that this represents in the storage unit, the method on the
|
* @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
|
* {@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
|
* 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 )
|
* - pass number ( 1 or 2 )
|
||||||
* @return true, if this inventory is valid for this pass.
|
* @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>
|
public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>, IBaseMonitor<T>
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
/**
|
/**
|
||||||
* This method is discouraged when accessing data via a IMEMonitor
|
* 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(...)
|
* 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;
|
public final Class<? extends IAEStack> type;
|
||||||
|
|
||||||
private StorageChannel( Class<? extends IAEStack> t ) {
|
StorageChannel( Class<? extends IAEStack> t ) {
|
||||||
this.type = t;
|
this.type = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public interface IAEFluidStack extends IAEStack<IAEFluidStack>
|
|||||||
* @return the copy.
|
* @return the copy.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IAEFluidStack copy();
|
IAEFluidStack copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Combines two IAEItemStacks via addition.
|
* Combines two IAEItemStacks via addition.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
|||||||
*
|
*
|
||||||
* @return new ItemStack
|
* @return new ItemStack
|
||||||
*/
|
*/
|
||||||
public ItemStack getItemStack();
|
ItemStack getItemStack();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a AE Item clone
|
* create a AE Item clone
|
||||||
@@ -52,7 +52,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
|||||||
* @return the copy
|
* @return the copy
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IAEItemStack copy();
|
IAEItemStack copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is there NBT Data for this item?
|
* is there NBT Data for this item?
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
|
|
||||||
package appeng.api.storage.data;
|
package appeng.api.storage.data;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
import appeng.api.features.IItemComparison;
|
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 )
|
* @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
|
* compare to other NBTTagCompounds or IAETagCompounds
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
|
|
||||||
package appeng.api.storage.data;
|
package appeng.api.storage.data;
|
||||||
|
|
||||||
import appeng.api.config.FuzzyMode;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import appeng.api.config.FuzzyMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a list of items in AE.
|
* Represents a list of items in AE.
|
||||||
*
|
*
|
||||||
@@ -42,7 +43,7 @@ public interface IItemContainer<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param option added stack
|
* @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
|
* @param i compared item
|
||||||
@@ -55,11 +56,11 @@ public interface IItemContainer<StackType extends IAEStack>
|
|||||||
* @param input compared item
|
* @param input compared item
|
||||||
* @return a list of relevant fuzzy matched stacks
|
* @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
|
* @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
|
* @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.
|
* 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
|
* @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
|
* 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
|
* @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
|
* @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.
|
* allows you to iterate the list.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Iterator<StackType> iterator();
|
Iterator<StackType> iterator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resets stack sizes to 0.
|
* resets stack sizes to 0.
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public interface AEItemDefinition
|
|||||||
ItemStack stack(int stackSize);
|
ItemStack stack(int stackSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare {@link ItemStack} with this {@link AEItemDefinition}
|
* Compare {@link ItemStack} with this
|
||||||
*
|
*
|
||||||
* @param comparableItem compared item
|
* @param comparableItem compared item
|
||||||
* @return true if the item stack is a matching item.
|
* @return true if the item stack is a matching item.
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
package appeng.api.util;
|
package appeng.api.util;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to adjust settings on an object,
|
* 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.
|
* 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
|
* Only works after settings have been registered
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ import appeng.parts.NullCableBusContainer;
|
|||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.tile.networking.TileCableBus;
|
import appeng.tile.networking.TileCableBus;
|
||||||
import appeng.tile.networking.TileCableBusTESR;
|
import appeng.tile.networking.TileCableBusTESR;
|
||||||
import appeng.transformer.annotations.integration.Interface;
|
import appeng.transformer.annotations.Integration.Interface;
|
||||||
import appeng.transformer.annotations.integration.Method;
|
import appeng.transformer.annotations.Integration.Method;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
|
@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.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -163,10 +164,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 ) );
|
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,10 +87,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 ) );
|
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,14 @@ public class GuiCraftAmount extends AEBaseGui
|
|||||||
|
|
||||||
GuiButton next;
|
GuiButton next;
|
||||||
|
|
||||||
GuiButton plus1, plus10, plus100, plus1000;
|
GuiButton plus1;
|
||||||
GuiButton minus1, minus10, minus100, minus1000;
|
GuiButton plus10;
|
||||||
|
GuiButton plus100;
|
||||||
|
GuiButton plus1000;
|
||||||
|
GuiButton minus1;
|
||||||
|
GuiButton minus10;
|
||||||
|
GuiButton minus100;
|
||||||
|
GuiButton minus1000;
|
||||||
|
|
||||||
GuiBridge OriginalGui;
|
GuiBridge OriginalGui;
|
||||||
|
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ import java.util.Iterator;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.config.SortDir;
|
import appeng.api.config.SortDir;
|
||||||
import appeng.api.config.SortOrder;
|
import appeng.api.config.SortOrder;
|
||||||
@@ -309,7 +309,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
|
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
|
||||||
|
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
boolean active = false, scheduled = false;
|
boolean active = false;
|
||||||
|
boolean scheduled = false;
|
||||||
|
|
||||||
if ( stored != null && stored.getStackSize() > 0 )
|
if ( stored != null && stored.getStackSize() > 0 )
|
||||||
{
|
{
|
||||||
@@ -328,10 +329,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
if ( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
|
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 startX = (x * (1 + sectionLength) + xo) * 2;
|
||||||
int startY = ((y * offY + yo) - 3) * 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;
|
int negY = ((lines - 1) * 5) / 2;
|
||||||
|
|||||||
@@ -47,8 +47,14 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
|||||||
|
|
||||||
GuiNumberBox level;
|
GuiNumberBox level;
|
||||||
|
|
||||||
GuiButton plus1, plus10, plus100, plus1000;
|
GuiButton plus1;
|
||||||
GuiButton minus1, minus10, minus100, minus1000;
|
GuiButton plus10;
|
||||||
|
GuiButton plus100;
|
||||||
|
GuiButton plus1000;
|
||||||
|
GuiButton minus1;
|
||||||
|
GuiButton minus10;
|
||||||
|
GuiButton minus100;
|
||||||
|
GuiButton minus1000;
|
||||||
|
|
||||||
GuiImgButton levelMode;
|
GuiImgButton levelMode;
|
||||||
GuiImgButton craftingMode;
|
GuiImgButton craftingMode;
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
GuiImgButton SortByBox;
|
GuiImgButton SortByBox;
|
||||||
GuiImgButton SortDirBox;
|
GuiImgButton SortDirBox;
|
||||||
|
|
||||||
GuiImgButton searchBoxSettings, terminalStyleBox;
|
GuiImgButton searchBoxSettings;
|
||||||
|
GuiImgButton terminalStyleBox;
|
||||||
final boolean viewCell;
|
final boolean viewCell;
|
||||||
|
|
||||||
final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||||||
int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
|
int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
|
||||||
int viewEnd = viewStart + 5 * 4;
|
int viewEnd = viewStart + 5 * 4;
|
||||||
|
|
||||||
String ToolTip = "";
|
String toolTip = "";
|
||||||
int toolPosX = 0;
|
int toolPosX = 0;
|
||||||
int toolPosY = 0;
|
int toolPosY = 0;
|
||||||
|
|
||||||
@@ -199,11 +199,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
if ( this.tooltip == z - viewStart )
|
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 )
|
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;
|
toolPosX = x * sectionLength + xo + sectionLength - 8;
|
||||||
toolPosY = y * 18 + yo;
|
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 );
|
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||||
this.drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip );
|
this.drawTooltip( toolPosX, toolPosY + 10, 0, toolTip );
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,14 @@ public class GuiPriority extends AEBaseGui
|
|||||||
GuiNumberBox priority;
|
GuiNumberBox priority;
|
||||||
GuiTabButton originalGuiBtn;
|
GuiTabButton originalGuiBtn;
|
||||||
|
|
||||||
GuiButton plus1, plus10, plus100, plus1000;
|
GuiButton plus1;
|
||||||
GuiButton minus1, minus10, minus100, minus1000;
|
GuiButton plus10;
|
||||||
|
GuiButton plus100;
|
||||||
|
GuiButton plus1000;
|
||||||
|
GuiButton minus1;
|
||||||
|
GuiButton minus10;
|
||||||
|
GuiButton minus100;
|
||||||
|
GuiButton minus1000;
|
||||||
|
|
||||||
GuiBridge OriginalGui;
|
GuiBridge OriginalGui;
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,11 @@ public class GuiSecurity extends GuiMEMonitorable
|
|||||||
this.standardSize = this.xSize;
|
this.standardSize = this.xSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiToggleButton inject, extract, craft, build, security;
|
GuiToggleButton inject;
|
||||||
|
GuiToggleButton extract;
|
||||||
|
GuiToggleButton craft;
|
||||||
|
GuiToggleButton build;
|
||||||
|
GuiToggleButton security;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui()
|
public void initGui()
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import appeng.core.localization.ButtonToolTips;
|
|||||||
public class GuiImgButton extends GuiButton implements ITooltip
|
public class GuiImgButton extends GuiButton implements ITooltip
|
||||||
{
|
{
|
||||||
private static final Pattern COMPILE = Pattern.compile( "%s" );
|
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 static Map<EnumPair, ButtonAppearance> appearances;
|
||||||
private final Enum buttonSetting;
|
private final Enum buttonSetting;
|
||||||
public boolean halfSize = false;
|
public boolean halfSize = false;
|
||||||
@@ -281,7 +282,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||||||
if ( this.fillVar != null )
|
if ( this.fillVar != null )
|
||||||
value = COMPILE.matcher( value ).replaceFirst( this.fillVar );
|
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 );
|
StringBuilder sb = new StringBuilder( value );
|
||||||
|
|
||||||
int i = sb.lastIndexOf( "\n" );
|
int i = sb.lastIndexOf( "\n" );
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
package appeng.client.gui.widgets;
|
package appeng.client.gui.widgets;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@@ -30,6 +32,7 @@ import appeng.client.texture.ExtraBlockTextures;
|
|||||||
|
|
||||||
public class GuiToggleButton extends GuiButton implements ITooltip
|
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 iconIdxOn;
|
||||||
private final int iconIdxOff;
|
private final int iconIdxOff;
|
||||||
|
|
||||||
@@ -94,7 +97,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
|
|||||||
if ( value == null || value.isEmpty() )
|
if ( value == null || value.isEmpty() )
|
||||||
value = this.displayHint;
|
value = this.displayHint;
|
||||||
|
|
||||||
value = value.replace( "\\n", "\n" );
|
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
|
||||||
StringBuilder sb = new StringBuilder( value );
|
StringBuilder sb = new StringBuilder( value );
|
||||||
|
|
||||||
int i = sb.lastIndexOf( "\n" );
|
int i = sb.lastIndexOf( "\n" );
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class SlotDisconnected extends AppEngSlot
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getDisplayStack()
|
public ItemStack getDisplayStack()
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )// && (which == PlaceableItemType.ENCODED_PATTERN) )
|
if ( Platform.isClient() )
|
||||||
{
|
{
|
||||||
ItemStack is = super.getStack();
|
ItemStack is = super.getStack();
|
||||||
if ( is != null && is.getItem() instanceof ItemEncodedPattern )
|
if ( is != null && is.getItem() instanceof ItemEncodedPattern )
|
||||||
|
|||||||
@@ -606,9 +606,15 @@ public class BaseBlockRender
|
|||||||
{
|
{
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
double offsetX = 0.0, offsetY = 0.0, offsetZ = 0.0;
|
double offsetX = 0.0;
|
||||||
double layerAX = 0.0, layerAY = 0.0, layerAZ = 0.0;
|
double offsetY = 0.0;
|
||||||
double layerBX = 0.0, layerBY = 0.0, layerBZ = 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;
|
boolean flip = false;
|
||||||
switch (orientation)
|
switch (orientation)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
package appeng.client.render;
|
package appeng.client.render;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class BusRenderer implements IItemRenderer
|
|||||||
public static final BusRenderer INSTANCE = new BusRenderer();
|
public static final BusRenderer INSTANCE = new BusRenderer();
|
||||||
|
|
||||||
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
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)
|
public IPart getRenderer(ItemStack is, IPartItem c)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ public class CableRenderHelper
|
|||||||
|
|
||||||
private void setSide(ForgeDirection s)
|
private void setSide(ForgeDirection s)
|
||||||
{
|
{
|
||||||
ForgeDirection ax, ay, az;
|
ForgeDirection ax;
|
||||||
|
ForgeDirection ay;
|
||||||
|
ForgeDirection az;
|
||||||
|
|
||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
@@ -205,7 +207,9 @@ public class CableRenderHelper
|
|||||||
IPart part = cableBusContainer.getPart( s );
|
IPart part = cableBusContainer.getPart( s );
|
||||||
if ( part != null )
|
if ( part != null )
|
||||||
{
|
{
|
||||||
ForgeDirection ax, ay, az;
|
ForgeDirection ax;
|
||||||
|
ForgeDirection ay;
|
||||||
|
ForgeDirection az;
|
||||||
|
|
||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -688,7 +688,8 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
for (int k = -1; k <= 1; k++)
|
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 );
|
return Arrays.hashCode( this.lightHashTmp );
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import appeng.block.AEBaseBlock;
|
|||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class WorldRender implements ISimpleBlockRenderingHandler
|
public final class WorldRender implements ISimpleBlockRenderingHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
private final RenderBlocks renderer = new RenderBlocks();
|
private final RenderBlocks renderer = new RenderBlocks();
|
||||||
|
|||||||
@@ -91,11 +91,13 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
|||||||
int spin = 0;
|
int spin = 0;
|
||||||
|
|
||||||
int max = 5;
|
int max = 5;
|
||||||
while (walrus != cmt.getUp() && max-- > 0)
|
while (walrus != cmt.getUp() && max > 0)
|
||||||
{
|
{
|
||||||
|
max--;
|
||||||
spin++;
|
spin++;
|
||||||
walrus = Platform.rotateAround( walrus, side );
|
walrus = Platform.rotateAround( walrus, side );
|
||||||
}
|
}
|
||||||
|
max--;
|
||||||
|
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||||
GL11.glTranslated( side.offsetX * 0.69, side.offsetY * 0.69, side.offsetZ * 0.69 );
|
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 )
|
if ( cr.spin )
|
||||||
{
|
{
|
||||||
now = now % 100000;
|
now %= 100000;
|
||||||
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -139,14 +139,14 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
now = now % 1000000;
|
now %= 1000000;
|
||||||
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
|
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
now = now % 100000;
|
now %= 100000;
|
||||||
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
|||||||
{
|
{
|
||||||
if ( cr.spin )
|
if ( cr.spin )
|
||||||
{
|
{
|
||||||
now = now % 100000;
|
now %= 100000;
|
||||||
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -204,7 +204,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
now = now % 1000000;
|
now %= 1000000;
|
||||||
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
|
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.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
this.particleScale *= 0.95;
|
this.particleScale *= 0.95;
|
||||||
|
|
||||||
if ( this.particleMaxAge-- <= 0 || this.particleScale < 0.1 )
|
if ( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
|
||||||
{
|
{
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
this.particleMaxAge--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public enum CableBusTextures
|
|||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CableBusTextures(String name) {
|
CableBusTextures( String name ) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public enum ExtraBlockTextures
|
|||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExtraBlockTextures(String name) {
|
ExtraBlockTextures( String name ) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public enum ExtraItemTextures
|
|||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExtraItemTextures(String name) {
|
ExtraItemTextures( String name ) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ public abstract class AEBaseContainer extends Container
|
|||||||
int page = 0;
|
int page = 0;
|
||||||
for (byte[] packet : miniPackets)
|
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 );
|
NetworkHandler.instance.sendToServer( ppi );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -818,7 +819,7 @@ public abstract class AEBaseContainer extends Container
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get target item.
|
// get target item.
|
||||||
IAEItemStack slotItem = this.getTargetStack();
|
IAEItemStack slotItem = this.clientRequestedTargetItem;
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ public class ContainerOpenContext
|
|||||||
{
|
{
|
||||||
|
|
||||||
public World w;
|
public World w;
|
||||||
public int x, y, z;
|
public int x;
|
||||||
|
public int y;
|
||||||
|
public int z;
|
||||||
public ForgeDirection side;
|
public ForgeDirection side;
|
||||||
final public boolean isItem;
|
final public boolean isItem;
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
|||||||
|
|
||||||
for (int w = 0; w < 7; w++)
|
for (int w = 0; w < 7; w++)
|
||||||
for (int z = 0; z < 9; z++)
|
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 zz = 0; zz < 3; zz++)
|
||||||
for (int z = 0; z < 8; z++)
|
for (int z = 0; z < 8; z++)
|
||||||
|
|||||||
@@ -33,21 +33,47 @@ import appeng.container.slot.SlotRestrictedInput;
|
|||||||
import appeng.tile.storage.TileIOPort;
|
import appeng.tile.storage.TileIOPort;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class ContainerIOPort extends ContainerUpgradeable
|
public class ContainerIOPort extends ContainerUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
final TileIOPort ioPort;
|
final TileIOPort ioPort;
|
||||||
|
|
||||||
@GuiSync(2)
|
@GuiSync( 2 )
|
||||||
public FullnessMode fMode = FullnessMode.EMPTY;
|
public FullnessMode fMode = FullnessMode.EMPTY;
|
||||||
@GuiSync(3)
|
@GuiSync( 3 )
|
||||||
public OperationMode opMode = OperationMode.EMPTY;
|
public OperationMode opMode = OperationMode.EMPTY;
|
||||||
|
|
||||||
public ContainerIOPort(InventoryPlayer ip, TileIOPort te) {
|
public ContainerIOPort( InventoryPlayer ip, TileIOPort te )
|
||||||
|
{
|
||||||
super( ip, te );
|
super( ip, te );
|
||||||
this.ioPort = 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
|
@Override
|
||||||
protected int getHeight()
|
protected int getHeight()
|
||||||
{
|
{
|
||||||
@@ -66,30 +92,6 @@ public class ContainerIOPort extends ContainerUpgradeable
|
|||||||
return false;
|
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
|
@Override
|
||||||
public void detectAndSendChanges()
|
public void detectAndSendChanges()
|
||||||
{
|
{
|
||||||
@@ -104,5 +106,4 @@ public class ContainerIOPort extends ContainerUpgradeable
|
|||||||
|
|
||||||
this.standardDetectAndSendChanges();
|
this.standardDetectAndSendChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
|||||||
IBiometricCard bc = (IBiometricCard) a.getItem();
|
IBiometricCard bc = (IBiometricCard) a.getItem();
|
||||||
|
|
||||||
for (SecurityPermissions sp : bc.getPermissions( a ))
|
for (SecurityPermissions sp : bc.getPermissions( a ))
|
||||||
this.security = this.security | (1 << sp.ordinal());
|
this.security |= ( 1 << sp.ordinal() );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updatePowerStatus();
|
this.updatePowerStatus();
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
|||||||
this.upgradeable = te;
|
this.upgradeable = te;
|
||||||
|
|
||||||
World w = null;
|
World w = null;
|
||||||
int xCoord = 0, yCoord = 0, zCoord = 0;
|
int xCoord = 0;
|
||||||
|
int yCoord = 0;
|
||||||
|
int zCoord = 0;
|
||||||
|
|
||||||
if ( te instanceof TileEntity )
|
if ( te instanceof TileEntity )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
|||||||
{
|
{
|
||||||
super.onPickupFromSlot( p, is );
|
super.onPickupFromSlot( p, is );
|
||||||
// actually necessary to cleanup this case...
|
// actually necessary to cleanup this case...
|
||||||
p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() );
|
p.openContainer.onCraftMatrixChanged( this.craftInv );
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shouldn't be necessary...
|
// shouldn't be necessary...
|
||||||
p.openContainer.onCraftMatrixChanged( this.getCraftingMatrix() );
|
p.openContainer.onCraftMatrixChanged( this.craftInv );
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
@@ -178,10 +178,12 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
|||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
{
|
{
|
||||||
// set new items onto the crafting table...
|
// 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 )
|
if ( this.craftInv.getStackInSlot( x ) == null )
|
||||||
this.getCraftingMatrix().setInventorySlotContents( x, set[x] );
|
{
|
||||||
|
this.craftInv.setInventorySlotContents( x, set[x] );
|
||||||
|
}
|
||||||
else if ( set[x] != null )
|
else if ( set[x] != null )
|
||||||
{
|
{
|
||||||
// eek! put it back!
|
// eek! put it back!
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
|||||||
|
|
||||||
public final int IIcon;
|
public final int IIcon;
|
||||||
|
|
||||||
private PlacableItemType(int o) {
|
PlacableItemType( int o ) {
|
||||||
this.IIcon = 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 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 VERSION = "@version@";
|
||||||
public static final String CHANNEL = "@aechannel@";
|
public static final String CHANNEL = "@aechannel@";
|
||||||
|
|
||||||
@@ -149,7 +146,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
public boolean disableColoredCableRecipesInNEI = true;
|
public boolean disableColoredCableRecipesInNEI = true;
|
||||||
|
|
||||||
public boolean updatable = false;
|
public boolean updatable = false;
|
||||||
final private File myPath;
|
final private File configFile;
|
||||||
|
|
||||||
public double meteoriteClusterChance = 0.1;
|
public double meteoriteClusterChance = 0.1;
|
||||||
public double meteoriteSpawnChance = 0.3;
|
public double meteoriteSpawnChance = 0.3;
|
||||||
@@ -224,22 +221,20 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
|
|
||||||
public String getFilePath()
|
public String getFilePath()
|
||||||
{
|
{
|
||||||
return this.myPath.toString();
|
return this.configFile.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AEConfig(String path) {
|
public AEConfig( File configFile ) {
|
||||||
super( new File( path + "AppliedEnergistics2.cfg" ) );
|
super( configFile );
|
||||||
this.myPath = new File( path + "AppliedEnergistics2.cfg" );
|
this.configFile = configFile;
|
||||||
|
|
||||||
FMLCommonHandler.instance().bus().register( this );
|
FMLCommonHandler.instance().bus().register( this );
|
||||||
|
|
||||||
final double DEFAULT_BC_EXCHANGE = 5.0;
|
|
||||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||||
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
||||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||||
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
|
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.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.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 );
|
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 );
|
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;
|
this.updatable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,12 +393,6 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
@Override
|
@Override
|
||||||
public void save()
|
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 ) )
|
if ( this.isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||||
{
|
{
|
||||||
this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID );
|
this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID );
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import appeng.core.features.AEFeature;
|
|||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class AELog
|
public final class AELog
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final FMLRelaunchLog instance = FMLRelaunchLog.log;
|
public static final FMLRelaunchLog instance = FMLRelaunchLog.log;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import appeng.me.GridConnection;
|
|||||||
import appeng.me.GridNode;
|
import appeng.me.GridNode;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class Api implements IAppEngApi
|
public final class Api implements IAppEngApi
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final Api INSTANCE = new Api();
|
public static final Api INSTANCE = new Api();
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ package appeng.core;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.google.common.base.Stopwatch;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Mod;
|
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.event.FMLServerStoppingEvent;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
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.CrashInfo;
|
||||||
|
import appeng.core.crash.IntegrationCrashEnhancement;
|
||||||
|
import appeng.core.crash.ModCrashEnhancement;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.core.sync.network.NetworkHandler;
|
import appeng.core.sync.network.NetworkHandler;
|
||||||
@@ -47,6 +48,7 @@ import appeng.integration.IntegrationRegistry;
|
|||||||
import appeng.integration.IntegrationType;
|
import appeng.integration.IntegrationType;
|
||||||
import appeng.server.AECommand;
|
import appeng.server.AECommand;
|
||||||
import appeng.services.VersionChecker;
|
import appeng.services.VersionChecker;
|
||||||
|
import appeng.services.version.VersionCheckerConfig;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
@@ -70,7 +72,7 @@ public class AppEng
|
|||||||
|
|
||||||
private final IMCHandler imcHandler;
|
private final IMCHandler imcHandler;
|
||||||
|
|
||||||
private String configPath;
|
private File configDirectory;
|
||||||
|
|
||||||
public AppEng()
|
public AppEng()
|
||||||
{
|
{
|
||||||
@@ -78,12 +80,12 @@ public class AppEng
|
|||||||
|
|
||||||
this.imcHandler = new IMCHandler();
|
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 )
|
public boolean isIntegrationEnabled( IntegrationType integrationName )
|
||||||
@@ -104,11 +106,16 @@ public class AppEng
|
|||||||
CommonHelper.proxy.missingCoreMod();
|
CommonHelper.proxy.missingCoreMod();
|
||||||
}
|
}
|
||||||
|
|
||||||
Stopwatch star = Stopwatch.createStarted();
|
Stopwatch watch = Stopwatch.createStarted();
|
||||||
this.configPath = event.getModConfigurationDirectory().getPath() + File.separator + "AppliedEnergistics2" + File.separator;
|
this.configDirectory = new File(event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2");
|
||||||
|
|
||||||
AEConfig.instance = new AEConfig( this.configPath );
|
final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg");
|
||||||
FacadeConfig.instance = new FacadeConfig( this.configPath );
|
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 )" );
|
AELog.info( "Pre Initialization ( started )" );
|
||||||
|
|
||||||
@@ -121,19 +128,23 @@ public class AppEng
|
|||||||
|
|
||||||
Registration.INSTANCE.preInitialize( event );
|
Registration.INSTANCE.preInitialize( event );
|
||||||
|
|
||||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.VersionChecker ) )
|
if ( versionCheckerConfig.isEnabled() )
|
||||||
{
|
{
|
||||||
AELog.info( "Starting VersionChecker" );
|
final VersionChecker versionChecker = new VersionChecker( versionCheckerConfig );
|
||||||
this.startService( "AE2 VersionChecker", new Thread( new VersionChecker() ) );
|
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 )
|
private void startService( String serviceName, Thread thread )
|
||||||
{
|
{
|
||||||
thread.setName( serviceName );
|
thread.setName( serviceName );
|
||||||
thread.setPriority( Thread.MIN_PRIORITY );
|
thread.setPriority( Thread.MIN_PRIORITY );
|
||||||
|
|
||||||
|
AELog.info( "Starting " + serviceName );
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +168,7 @@ public class AppEng
|
|||||||
|
|
||||||
Registration.INSTANCE.postInit( event );
|
Registration.INSTANCE.postInit( event );
|
||||||
IntegrationRegistry.INSTANCE.postInit();
|
IntegrationRegistry.INSTANCE.postInit();
|
||||||
FMLCommonHandler.instance().registerCrashCallable( new CrashEnhancement( CrashInfo.INTEGRATION ) );
|
FMLCommonHandler.instance().registerCrashCallable( new IntegrationCrashEnhancement() );
|
||||||
|
|
||||||
CommonHelper.proxy.postInit();
|
CommonHelper.proxy.postInit();
|
||||||
AEConfig.instance.save();
|
AEConfig.instance.save();
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public class FacadeConfig extends Configuration
|
|||||||
public static FacadeConfig instance;
|
public static FacadeConfig instance;
|
||||||
final Pattern replacementPattern;
|
final Pattern replacementPattern;
|
||||||
|
|
||||||
public FacadeConfig(String path) {
|
public FacadeConfig( File facadeFile ) {
|
||||||
super( new File( path + "Facades.cfg" ) );
|
super( facadeFile );
|
||||||
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
|
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ package appeng.core;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
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.item.crafting.CraftingManager;
|
||||||
import net.minecraft.util.WeightedRandomChestContent;
|
import net.minecraft.util.WeightedRandomChestContent;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
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.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
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.AEApi;
|
||||||
import appeng.api.IAppEngApi;
|
import appeng.api.IAppEngApi;
|
||||||
import appeng.api.config.Upgrades;
|
import appeng.api.config.Upgrades;
|
||||||
@@ -546,7 +546,7 @@ public final class Registration
|
|||||||
ItemMultiMaterial.instance.makeUnique();
|
ItemMultiMaterial.instance.makeUnique();
|
||||||
|
|
||||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) )
|
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
|
else
|
||||||
this.recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
|
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.UUID;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.CompressedStreamTools;
|
import net.minecraft.nbt.CompressedStreamTools;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
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.Configuration;
|
||||||
import net.minecraftforge.common.config.Property;
|
import net.minecraftforge.common.config.Property;
|
||||||
|
|
||||||
|
import com.google.common.base.Optional;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import appeng.api.util.WorldCoord;
|
import appeng.api.util.WorldCoord;
|
||||||
import appeng.core.sync.network.NetworkHandler;
|
import appeng.core.sync.network.NetworkHandler;
|
||||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||||
@@ -61,7 +61,7 @@ public class WorldSettings extends Configuration
|
|||||||
|
|
||||||
private static WorldSettings instance;
|
private static WorldSettings instance;
|
||||||
private final List<Integer> storageCellDims = new ArrayList<Integer>();
|
private final List<Integer> storageCellDims = new ArrayList<Integer>();
|
||||||
private final File aeFolder;
|
private final File spawnDataFolder;
|
||||||
private final CompassService compass;
|
private final CompassService compass;
|
||||||
private final PlayerMappings mappings;
|
private final PlayerMappings mappings;
|
||||||
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
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 )
|
public WorldSettings( File aeFolder )
|
||||||
{
|
{
|
||||||
super( new File( aeFolder.getPath() + File.separatorChar + "settings.cfg" ) );
|
super( new File( aeFolder.getPath(), "settings.cfg" ) );
|
||||||
this.aeFolder = aeFolder;
|
this.spawnDataFolder = new File( aeFolder, SPAWNDATA_FOLDER );
|
||||||
this.compass = new CompassService( aeFolder );
|
this.compass = new CompassService( aeFolder );
|
||||||
|
|
||||||
for ( int dimID : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
|
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 world = DimensionManager.getCurrentSaveRootDirectory();
|
||||||
|
|
||||||
File aeBaseFolder = new File( world.getPath() + File.separatorChar + "AE2" );
|
File aeBaseFolder = new File( world.getPath(), "AE2" );
|
||||||
|
|
||||||
if ( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
|
if ( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,7 @@ public class WorldSettings extends Configuration
|
|||||||
throw new RuntimeException( "Invalid Request" );
|
throw new RuntimeException( "Invalid Request" );
|
||||||
|
|
||||||
NBTTagCompound data = null;
|
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() )
|
if ( file.isFile() )
|
||||||
{
|
{
|
||||||
@@ -227,7 +227,7 @@ public class WorldSettings extends Configuration
|
|||||||
if ( !Thread.holdsLock( WorldSettings.class ) )
|
if ( !Thread.holdsLock( WorldSettings.class ) )
|
||||||
throw new RuntimeException( "Invalid Request" );
|
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;
|
FileOutputStream fileOutputStream = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -402,7 +402,8 @@ public class WorldSettings extends Configuration
|
|||||||
|
|
||||||
private long nextGridStorage()
|
private long nextGridStorage()
|
||||||
{
|
{
|
||||||
long r = this.lastGridStorage++;
|
long r = this.lastGridStorage;
|
||||||
|
this.lastGridStorage++;
|
||||||
this.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) );
|
this.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) );
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -444,7 +445,8 @@ public class WorldSettings extends Configuration
|
|||||||
|
|
||||||
private long nextPlayer()
|
private long nextPlayer()
|
||||||
{
|
{
|
||||||
long r = this.lastPlayer++;
|
long r = this.lastPlayer;
|
||||||
|
this.lastPlayer++;
|
||||||
this.get( "Counters", "lastPlayer", this.lastPlayer ).set( this.lastPlayer );
|
this.get( "Counters", "lastPlayer", this.lastPlayer ).set( this.lastPlayer );
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-31
@@ -21,52 +21,27 @@ package appeng.core.crash;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.ICrashCallable;
|
import cpw.mods.fml.common.ICrashCallable;
|
||||||
|
|
||||||
import appeng.core.AEConfig;
|
|
||||||
import appeng.integration.IntegrationRegistry;
|
|
||||||
|
|
||||||
|
abstract class BaseCrashEnhancement implements ICrashCallable
|
||||||
public class CrashEnhancement implements ICrashCallable
|
|
||||||
{
|
{
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private final String ModVersion = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
|
public BaseCrashEnhancement( String name, String value )
|
||||||
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 )
|
|
||||||
{
|
{
|
||||||
|
this.name = name;
|
||||||
if ( Output == CrashInfo.MOD_VERSION )
|
this.value = value;
|
||||||
{
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String call() throws Exception
|
public final String call() throws Exception
|
||||||
{
|
{
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLabel()
|
public final String getLabel()
|
||||||
{
|
{
|
||||||
return this.name;
|
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"),
|
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),
|
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 isVisible;
|
||||||
public final boolean defaultValue;
|
public final boolean defaultValue;
|
||||||
|
|
||||||
private AEFeature(String cat) {
|
AEFeature( String cat ) {
|
||||||
this.category = cat;
|
this.category = cat;
|
||||||
this.isVisible = !this.name().equals( "Core" );
|
this.isVisible = !this.name().equals( "Core" );
|
||||||
this.defaultValue = true;
|
this.defaultValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AEFeature(String cat, boolean defaultValue) {
|
AEFeature( String cat, boolean defaultValue ) {
|
||||||
this.category = cat;
|
this.category = cat;
|
||||||
this.isVisible = !this.name().equals( "Core" );
|
this.isVisible = !this.name().equals( "Core" );
|
||||||
this.defaultValue = defaultValue;
|
this.defaultValue = defaultValue;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package appeng.core.features;
|
|||||||
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockStairs;
|
import net.minecraft.block.BlockStairs;
|
||||||
@@ -44,6 +45,10 @@ import appeng.util.Platform;
|
|||||||
public class AEFeatureHandler implements AEItemDefinition
|
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 EnumSet<AEFeature> features;
|
||||||
|
|
||||||
private final String subName;
|
private final String subName;
|
||||||
@@ -149,9 +154,9 @@ public class AEFeatureHandler implements AEItemDefinition
|
|||||||
String name = o.getSimpleName();
|
String name = o.getSimpleName();
|
||||||
|
|
||||||
if ( name.startsWith( "ItemMultiPart" ) )
|
if ( name.startsWith( "ItemMultiPart" ) )
|
||||||
name = name.replace( "ItemMultiPart", "ItemPart" );
|
name = PATTERN_ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
|
||||||
else if ( name.startsWith( "ItemMultiMaterial" ) )
|
else if ( name.startsWith( "ItemMultiMaterial" ) )
|
||||||
name = name.replace( "ItemMultiMaterial", "ItemMaterial" );
|
name = PATTERN_ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
|
||||||
|
|
||||||
if ( subName != null )
|
if ( subName != null )
|
||||||
{
|
{
|
||||||
@@ -161,9 +166,9 @@ public class AEFeatureHandler implements AEItemDefinition
|
|||||||
return "ItemPart.P2PTunnel";
|
return "ItemPart.P2PTunnel";
|
||||||
|
|
||||||
if ( subName.equals( "CertusQuartzTools" ) )
|
if ( subName.equals( "CertusQuartzTools" ) )
|
||||||
return name.replace( "Quartz", "CertusQuartz" );
|
return PATTERN_QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
|
||||||
if ( subName.equals( "NetherQuartzTools" ) )
|
if ( subName.equals( "NetherQuartzTools" ) )
|
||||||
return name.replace( "Quartz", "NetherQuartz" );
|
return PATTERN_QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
|
||||||
|
|
||||||
name += '.' + subName;
|
name += '.' + subName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,17 @@
|
|||||||
package appeng.core.features;
|
package appeng.core.features;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
|
|
||||||
|
|
||||||
public class FeatureNameExtractor
|
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 Class<?> clazz;
|
||||||
private final Optional<String> subName;
|
private final Optional<String> subName;
|
||||||
|
|
||||||
@@ -39,11 +45,11 @@ public class FeatureNameExtractor
|
|||||||
|
|
||||||
if ( name.startsWith( "ItemMultiPart" ) )
|
if ( name.startsWith( "ItemMultiPart" ) )
|
||||||
{
|
{
|
||||||
name = name.replace( "ItemMultiPart", "ItemPart" );
|
name = PATTERN_ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
|
||||||
}
|
}
|
||||||
else if ( name.startsWith( "ItemMultiMaterial" ) )
|
else if ( name.startsWith( "ItemMultiMaterial" ) )
|
||||||
{
|
{
|
||||||
name = name.replace( "ItemMultiMaterial", "ItemMaterial" );
|
name = PATTERN_ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.subName.isPresent() )
|
if ( this.subName.isPresent() )
|
||||||
@@ -57,11 +63,11 @@ public class FeatureNameExtractor
|
|||||||
}
|
}
|
||||||
else if ( subName.equals( "CertusQuartzTools" ) )
|
else if ( subName.equals( "CertusQuartzTools" ) )
|
||||||
{
|
{
|
||||||
return name.replace( "Quartz", "CertusQuartz" );
|
return PATTERN_QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
|
||||||
}
|
}
|
||||||
else if ( subName.equals( "NetherQuartzTools" ) )
|
else if ( subName.equals( "NetherQuartzTools" ) )
|
||||||
{
|
{
|
||||||
return name.replace( "Quartz", "NetherQuartz" );
|
return PATTERN_QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
|
||||||
}
|
}
|
||||||
|
|
||||||
name += '.' + subName;
|
name += '.' + subName;
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public final class LocatableRegistry implements ILocatableRegistry
|
|||||||
* Find a locate-able object by its serial.
|
* Find a locate-able object by its serial.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public Object findLocatableBySerial( long ser )
|
public Object findLocatableBySerial( long ser )
|
||||||
{
|
{
|
||||||
return this.set.get( ser );
|
return this.set.get( ser );
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import net.minecraft.world.WorldProvider;
|
|||||||
|
|
||||||
import appeng.api.features.IWorldGen;
|
import appeng.api.features.IWorldGen;
|
||||||
|
|
||||||
public class WorldGenRegistry implements IWorldGen
|
public final class WorldGenRegistry implements IWorldGen
|
||||||
{
|
{
|
||||||
|
|
||||||
private static class TypeSet
|
private static class TypeSet
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public enum TickRates
|
|||||||
public int min;
|
public int min;
|
||||||
public int max;
|
public int max;
|
||||||
|
|
||||||
private TickRates(int min, int max) {
|
TickRates( int min, int max ) {
|
||||||
this.min = min;
|
this.min = min;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ public enum Achievements
|
|||||||
|
|
||||||
public final ItemStack stack;
|
public final ItemStack stack;
|
||||||
public final AchievementType type;
|
public final AchievementType type;
|
||||||
private final int x, y;
|
private final int x;
|
||||||
|
private final int y;
|
||||||
|
|
||||||
private Achievement parent;
|
private Achievement parent;
|
||||||
private Achievement stat;
|
private Achievement stat;
|
||||||
@@ -130,7 +131,7 @@ public enum Achievements
|
|||||||
return this.stat;
|
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.stack = (which != null) ? which.stack( AEColor.Transparent, 1 ) : null;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@@ -138,7 +139,7 @@ public enum Achievements
|
|||||||
this.y = y;
|
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.stack = (which != null) ? which.stack( 1 ) : null;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@@ -146,7 +147,7 @@ public enum Achievements
|
|||||||
this.y = y;
|
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.stack = which;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class PlayerStatsRegistration
|
|||||||
private final boolean isAchievementFeatureEnabled;
|
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 bus {@see #bus}
|
||||||
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
|
* @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;
|
return this.stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Stats() {
|
Stats() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToPlayer(EntityPlayer player, int howMany)
|
public void addToPlayer(EntityPlayer player, int howMany)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package appeng.core.sync;
|
package appeng.core.sync;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.HashMap;
|
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.PacketTransitionEffect;
|
||||||
import appeng.core.sync.packets.PacketValueConfig;
|
import appeng.core.sync.packets.PacketValueConfig;
|
||||||
|
|
||||||
|
|
||||||
public class AppEngPacketHandlerBase
|
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
|
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;
|
private final Class<? extends AppEngPacket> packetClass;
|
||||||
final public Constructor con;
|
private final Constructor<? extends AppEngPacket> packetConstructor;
|
||||||
|
|
||||||
private PacketTypes(Class c) {
|
PacketTypes( Class<? extends AppEngPacket> c )
|
||||||
this.pc = c;
|
{
|
||||||
|
this.packetClass = c;
|
||||||
|
|
||||||
Constructor x = null;
|
Constructor<? extends AppEngPacket> x = null;
|
||||||
try
|
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;
|
this.packetConstructor = x;
|
||||||
AppEngPacketHandlerBase.REVERSE_LOOKUP.put( this.pc, this );
|
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" );
|
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;
|
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;
|
import java.lang.reflect.Constructor;
|
||||||
|
|
||||||
@@ -118,6 +115,10 @@ import appeng.tile.storage.TileIOPort;
|
|||||||
import appeng.tile.storage.TileSkyChest;
|
import appeng.tile.storage.TileSkyChest;
|
||||||
import appeng.util.Platform;
|
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
|
public enum GuiBridge implements IGuiHandler
|
||||||
{
|
{
|
||||||
GUI_Handler(),
|
GUI_Handler(),
|
||||||
@@ -195,7 +196,7 @@ public enum GuiBridge implements IGuiHandler
|
|||||||
private GuiHostType type;
|
private GuiHostType type;
|
||||||
private SecurityPermissions requiredPermission;
|
private SecurityPermissions requiredPermission;
|
||||||
|
|
||||||
private GuiBridge() {
|
GuiBridge() {
|
||||||
this.Tile = null;
|
this.Tile = null;
|
||||||
this.Gui = null;
|
this.Gui = null;
|
||||||
this.Container = null;
|
this.Container = null;
|
||||||
@@ -209,24 +210,25 @@ public enum GuiBridge implements IGuiHandler
|
|||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
{
|
{
|
||||||
String start = this.Container.getName();
|
final String start = this.Container.getName();
|
||||||
String GuiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
|
String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
|
||||||
if ( start.equals( GuiClass ) )
|
|
||||||
|
if ( start.equals( guiClass ) )
|
||||||
throw new RuntimeException( "Unable to find gui class" );
|
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 )
|
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.requiredPermission = requiredPermission;
|
||||||
this.Container = _Container;
|
this.Container = _Container;
|
||||||
this.Tile = null;
|
this.Tile = null;
|
||||||
this.getGui();
|
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.requiredPermission = requiredPermission;
|
||||||
this.Container = _Container;
|
this.Container = _Container;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ import appeng.util.item.AEItemStack;
|
|||||||
public class PacketAssemblerAnimation extends AppEngPacket
|
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 byte rate;
|
||||||
final public IAEItemStack is;
|
final public IAEItemStack is;
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,15 @@ import appeng.core.WorldSettings;
|
|||||||
import appeng.core.sync.AppEngPacket;
|
import appeng.core.sync.AppEngPacket;
|
||||||
import appeng.core.sync.network.INetworkInfo;
|
import appeng.core.sync.network.INetworkInfo;
|
||||||
import appeng.core.sync.network.NetworkHandler;
|
import appeng.core.sync.network.NetworkHandler;
|
||||||
import appeng.services.helpers.ICompassCallback;
|
import appeng.services.compass.ICompassCallback;
|
||||||
|
|
||||||
public class PacketCompassRequest extends AppEngPacket implements ICompassCallback
|
public class PacketCompassRequest extends AppEngPacket implements ICompassCallback
|
||||||
{
|
{
|
||||||
|
|
||||||
final public long attunement;
|
final public long attunement;
|
||||||
final public int cx, cz, cdy;
|
final public int cx;
|
||||||
|
final public int cz;
|
||||||
|
final public int cdy;
|
||||||
|
|
||||||
EntityPlayer talkBackTo;
|
EntityPlayer talkBackTo;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ public class PacketCompassResponse extends AppEngPacket
|
|||||||
{
|
{
|
||||||
|
|
||||||
final public long attunement;
|
final public long attunement;
|
||||||
final public int cx, cz, cdy;
|
final public int cx;
|
||||||
|
final public int cz;
|
||||||
|
final public int cdy;
|
||||||
|
|
||||||
public CompassResult cr;
|
public CompassResult cr;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user