Compare commits
106 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db7296c0a1 | |||
| d1f2625262 | |||
| b756a3f564 | |||
| dfa595ad2a | |||
| 0519f60cb0 | |||
| 81c32d5181 | |||
| b609b08f98 | |||
| 50f141edbd | |||
| 0542a58e4b | |||
| 58db877006 | |||
| dff3364eb5 | |||
| 88310cf04b | |||
| d81eb1fe2d | |||
| d8f452b665 | |||
| ec05bd994c | |||
| dff48c07c9 | |||
| 234d97b8ce | |||
| 9bf8b4388f | |||
| b31f2df58d | |||
| 14df50dbf3 | |||
| 6aeca93b85 | |||
| 3143c871d0 | |||
| 7f7c71a22e | |||
| 05f522580b | |||
| 926af89029 | |||
| f1248c4c33 | |||
| bd2ee1c5ea | |||
| 8ef286b9d6 | |||
| 4b4693498d | |||
| e41d6a0289 | |||
| c8d716d39f | |||
| 33c1535bfa | |||
| 1067d30264 | |||
| 96145e75f4 | |||
| 2ba6dad3b2 | |||
| a870393edb | |||
| d04bc2fb3c | |||
| 9d52e85afa | |||
| 3745e6ce8d | |||
| a4c38263d1 | |||
| c1a7a35192 | |||
| eb98ec891b | |||
| 69a5507f96 | |||
| a1f43ff51a | |||
| da91585d69 | |||
| f138a68f3e | |||
| 30191eb5ba | |||
| 4552394f6e | |||
| 9c3d3db3fb | |||
| 9c1c9056f1 | |||
| b5582688a3 | |||
| 34597a4e21 | |||
| e0b32d2641 | |||
| 6baf952904 | |||
| f132ae3678 | |||
| 720b38442e | |||
| 136f5d7314 | |||
| a83e4b7c3d | |||
| 1bb0109c45 | |||
| 4744dfab78 | |||
| 7dedd4700f | |||
| 95fb894ba3 | |||
| 621ddc5535 | |||
| ece09a956b | |||
| db5493f60b | |||
| f0482dd391 | |||
| c53b3b5dfc | |||
| ad16550a86 | |||
| 99e4928542 | |||
| 43995a4b32 | |||
| 8ec9bb8b3b | |||
| 18c8197ff4 | |||
| dd1ca1e286 | |||
| c9f0b4e489 | |||
| 63a6037ad2 | |||
| 3675f154d1 | |||
| 5e5be0e192 | |||
| e300bf93fd | |||
| cdf949a557 | |||
| 4c5aeac39f | |||
| a5f58bb22f | |||
| dddfd6dbaf | |||
| 53f448e578 | |||
| 311939c63c | |||
| d8a3556bc3 | |||
| 57e84c3039 | |||
| 1bcf7f9d52 | |||
| 2746002eb1 | |||
| ee6a3def22 | |||
| 0b15c56037 | |||
| 39c26a72e2 | |||
| d2f62ef98c | |||
| 6476a519bb | |||
| b8e2d73aa0 | |||
| 5a2b35ccd0 | |||
| 16218e46ec | |||
| 27b692823c | |||
| 68aaec16bc | |||
| ec8d393403 | |||
| 27e5eac6aa | |||
| ca521935e0 | |||
| f60798129c | |||
| 3e90f354c5 | |||
| a27ed6d9ba | |||
| b18addbf37 | |||
| 3fa501d726 |
@@ -1,6 +1,6 @@
|
|||||||
# Applied Energistics 2
|
# Applied Energistics 2
|
||||||
|
|
||||||
## Table of Content
|
## Table of Contents
|
||||||
|
|
||||||
* [About](#about)
|
* [About](#about)
|
||||||
* [Contacts](#contacts)
|
* [Contacts](#contacts)
|
||||||
@@ -31,7 +31,7 @@ Applied Energistics 2 API is (c) 2013 - 2014 AlgorithmX2 and licensed under MIT.
|
|||||||
Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3.
|
Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3.
|
||||||
See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information.
|
See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information.
|
||||||
|
|
||||||
Textures and Models are licensed under Creative Commons 3.
|
Textures and Models are licensed under [Creative Commons, Attribution-NonCommercial-ShareAlike 3.0]( https://creativecommons.org/licenses/by-nc-sa/3.0/).
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -8,17 +8,17 @@ archivesBaseName=appliedenergistics2
|
|||||||
# Versions #
|
# Versions #
|
||||||
#########################################################
|
#########################################################
|
||||||
minecraft_version=1.7.10
|
minecraft_version=1.7.10
|
||||||
forge_version=10.13.2.1230
|
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.0.311
|
fmp_version=1.1.1.324
|
||||||
code_chicken_lib_version=1.1.1.105
|
code_chicken_lib_version=1.1.3.127
|
||||||
code_chicken_core_version=1.0.4.29
|
code_chicken_core_version=1.0.4.35
|
||||||
nei_version=1.0.3.66
|
nei_version=1.0.4.90
|
||||||
waila_version=1.5.7a_1.7.10
|
bc_version=6.4.3
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# API Stubs #
|
# API Stubs #
|
||||||
@@ -32,10 +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=1
|
||||||
dev_buildcraft_version=1
|
api_waila_version=1.5.10_1.7.10
|
||||||
@@ -10,25 +10,3 @@ task copyChicken(type: Copy, dependsOn: "extractUserDev") {
|
|||||||
}
|
}
|
||||||
tasks.setupDevWorkspace.dependsOn copyChicken
|
tasks.setupDevWorkspace.dependsOn copyChicken
|
||||||
tasks.setupDecompWorkspace.dependsOn copyChicken
|
tasks.setupDecompWorkspace.dependsOn copyChicken
|
||||||
|
|
||||||
// same for BC hacked file
|
|
||||||
task copyBuildcraft(type: Copy, dependsOn: "extractUserDev") {
|
|
||||||
from { configurations.compile }
|
|
||||||
include "**/*buildcraft*.jar"
|
|
||||||
into file(minecraft.runDir + "/mods")
|
|
||||||
mustRunAfter "deobfBinJar"
|
|
||||||
mustRunAfter "repackMinecraft"
|
|
||||||
}
|
|
||||||
tasks.setupDevWorkspace.dependsOn copyBuildcraft
|
|
||||||
tasks.setupDecompWorkspace.dependsOn copyBuildcraft
|
|
||||||
|
|
||||||
// and for IC2 because it needs its EMLJ jar
|
|
||||||
task copyIndustrialcraft(type: Copy, dependsOn: "extractUserDev") {
|
|
||||||
from { configurations.compile }
|
|
||||||
include "**/*industrialcraft*.jar"
|
|
||||||
into file(minecraft.runDir + "/mods")
|
|
||||||
mustRunAfter "deobfBinJar"
|
|
||||||
mustRunAfter "repackMinecraft"
|
|
||||||
}
|
|
||||||
tasks.setupDevWorkspace.dependsOn copyIndustrialcraft
|
|
||||||
tasks.setupDecompWorkspace.dependsOn copyIndustrialcraft
|
|
||||||
@@ -43,24 +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"
|
||||||
|
|
||||||
|
// 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(group: 'api', name: 'rotarycraft', version: "${config.api_rotarycraft_version}")
|
||||||
compile(group: 'dev', name: 'buildcraft', version: "${config.dev_buildcraft_version}")
|
compile "appeng:Waila:${config.api_waila_version}:api"
|
||||||
|
|
||||||
// add hacked buildcraft jar to compile time (for facades)
|
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
|
||||||
|
|
||||||
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,19 +23,31 @@
|
|||||||
|
|
||||||
package appeng.api.features;
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Registry for locatable items, works based on serial numbers.
|
* A Registry for locatable items, works based on serial numbers.
|
||||||
*/
|
*/
|
||||||
public interface ILocatableRegistry
|
public interface ILocatableRegistry
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to find the object with the serial specified, if it can it
|
* Attempts to find the object with the serial specified, if it can it
|
||||||
* returns the object.
|
* returns the object.
|
||||||
*
|
*
|
||||||
* @param serial serial
|
* @param serial serial
|
||||||
|
*
|
||||||
* @return requestedObject, or null
|
* @return requestedObject, or null
|
||||||
|
*
|
||||||
|
* @deprecated use {@link ILocatableRegistry#getLocatableBy(long)}
|
||||||
*/
|
*/
|
||||||
public abstract Object findLocatableBySerial(long serial);
|
@Deprecated
|
||||||
|
Object findLocatableBySerial( long serial );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the {@link ILocatable} with the registered serial, if available
|
||||||
|
*
|
||||||
|
* @param serial serial
|
||||||
|
*
|
||||||
|
* @return requestedObject, or null, if the object does not exist anymore
|
||||||
|
*/
|
||||||
|
ILocatable getLocatableBy( long serial );
|
||||||
}
|
}
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class DimensionalCoord extends WorldCoord
|
|||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return this.dimId + "," + super.toString();
|
return "dimension=" + this.dimId + ", " + super.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public World getWorld()
|
public World getWorld()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class WorldCoord
|
|||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return "" + this.x + "," + this.y + "," + this.z;
|
return "x=" + this.x + ", y=" + this.y + ", z=" + this.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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,24 +25,26 @@ 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;
|
||||||
import appeng.api.config.ViewItems;
|
import appeng.api.config.ViewItems;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
|
import appeng.api.util.AEColor;
|
||||||
import appeng.client.gui.AEBaseGui;
|
import appeng.client.gui.AEBaseGui;
|
||||||
import appeng.client.gui.widgets.GuiScrollbar;
|
import appeng.client.gui.widgets.GuiScrollbar;
|
||||||
import appeng.client.gui.widgets.ISortSource;
|
import appeng.client.gui.widgets.ISortSource;
|
||||||
import appeng.container.implementations.ContainerCraftingCPU;
|
import appeng.container.implementations.ContainerCraftingCPU;
|
||||||
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
import appeng.core.localization.GuiText;
|
import appeng.core.localization.GuiText;
|
||||||
import appeng.core.sync.network.NetworkHandler;
|
import appeng.core.sync.network.NetworkHandler;
|
||||||
@@ -307,13 +309,31 @@ 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;
|
||||||
|
boolean scheduled = false;
|
||||||
|
|
||||||
if ( stored != null && stored.getStackSize() > 0 )
|
if ( stored != null && stored.getStackSize() > 0 )
|
||||||
|
{
|
||||||
lines++;
|
lines++;
|
||||||
|
}
|
||||||
if ( activeStack != null && activeStack.getStackSize() > 0 )
|
if ( activeStack != null && activeStack.getStackSize() > 0 )
|
||||||
|
{
|
||||||
lines++;
|
lines++;
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
if ( pendingStack != null && pendingStack.getStackSize() > 0 )
|
if ( pendingStack != null && pendingStack.getStackSize() > 0 )
|
||||||
|
{
|
||||||
lines++;
|
lines++;
|
||||||
|
scheduled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
|
||||||
|
{
|
||||||
|
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
|
||||||
|
int startX = (x * (1 + sectionLength) + xo) * 2;
|
||||||
|
int startY = ((y * offY + yo) - 3) * 2;
|
||||||
|
drawRect( startX, startY, startX + (sectionLength * 2), startY + (offY * 2) - 2, bgColor);
|
||||||
|
}
|
||||||
|
|
||||||
int negY = ((lines - 1) * 5) / 2;
|
int negY = ((lines - 1) * 5) / 2;
|
||||||
int downY = 0;
|
int downY = 0;
|
||||||
|
|||||||
@@ -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@";
|
||||||
|
|
||||||
@@ -128,12 +125,13 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
// AE
|
// AE
|
||||||
"CertusQuartz", "Wheat", "Fluix",
|
"CertusQuartz", "Wheat", "Fluix",
|
||||||
// Other Mod Ores
|
// Other Mod Ores
|
||||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium" };
|
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium", "Zinc" };
|
||||||
|
|
||||||
public double oreDoublePercentage = 90.0;
|
public double oreDoublePercentage = 90.0;
|
||||||
|
|
||||||
public boolean enableEffects = true;
|
public boolean enableEffects = true;
|
||||||
public boolean useLargeFonts = false;
|
public boolean useLargeFonts = false;
|
||||||
|
public boolean useColoredCraftingStatus;
|
||||||
public final int[] craftByStacks = new int[] { 1, 10, 100, 1000 };
|
public final int[] craftByStacks = new int[] { 1, 10, 100, 1000 };
|
||||||
public final int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
|
public final int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
|
||||||
public final int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
|
public final int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
|
||||||
@@ -148,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;
|
||||||
@@ -156,6 +154,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
|
|
||||||
public int craftingCalculationTimePerTick = 5;
|
public int craftingCalculationTimePerTick = 5;
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
|
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
|
||||||
{
|
{
|
||||||
@@ -170,6 +169,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
|||||||
this.disableColoredCableRecipesInNEI = this.get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true );
|
this.disableColoredCableRecipesInNEI = this.get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true );
|
||||||
this.enableEffects = this.get( "Client", "enableEffects", true ).getBoolean( true );
|
this.enableEffects = this.get( "Client", "enableEffects", true ).getBoolean( true );
|
||||||
this.useLargeFonts = this.get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
|
this.useLargeFonts = this.get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
|
||||||
|
this.useColoredCraftingStatus = this.get( "Client", "useColoredCraftingStatus", true ).getBoolean( true );
|
||||||
|
|
||||||
// load buttons..
|
// load buttons..
|
||||||
for (int btnNum = 0; btnNum < 4; btnNum++)
|
for (int btnNum = 0; btnNum < 4; btnNum++)
|
||||||
@@ -221,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 );
|
||||||
@@ -337,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,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" );
|
||||||
|
|
||||||
@@ -561,15 +561,6 @@ public final class Registration
|
|||||||
ph.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
|
ph.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.MJ5 ) )
|
|
||||||
{
|
|
||||||
ph.registerNewLayer( "appeng.parts.layers.LayerIPowerEmitter", "buildcraft.api.power.IPowerEmitter" );
|
|
||||||
ph.registerNewLayer( "appeng.parts.layers.LayerIPowerReceptor", "buildcraft.api.power.IPowerReceptor" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.MJ6 ) )
|
|
||||||
ph.registerNewLayer( "appeng.parts.layers.LayerIBatteryProvider", "buildcraft.api.mj.IBatteryProvider" );
|
|
||||||
|
|
||||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.RF ) )
|
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.RF ) )
|
||||||
ph.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
|
ph.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-6
@@ -16,16 +16,32 @@
|
|||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package appeng.integration.abstraction;
|
package appeng.core.crash;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
import buildcraft.api.mj.IBatteryObject;
|
import cpw.mods.fml.common.ICrashCallable;
|
||||||
|
|
||||||
public interface IMJ6
|
|
||||||
|
abstract class BaseCrashEnhancement implements ICrashCallable
|
||||||
{
|
{
|
||||||
|
private final String name;
|
||||||
|
private final String value;
|
||||||
|
|
||||||
IBatteryObject provider(TileEntity te, ForgeDirection side);
|
public BaseCrashEnhancement( String name, String value )
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String call() throws Exception
|
||||||
|
{
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String getLabel()
|
||||||
|
{
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Applied Energistics 2.
|
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.core.crash;
|
|
||||||
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.ICrashCallable;
|
|
||||||
|
|
||||||
import appeng.core.AEConfig;
|
|
||||||
import appeng.integration.IntegrationRegistry;
|
|
||||||
|
|
||||||
|
|
||||||
public class CrashEnhancement implements ICrashCallable
|
|
||||||
{
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
private final String value;
|
|
||||||
|
|
||||||
private final String ModVersion = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
|
|
||||||
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
|
|
||||||
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
|
|
||||||
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
|
|
||||||
+ net.minecraftforge.common.ForgeVersion.buildVersion;
|
|
||||||
|
|
||||||
public CrashEnhancement( CrashInfo Output )
|
|
||||||
{
|
|
||||||
|
|
||||||
if ( Output == CrashInfo.MOD_VERSION )
|
|
||||||
{
|
|
||||||
this.name = "AE2 Version";
|
|
||||||
this.value = this.ModVersion;
|
|
||||||
}
|
|
||||||
else if ( Output == CrashInfo.INTEGRATION )
|
|
||||||
{
|
|
||||||
this.name = "AE2 Integration";
|
|
||||||
this.value = IntegrationRegistry.INSTANCE.getStatus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.name = "AE2_UNKNOWN";
|
|
||||||
this.value = "UNKNOWN_VALUE";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String call() throws Exception
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLabel()
|
|
||||||
{
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package appeng.core.crash;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.integration.IntegrationRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
public class IntegrationCrashEnhancement extends BaseCrashEnhancement
|
||||||
|
{
|
||||||
|
public IntegrationCrashEnhancement()
|
||||||
|
{
|
||||||
|
super( "AE2 Integration", IntegrationRegistry.INSTANCE.getStatus() );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package appeng.core.crash;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.core.AEConfig;
|
||||||
|
|
||||||
|
|
||||||
|
public class ModCrashEnhancement extends BaseCrashEnhancement
|
||||||
|
{
|
||||||
|
private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
|
||||||
|
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
|
||||||
|
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
|
||||||
|
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
|
||||||
|
+ net.minecraftforge.common.ForgeVersion.buildVersion;
|
||||||
|
|
||||||
|
public ModCrashEnhancement( CrashInfo output )
|
||||||
|
{
|
||||||
|
super( "AE2 Version", MOD_VERSION );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,7 +62,7 @@ public enum AEFeature
|
|||||||
|
|
||||||
MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"),
|
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;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package appeng.core.features.registries;
|
package appeng.core.features.registries;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -37,20 +38,20 @@ import appeng.recipes.ores.IOreListener;
|
|||||||
import appeng.recipes.ores.OreDictionaryHandler;
|
import appeng.recipes.ores.OreDictionaryHandler;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|
||||||
|
public final class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||||
{
|
{
|
||||||
|
private final List<IGrinderEntry> recipes;
|
||||||
|
private final Map<ItemStack, String> ores;
|
||||||
|
private final Map<ItemStack, String> ingots;
|
||||||
|
private final Map<String, ItemStack> dusts;
|
||||||
|
|
||||||
public final List<IGrinderEntry> RecipeList;
|
public GrinderRecipeManager()
|
||||||
|
|
||||||
private ItemStack copy(ItemStack is)
|
|
||||||
{
|
{
|
||||||
if ( is != null )
|
this.recipes = new ArrayList<IGrinderEntry>();
|
||||||
return is.copy();
|
this.ores = new HashMap<ItemStack, String>();
|
||||||
return null;
|
this.ingots = new HashMap<ItemStack, String>();
|
||||||
}
|
this.dusts = new HashMap<String, ItemStack>();
|
||||||
|
|
||||||
public GrinderRecipeManager() {
|
|
||||||
this.RecipeList = new ArrayList<IGrinderEntry>();
|
|
||||||
|
|
||||||
this.addOre( "Coal", new ItemStack( Items.coal ) );
|
this.addOre( "Coal", new ItemStack( Items.coal ) );
|
||||||
this.addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) );
|
this.addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) );
|
||||||
@@ -78,20 +79,11 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
public List<IGrinderEntry> getRecipes()
|
public List<IGrinderEntry> getRecipes()
|
||||||
{
|
{
|
||||||
this.log( "API - getRecipes" );
|
this.log( "API - getRecipes" );
|
||||||
return this.RecipeList;
|
return this.recipes;
|
||||||
}
|
|
||||||
|
|
||||||
private void injectRecipe(AppEngGrinderRecipe appEngGrinderRecipe)
|
|
||||||
{
|
|
||||||
for (IGrinderEntry gr : this.RecipeList)
|
|
||||||
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.RecipeList.add( appEngGrinderRecipe );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRecipe(ItemStack in, ItemStack out, int cost)
|
public void addRecipe( ItemStack in, ItemStack out, int cost )
|
||||||
{
|
{
|
||||||
if ( in == null || out == null )
|
if ( in == null || out == null )
|
||||||
{
|
{
|
||||||
@@ -104,40 +96,54 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, int cost)
|
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int cost )
|
||||||
{
|
{
|
||||||
if ( in == null || (optional == null && out == null) )
|
if ( in == null || ( optional == null && out == null ) )
|
||||||
{
|
{
|
||||||
this.log( "Invalid Grinder Recipe Specified." );
|
this.log( "Invalid Grinder Recipe Specified." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
|
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||||
+ Platform.getItemDisplayName( optional ) + " for " + cost );
|
|
||||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost)
|
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost )
|
||||||
{
|
{
|
||||||
if ( in == null || (optional == null && out == null && optional2 == null) )
|
if ( in == null || ( optional == null && out == null && optional2 == null ) )
|
||||||
{
|
{
|
||||||
this.log( "Invalid Grinder Recipe Specified." );
|
this.log( "Invalid Grinder Recipe Specified." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
|
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||||
+ Platform.getItemDisplayName( optional ) + " for " + cost );
|
|
||||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
|
||||||
|
{
|
||||||
|
for ( IGrinderEntry gr : this.recipes )
|
||||||
|
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.recipes.add( appEngGrinderRecipe );
|
||||||
|
}
|
||||||
|
|
||||||
|
private ItemStack copy( ItemStack is )
|
||||||
|
{
|
||||||
|
if ( is != null )
|
||||||
|
return is.copy();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IGrinderEntry getRecipeForInput(ItemStack input)
|
public IGrinderEntry getRecipeForInput( ItemStack input )
|
||||||
{
|
{
|
||||||
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
|
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
|
||||||
if ( input != null )
|
if ( input != null )
|
||||||
{
|
{
|
||||||
for (IGrinderEntry r : this.RecipeList)
|
for ( IGrinderEntry r : this.recipes )
|
||||||
{
|
{
|
||||||
if ( Platform.isSameItem( input, r.getInput() ) )
|
if ( Platform.isSameItem( input, r.getInput() ) )
|
||||||
{
|
{
|
||||||
@@ -152,12 +158,12 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void log(String o)
|
public void log( String o )
|
||||||
{
|
{
|
||||||
AELog.grinder( o );
|
AELog.grinder( o );
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDustToOreRatio(String name)
|
private int getDustToOreRatio( String name )
|
||||||
{
|
{
|
||||||
if ( name.equals( "Obsidian" ) )
|
if ( name.equals( "Obsidian" ) )
|
||||||
return 1;
|
return 1;
|
||||||
@@ -168,52 +174,48 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Map<ItemStack, String> Ores = new HashMap<ItemStack, String>();
|
private void addOre( String name, ItemStack item )
|
||||||
public final Map<ItemStack, String> Ingots = new HashMap<ItemStack, String>();
|
|
||||||
public final Map<String, ItemStack> Dusts = new HashMap<String, ItemStack>();
|
|
||||||
|
|
||||||
private void addOre(String name, ItemStack item)
|
|
||||||
{
|
{
|
||||||
if ( item == null )
|
if ( item == null )
|
||||||
return;
|
return;
|
||||||
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
|
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||||
|
|
||||||
this.Ores.put( item, name );
|
this.ores.put( item, name );
|
||||||
|
|
||||||
if ( this.Dusts.containsKey( name ) )
|
if ( this.dusts.containsKey( name ) )
|
||||||
{
|
{
|
||||||
ItemStack is = this.Dusts.get( name ).copy();
|
ItemStack is = this.dusts.get( name ).copy();
|
||||||
int ratio = this.getDustToOreRatio( name );
|
int ratio = this.getDustToOreRatio( name );
|
||||||
if ( ratio > 1 )
|
if ( ratio > 1 )
|
||||||
{
|
{
|
||||||
ItemStack extra = is.copy();
|
ItemStack extra = is.copy();
|
||||||
extra.stackSize = ratio - 1;
|
extra.stackSize = ratio - 1;
|
||||||
this.addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.addRecipe( item, is, 8 );
|
this.addRecipe( item, is, 8 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIngot(String name, ItemStack item)
|
private void addIngot( String name, ItemStack item )
|
||||||
{
|
{
|
||||||
if ( item == null )
|
if ( item == null )
|
||||||
return;
|
return;
|
||||||
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
|
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||||
|
|
||||||
this.Ingots.put( item, name );
|
this.ingots.put( item, name );
|
||||||
|
|
||||||
if ( this.Dusts.containsKey( name ) )
|
if ( this.dusts.containsKey( name ) )
|
||||||
{
|
{
|
||||||
this.addRecipe( item, this.Dusts.get( name ), 4 );
|
this.addRecipe( item, this.dusts.get( name ), 4 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDust(String name, ItemStack item)
|
private void addDust( String name, ItemStack item )
|
||||||
{
|
{
|
||||||
if ( item == null )
|
if ( item == null )
|
||||||
return;
|
return;
|
||||||
if ( this.Dusts.containsKey( name ) )
|
if ( this.dusts.containsKey( name ) )
|
||||||
{
|
{
|
||||||
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||||
return;
|
return;
|
||||||
@@ -221,9 +223,9 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
|
|
||||||
this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||||
|
|
||||||
this.Dusts.put( name, item );
|
this.dusts.put( name, item );
|
||||||
|
|
||||||
for (Entry<ItemStack, String> d : this.Ores.entrySet())
|
for ( Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||||
if ( name.equals( d.getValue() ) )
|
if ( name.equals( d.getValue() ) )
|
||||||
{
|
{
|
||||||
ItemStack is = item.copy();
|
ItemStack is = item.copy();
|
||||||
@@ -233,23 +235,23 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
|||||||
{
|
{
|
||||||
ItemStack extra = is.copy();
|
ItemStack extra = is.copy();
|
||||||
extra.stackSize = ratio - 1;
|
extra.stackSize = ratio - 1;
|
||||||
this.addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.addRecipe( d.getKey(), is, 8 );
|
this.addRecipe( d.getKey(), is, 8 );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Entry<ItemStack, String> d : this.Ingots.entrySet())
|
for ( Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||||
if ( name.equals( d.getValue() ) )
|
if ( name.equals( d.getValue() ) )
|
||||||
this.addRecipe( d.getKey(), item, 4 );
|
this.addRecipe( d.getKey(), item, 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void oreRegistered(String name, ItemStack item)
|
public void oreRegistered( String name, ItemStack item )
|
||||||
{
|
{
|
||||||
if ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) )
|
if ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) )
|
||||||
{
|
{
|
||||||
for (String ore : AEConfig.instance.grinderOres)
|
for ( String ore : AEConfig.instance.grinderOres )
|
||||||
{
|
{
|
||||||
if ( name.equals( "ore" + ore ) )
|
if ( name.equals( "ore" + ore ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
package appeng.core.features.registries;
|
package appeng.core.features.registries;
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
@@ -30,13 +32,19 @@ import appeng.api.features.ILocatable;
|
|||||||
import appeng.api.features.ILocatableRegistry;
|
import appeng.api.features.ILocatableRegistry;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class LocatableRegistry implements ILocatableRegistry
|
|
||||||
{
|
|
||||||
|
|
||||||
private final HashMap<Long, ILocatable> set;
|
public final class LocatableRegistry implements ILocatableRegistry
|
||||||
|
{
|
||||||
|
private final Map<Long, ILocatable> set;
|
||||||
|
|
||||||
|
public LocatableRegistry()
|
||||||
|
{
|
||||||
|
this.set = new HashMap<Long, ILocatable>();
|
||||||
|
MinecraftForge.EVENT_BUS.register( this );
|
||||||
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void updateLocatable(LocatableEventAnnounce e)
|
public void updateLocatable( LocatableEventAnnounce e )
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
return; // IGNORE!
|
return; // IGNORE!
|
||||||
@@ -51,18 +59,19 @@ public class LocatableRegistry implements ILocatableRegistry
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocatableRegistry() {
|
|
||||||
this.set = new HashMap<Long, ILocatable>();
|
|
||||||
MinecraftForge.EVENT_BUS.register( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a locate-able object by its serial.
|
* Find a locate-able object by its serial.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object findLocatableBySerial(long ser)
|
@Deprecated
|
||||||
|
public Object findLocatableBySerial( long ser )
|
||||||
{
|
{
|
||||||
return this.set.get( ser );
|
return this.set.get( ser );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILocatable getLocatableBy( long serial )
|
||||||
|
{
|
||||||
|
return this.set.get( serial );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,24 +18,25 @@
|
|||||||
|
|
||||||
package appeng.core.features.registries;
|
package appeng.core.features.registries;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import appeng.api.AEApi;
|
||||||
|
import appeng.api.features.ILocatable;
|
||||||
import appeng.api.features.IWirelessTermHandler;
|
import appeng.api.features.IWirelessTermHandler;
|
||||||
import appeng.api.features.IWirelessTermRegistry;
|
import appeng.api.features.IWirelessTermRegistry;
|
||||||
import appeng.core.localization.PlayerMessages;
|
import appeng.core.localization.PlayerMessages;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class WirelessRegistry implements IWirelessTermRegistry
|
public final class WirelessRegistry implements IWirelessTermRegistry
|
||||||
{
|
{
|
||||||
|
private final List<IWirelessTermHandler> handlers;
|
||||||
final List<IWirelessTermHandler> handlers;
|
|
||||||
|
|
||||||
public WirelessRegistry() {
|
public WirelessRegistry() {
|
||||||
this.handlers = new ArrayList<IWirelessTermHandler>();
|
this.handlers = new ArrayList<IWirelessTermHandler>();
|
||||||
@@ -76,10 +77,25 @@ public class WirelessRegistry implements IWirelessTermRegistry
|
|||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IWirelessTermHandler handler = this.getWirelessTerminalHandler( item );
|
if ( !this.isWirelessTerminal( item ) )
|
||||||
if ( handler == null )
|
|
||||||
{
|
{
|
||||||
player.addChatMessage( new ChatComponentText( "Item is not a wireless terminal." ) );
|
player.addChatMessage( PlayerMessages.DeviceNotWirelessTerminal.get() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final IWirelessTermHandler handler = this.getWirelessTerminalHandler( item );
|
||||||
|
final String unparsedKey = handler.getEncryptionKey( item );
|
||||||
|
if ( unparsedKey.length() == 0 )
|
||||||
|
{
|
||||||
|
player.addChatMessage( PlayerMessages.DeviceNotLinked.get() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long parsedKey = Long.parseLong( unparsedKey );
|
||||||
|
final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy( parsedKey );
|
||||||
|
if ( securityStation == null )
|
||||||
|
{
|
||||||
|
player.addChatMessage( PlayerMessages.StationCanNotBeLocated.get() );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ public enum PlayerMessages
|
|||||||
{
|
{
|
||||||
ChestCannotReadStorageCell, InvalidMachine, LoadedSettings, SavedSettings, MachineNotPowered,
|
ChestCannotReadStorageCell, InvalidMachine, LoadedSettings, SavedSettings, MachineNotPowered,
|
||||||
|
|
||||||
isNowLocked, isNowUnlocked, AmmoDepleted, CommunicationError, OutOfRange, DeviceNotPowered, SettingCleared;
|
isNowLocked, isNowUnlocked,
|
||||||
|
AmmoDepleted,
|
||||||
|
CommunicationError, OutOfRange, DeviceNotPowered, DeviceNotWirelessTerminal, DeviceNotLinked, StationCanNotBeLocated,
|
||||||
|
SettingCleared,;
|
||||||
|
|
||||||
String getName()
|
String getName()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user