Compare commits
159 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3dd81433ac | |||
| 369a82889c | |||
| 22b965e15a | |||
| 0b86887962 | |||
| db7296c0a1 | |||
| d1f2625262 | |||
| b756a3f564 | |||
| dfa595ad2a | |||
| 0519f60cb0 | |||
| 81c32d5181 | |||
| b609b08f98 | |||
| 50f141edbd | |||
| 0542a58e4b | |||
| 58db877006 | |||
| dff3364eb5 | |||
| 88310cf04b | |||
| d81eb1fe2d | |||
| d8f452b665 | |||
| ec05bd994c | |||
| dff48c07c9 | |||
| 234d97b8ce | |||
| 9bf8b4388f | |||
| b31f2df58d | |||
| 14df50dbf3 | |||
| 6aeca93b85 | |||
| 3143c871d0 | |||
| 7f7c71a22e | |||
| 05f522580b | |||
| 926af89029 | |||
| f1248c4c33 | |||
| bd2ee1c5ea | |||
| 8ef286b9d6 | |||
| 4b4693498d | |||
| e41d6a0289 | |||
| c8d716d39f | |||
| 33c1535bfa | |||
| 1067d30264 | |||
| 96145e75f4 | |||
| 2ba6dad3b2 | |||
| a870393edb | |||
| d04bc2fb3c | |||
| 9d52e85afa | |||
| 3745e6ce8d | |||
| a4c38263d1 | |||
| c1a7a35192 | |||
| eb98ec891b | |||
| 69a5507f96 | |||
| a1f43ff51a | |||
| da91585d69 | |||
| f138a68f3e | |||
| 30191eb5ba | |||
| 4552394f6e | |||
| 9c3d3db3fb | |||
| 9c1c9056f1 | |||
| b5582688a3 | |||
| 34597a4e21 | |||
| e0b32d2641 | |||
| 6baf952904 | |||
| f132ae3678 | |||
| 720b38442e | |||
| 136f5d7314 | |||
| a83e4b7c3d | |||
| 1bb0109c45 | |||
| 4744dfab78 | |||
| 7dedd4700f | |||
| 95fb894ba3 | |||
| 621ddc5535 | |||
| ece09a956b | |||
| db5493f60b | |||
| f0482dd391 | |||
| c53b3b5dfc | |||
| ad16550a86 | |||
| 99e4928542 | |||
| 43995a4b32 | |||
| 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 | |||
| ef3cb0a455 | |||
| be82dfec1f | |||
| 8eb5ad01cf | |||
| a3c5e4cb05 | |||
| c35e057d96 | |||
| a5a80b58d5 | |||
| c10c809c9e | |||
| 3d2bd84450 | |||
| 2776b2d430 | |||
| f0d04699d1 | |||
| afbce77d0b | |||
| 3a5844a0fe | |||
| e2798aaaf4 | |||
| 99d86511a1 | |||
| a8c920932e | |||
| bd9eaa2d48 | |||
| c6f232ab63 | |||
| 29a4464e18 | |||
| 63e375f208 | |||
| 2f51568772 | |||
| 59adde7c6b | |||
| 52c512635d | |||
| e0175bac98 | |||
| 63ab2bbad0 | |||
| 33b04f6ff9 | |||
| 236f6f72e3 | |||
| 8920d949d2 | |||
| eed0c11d7f | |||
| 8179259afa | |||
| e38293a291 | |||
| 15ba197083 | |||
| ff903e65a5 | |||
| 305fc6c7f2 | |||
| ada69b9a95 | |||
| 97dabc4a5c | |||
| fec00fee17 | |||
| 02e59faa59 | |||
| a23a8ed165 | |||
| 9b7b0fc0fb | |||
| ddf71c5072 | |||
| 2b34ba5840 | |||
| 3554b5f48d | |||
| eb74fb33b8 | |||
| f471513bd0 | |||
| 2a5e57a59b | |||
| e37d9099c7 | |||
| e712a9d8ce | |||
| 0cb58b4d93 | |||
| 20ccf65906 |
@@ -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
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -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.5_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=V5c
|
||||||
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 "appeng:Waila:${config.api_waila_version}:api"
|
||||||
compile(group: 'dev', name: 'buildcraft', version: "${config.dev_buildcraft_version}")
|
compile "appeng:RotaryCraft:${config.api_rotarycraft_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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class AEApi
|
|||||||
/**
|
/**
|
||||||
* API Entry Point.
|
* API Entry Point.
|
||||||
*
|
*
|
||||||
* @return the {@link IAppEngApi} or null if the instance could not be retrieved
|
* @return the {@link IAppEngApi} or null if the INSTANCE could not be retrieved
|
||||||
*/
|
*/
|
||||||
public static IAppEngApi instance()
|
public static IAppEngApi instance()
|
||||||
{
|
{
|
||||||
@@ -47,7 +47,7 @@ public class AEApi
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class c = Class.forName( "appeng.core.Api" );
|
Class c = Class.forName( "appeng.core.Api" );
|
||||||
api = (IAppEngApi) c.getField( "instance" ).get( c );
|
api = (IAppEngApi) c.getField( "INSTANCE" ).get( c );
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,28 +29,28 @@ public enum AccessRestriction
|
|||||||
|
|
||||||
private final int permissionBit;
|
private final int permissionBit;
|
||||||
|
|
||||||
private AccessRestriction(int v) {
|
AccessRestriction( int v ) {
|
||||||
permissionBit = v;
|
this.permissionBit = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPermission(AccessRestriction ar)
|
public boolean hasPermission(AccessRestriction ar)
|
||||||
{
|
{
|
||||||
return (permissionBit & ar.permissionBit) == ar.permissionBit;
|
return ( this.permissionBit & ar.permissionBit) == ar.permissionBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessRestriction restrictPermissions(AccessRestriction ar)
|
public AccessRestriction restrictPermissions(AccessRestriction ar)
|
||||||
{
|
{
|
||||||
return getPermByBit( permissionBit & ar.permissionBit);
|
return this.getPermByBit( this.permissionBit & ar.permissionBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessRestriction addPermissions(AccessRestriction ar)
|
public AccessRestriction addPermissions(AccessRestriction ar)
|
||||||
{
|
{
|
||||||
return getPermByBit( permissionBit | ar.permissionBit);
|
return this.getPermByBit( this.permissionBit | ar.permissionBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessRestriction removePermissions(AccessRestriction ar)
|
public AccessRestriction removePermissions(AccessRestriction ar)
|
||||||
{
|
{
|
||||||
return getPermByBit( permissionBit & (~ar.permissionBit) );
|
return this.getPermByBit( this.permissionBit & (~ar.permissionBit) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private AccessRestriction getPermByBit(int bit)
|
private AccessRestriction getPermByBit(int bit)
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ 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 ) {
|
||||||
percentage = p;
|
this.percentage = p;
|
||||||
breakPoint = p / 100.0f;
|
this.breakPoint = p / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateBreakPoint(int maxDamage)
|
public int calculateBreakPoint(int maxDamage)
|
||||||
{
|
{
|
||||||
return (int) ((percentage * maxDamage) / 100.0f);
|
return (int) (( this.percentage * maxDamage) / 100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,11 +34,11 @@ public enum PowerMultiplier
|
|||||||
|
|
||||||
public double multiply(double in)
|
public double multiply(double in)
|
||||||
{
|
{
|
||||||
return in * multiplier;
|
return in * this.multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double divide(double in)
|
public double divide(double in)
|
||||||
{
|
{
|
||||||
return in / multiplier;
|
return in / this.multiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ 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 ) {
|
||||||
unlocalizedName = un;
|
this.unlocalizedName = un;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +59,7 @@ public enum PowerUnits
|
|||||||
*/
|
*/
|
||||||
public double convertTo(PowerUnits target, double value)
|
public double convertTo(PowerUnits target, double value)
|
||||||
{
|
{
|
||||||
return (value * conversionRatio) / target.conversionRatio;
|
return (value * this.conversionRatio ) / target.conversionRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -56,15 +56,15 @@ public enum SecurityPermissions
|
|||||||
*/
|
*/
|
||||||
SECURITY;
|
SECURITY;
|
||||||
|
|
||||||
final private String unlocalizedName = "gui.appliedenergistics2.security." + name().toLowerCase();
|
final private String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase();
|
||||||
|
|
||||||
public String getUnlocalizedName()
|
public String getUnlocalizedName()
|
||||||
{
|
{
|
||||||
return unlocalizedName + ".name";
|
return this.unlocalizedName + ".name";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUnlocalizedTip()
|
public String getUnlocalizedTip()
|
||||||
{
|
{
|
||||||
return unlocalizedName + ".tip";
|
return this.unlocalizedName + ".tip";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,47 +23,50 @@
|
|||||||
|
|
||||||
package appeng.api.config;
|
package appeng.api.config;
|
||||||
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
|
||||||
public enum Settings
|
public enum Settings
|
||||||
{
|
{
|
||||||
LEVEL_EMITTER_MODE(EnumSet.allOf( LevelEmitterMode.class )),
|
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
|
||||||
|
|
||||||
REDSTONE_EMITTER(EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL )), REDSTONE_CONTROLLED(EnumSet.allOf( RedstoneMode.class )),
|
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ), REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
|
||||||
|
|
||||||
CONDENSER_OUTPUT(EnumSet.allOf( CondenserOutput.class )),
|
CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ),
|
||||||
|
|
||||||
POWER_UNITS(EnumSet.allOf( PowerUnits.class )), ACCESS(EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE )),
|
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ), ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
|
||||||
|
|
||||||
SORT_DIRECTION(EnumSet.allOf( SortDir.class )), SORT_BY(EnumSet.allOf( SortOrder.class )),
|
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ), SORT_BY( EnumSet.allOf( SortOrder.class ) ),
|
||||||
|
|
||||||
SEARCH_TOOLTIPS(EnumSet.of( YesNo.YES, YesNo.NO )), VIEW_MODE(EnumSet.allOf( ViewItems.class )), SEARCH_MODE(EnumSet.allOf( SearchBoxMode.class )),
|
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ), VIEW_MODE( EnumSet.allOf( ViewItems.class ) ), SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
|
||||||
|
|
||||||
ACTIONS(EnumSet.allOf( ActionItems.class )), IO_DIRECTION(EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT )),
|
ACTIONS( EnumSet.allOf( ActionItems.class ) ), IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
|
||||||
|
|
||||||
BLOCK(EnumSet.of( YesNo.YES, YesNo.NO )), OPERATION_MODE(EnumSet.allOf( OperationMode.class )),
|
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
|
||||||
|
|
||||||
FULLNESS_MODE(EnumSet.allOf( FullnessMode.class )), CRAFT_ONLY(EnumSet.of( YesNo.YES, YesNo.NO )),
|
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ), CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
FUZZY_MODE(EnumSet.allOf( FuzzyMode.class )), LEVEL_TYPE(EnumSet.allOf( LevelType.class )),
|
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ), LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
|
||||||
|
|
||||||
TERMINAL_STYLE(EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL )), COPY_MODE(EnumSet.allOf( CopyMode.class )),
|
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ), COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
|
||||||
|
|
||||||
INTERFACE_TERMINAL(EnumSet.of( YesNo.YES, YesNo.NO )), CRAFT_VIA_REDSTONE(EnumSet.of( YesNo.YES, YesNo.NO )),
|
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
STORAGE_FILTER(EnumSet.allOf( StorageFilter.class ));
|
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
|
||||||
|
|
||||||
private EnumSet values;
|
private final EnumSet values;
|
||||||
|
|
||||||
public EnumSet getPossibleValues()
|
public EnumSet getPossibleValues()
|
||||||
{
|
{
|
||||||
return 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." );
|
||||||
values = set;
|
this.values = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,27 +23,32 @@
|
|||||||
|
|
||||||
package appeng.api.config;
|
package appeng.api.config;
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import appeng.api.util.AEItemDefinition;
|
||||||
|
|
||||||
|
|
||||||
public enum Upgrades
|
public enum Upgrades
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Gold Tier Upgrades.
|
* Gold Tier Upgrades.
|
||||||
*/
|
*/
|
||||||
CAPACITY(0), REDSTONE(0), CRAFTING(0),
|
CAPACITY( 0 ), REDSTONE( 0 ), CRAFTING( 0 ),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Diamond Tier Upgrades.
|
* Diamond Tier Upgrades.
|
||||||
*/
|
*/
|
||||||
FUZZY(1), SPEED(1), INVERTER(1);
|
FUZZY( 1 ), SPEED( 1 ), INVERTER( 1 );
|
||||||
|
|
||||||
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 )
|
||||||
myTier = tier;
|
{
|
||||||
|
this.myTier = tier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,12 +56,26 @@ public enum Upgrades
|
|||||||
*/
|
*/
|
||||||
public HashMap<ItemStack, Integer> getSupported()
|
public HashMap<ItemStack, Integer> getSupported()
|
||||||
{
|
{
|
||||||
return supportedMax;
|
return this.supportedMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerItem(ItemStack myItem, int maxSupported)
|
|
||||||
|
|
||||||
|
public void registerItem( AEItemDefinition myItem, int maxSupported )
|
||||||
{
|
{
|
||||||
if ( myItem != null )
|
if ( myItem != null )
|
||||||
supportedMax.put( myItem, maxSupported );
|
{
|
||||||
|
final ItemStack stack = myItem.stack( 1 );
|
||||||
|
|
||||||
|
this.registerItem( stack, maxSupported );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerItem( ItemStack stack, int maxSupported )
|
||||||
|
{
|
||||||
|
if ( stack != null )
|
||||||
|
{
|
||||||
|
this.supportedMax.put( stack, maxSupported );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,5 +73,4 @@ public class Parts
|
|||||||
public AEItemDefinition partTerminal;
|
public AEItemDefinition partTerminal;
|
||||||
public AEItemDefinition partStorageMonitor;
|
public AEItemDefinition partStorageMonitor;
|
||||||
public AEItemDefinition partConversionMonitor;
|
public AEItemDefinition partConversionMonitor;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ public class LocatableEventAnnounce extends Event
|
|||||||
final public LocatableEvent change;
|
final public LocatableEvent change;
|
||||||
|
|
||||||
public LocatableEventAnnounce(ILocatable o, LocatableEvent ev) {
|
public LocatableEventAnnounce(ILocatable o, LocatableEvent ev) {
|
||||||
target = o;
|
this.target = o;
|
||||||
change = ev;
|
this.change = ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class TransitionResult
|
|||||||
public final double energyUsage;
|
public final double energyUsage;
|
||||||
|
|
||||||
public TransitionResult(boolean _success, double power) {
|
public TransitionResult(boolean _success, double power) {
|
||||||
success = _success;
|
this.success = _success;
|
||||||
energyUsage = power;
|
this.energyUsage = power;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INe
|
|||||||
* IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the
|
* IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the
|
||||||
* FluidStack/ItemStack acquired from it.
|
* FluidStack/ItemStack acquired from it.
|
||||||
*/
|
*/
|
||||||
IAEStack getDisplayed();
|
IAEStack<?> getDisplayed();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current locked state of the Storage Monitor
|
* @return the current locked state of the Storage Monitor
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public interface IGridCacheRegistry
|
|||||||
void registerGridCache(Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation);
|
void registerGridCache(Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* requests a new instance of a grid cache for use, used internally
|
* requests a new INSTANCE of a grid cache for use, used internally
|
||||||
*
|
*
|
||||||
* @param grid grid
|
* @param grid grid
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -46,9 +48,9 @@ public interface IGridHost
|
|||||||
* feel free to ignore this, most blocks will use the same node
|
* feel free to ignore this, most blocks will use the same node
|
||||||
* for every side.
|
* for every side.
|
||||||
* @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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import appeng.api.storage.data.IAEItemStack;
|
|||||||
/**
|
/**
|
||||||
* do not implement provided by {@link ICraftingPatternItem}
|
* do not implement provided by {@link ICraftingPatternItem}
|
||||||
*
|
*
|
||||||
* caching this instance will increase performance of validation and checks.
|
* caching this INSTANCE will increase performance of validation and checks.
|
||||||
*/
|
*/
|
||||||
public interface ICraftingPatternDetails
|
public interface ICraftingPatternDetails
|
||||||
{
|
{
|
||||||
@@ -82,7 +82,7 @@ public interface ICraftingPatternDetails
|
|||||||
boolean canSubstitute();
|
boolean canSubstitute();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow using this instance of the pattern details to preform the crafting action with performance enhancements.
|
* Allow using this INSTANCE of the pattern details to preform the crafting action with performance enhancements.
|
||||||
*
|
*
|
||||||
* @param craftingInv inventory
|
* @param craftingInv inventory
|
||||||
* @param world crafting world
|
* @param world crafting world
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class MENetworkChannelChanged extends MENetworkEvent
|
|||||||
public final IGridNode node;
|
public final IGridNode node;
|
||||||
|
|
||||||
public MENetworkChannelChanged(IGridNode n) {
|
public MENetworkChannelChanged(IGridNode n) {
|
||||||
node = n;
|
this.node = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent
|
|||||||
public final IGridNode node;
|
public final IGridNode node;
|
||||||
|
|
||||||
public MENetworkCraftingCpuChange(IGridNode n) {
|
public MENetworkCraftingCpuChange(IGridNode n) {
|
||||||
node = n;
|
this.node = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent
|
|||||||
public final IGridNode node;
|
public final IGridNode node;
|
||||||
|
|
||||||
public MENetworkCraftingPatternChange(ICraftingProvider p, IGridNode n) {
|
public MENetworkCraftingPatternChange(ICraftingProvider p, IGridNode n) {
|
||||||
provider = p;
|
this.provider = p;
|
||||||
node = n;
|
this.node = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class MENetworkEvent
|
|||||||
*/
|
*/
|
||||||
public void cancel()
|
public void cancel()
|
||||||
{
|
{
|
||||||
canceled = true;
|
this.canceled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +51,7 @@ public class MENetworkEvent
|
|||||||
*/
|
*/
|
||||||
public boolean isCanceled()
|
public boolean isCanceled()
|
||||||
{
|
{
|
||||||
return canceled;
|
return this.canceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +61,7 @@ public class MENetworkEvent
|
|||||||
*/
|
*/
|
||||||
public int getVisitedObjects()
|
public int getVisitedObjects()
|
||||||
{
|
{
|
||||||
return visited;
|
return this.visited;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,6 +71,6 @@ public class MENetworkEvent
|
|||||||
*/
|
*/
|
||||||
public void setVisitedObjects(int v)
|
public void setVisitedObjects(int v)
|
||||||
{
|
{
|
||||||
visited = v;
|
this.visited = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent
|
|||||||
public final IGridNode node;
|
public final IGridNode node;
|
||||||
|
|
||||||
public MENetworkPowerIdleChange(IGridNode nodeThatChanged) {
|
public MENetworkPowerIdleChange(IGridNode nodeThatChanged) {
|
||||||
node = nodeThatChanged;
|
this.node = nodeThatChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ public class MENetworkPowerStorage extends MENetworkEvent
|
|||||||
public final PowerEventType type;
|
public final PowerEventType type;
|
||||||
|
|
||||||
public MENetworkPowerStorage(IAEPowerStorage t, PowerEventType y) {
|
public MENetworkPowerStorage(IAEPowerStorage t, PowerEventType y) {
|
||||||
storage = t;
|
this.storage = t;
|
||||||
type = y;
|
this.type = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ package appeng.api.networking.events;
|
|||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event that is posted whenever a spatial IO is actived, called for IGridCache
|
* An event that is posted whenever a spatial IO is active, called for IGridCache
|
||||||
*/
|
*/
|
||||||
public class MENetworkSpatialEvent extends MENetworkEvent
|
public class MENetworkSpatialEvent extends MENetworkEvent
|
||||||
{
|
{
|
||||||
@@ -34,12 +34,12 @@ public class MENetworkSpatialEvent extends MENetworkEvent
|
|||||||
public final double spatialEnergyUsage;
|
public final double spatialEnergyUsage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param SpatialIO ( instance of the SpatialIO block )
|
* @param SpatialIO ( INSTANCE of the SpatialIO block )
|
||||||
* @param EnergyUsage ( the amount of energy that the SpatialIO uses)
|
* @param EnergyUsage ( the amount of energy that the SpatialIO uses)
|
||||||
*/
|
*/
|
||||||
public MENetworkSpatialEvent(IGridHost SpatialIO, double EnergyUsage)
|
public MENetworkSpatialEvent(IGridHost SpatialIO, double EnergyUsage)
|
||||||
{
|
{
|
||||||
host = SpatialIO;
|
this.host = SpatialIO;
|
||||||
spatialEnergyUsage = EnergyUsage;
|
this.spatialEnergyUsage = EnergyUsage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ public class MENetworkStorageEvent extends MENetworkEvent
|
|||||||
public final StorageChannel channel;
|
public final StorageChannel channel;
|
||||||
|
|
||||||
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
|
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
|
||||||
monitor = o;
|
this.monitor = o;
|
||||||
channel = chan;
|
this.channel = chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public interface IPathingGrid extends IGridCache
|
|||||||
ControllerState getControllerState();
|
ControllerState getControllerState();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* trigger a network reset, booting, pathfinding and all.
|
* trigger a network reset, booting, path-finding and all.
|
||||||
*/
|
*/
|
||||||
void repath();
|
void repath();
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class MachineSource extends BaseActionSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MachineSource(IActionHost v) {
|
public MachineSource(IActionHost v) {
|
||||||
via = v;
|
this.via = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class PlayerSource extends BaseActionSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlayerSource(EntityPlayer p, IActionHost v) {
|
public PlayerSource(EntityPlayer p, IActionHost v) {
|
||||||
player = p;
|
this.player = p;
|
||||||
via = v;
|
this.via = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ public class TickingRequest
|
|||||||
public final boolean canBeAlerted;
|
public final boolean canBeAlerted;
|
||||||
|
|
||||||
public TickingRequest(int min, int max, boolean sleep, boolean alertable) {
|
public TickingRequest(int min, int max, boolean sleep, boolean alertable) {
|
||||||
minTickRate = min;
|
this.minTickRate = min;
|
||||||
maxTickRate = max;
|
this.maxTickRate = max;
|
||||||
isSleeping = sleep;
|
this.isSleeping = sleep;
|
||||||
canBeAlerted = alertable;
|
this.canBeAlerted = alertable;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ 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;
|
||||||
opaqueFacades = !hideFacades;
|
this.opaqueFacades = !hideFacades;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public interface IPartHost
|
|||||||
*
|
*
|
||||||
* @param side side of part
|
* @param side side of part
|
||||||
* @param suppressUpdate
|
* @param suppressUpdate
|
||||||
* - used if you need to replace a part's instance, without really removing it first.
|
* - used if you need to replace a part's INSTANCE, without really removing it first.
|
||||||
*/
|
*/
|
||||||
void removePart(ForgeDirection side, boolean suppressUpdate);
|
void removePart(ForgeDirection side, boolean suppressUpdate);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
/**
|
/**
|
||||||
* This is a pretty basic requirement, once you implement the interface, and createPartFromItemStack
|
* This is a pretty basic requirement, once you implement the interface, and createPartFromItemStack
|
||||||
*
|
*
|
||||||
* you must register your bus with the Bus renderer, using AEApi.instance().partHelper().setItemBusRenderer( this );
|
* you must register your bus with the Bus renderer, using AEApi.INSTANCE().partHelper().setItemBusRenderer( this );
|
||||||
*
|
*
|
||||||
* then simply add these two methods, which tell MC to use the Block Textures, and call AE's Bus Placement Code.
|
* then simply add these two methods, which tell MC to use the Block Textures, and call AE's Bus Placement Code.
|
||||||
*
|
*
|
||||||
@@ -45,7 +45,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
* {@literal @}Override
|
* {@literal @}Override
|
||||||
* public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
* public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||||
* {
|
* {
|
||||||
* return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, world );
|
* return AEApi.INSTANCE().partHelper().placeBus( is, x, y, z, side, player, world );
|
||||||
* }
|
* }
|
||||||
* </code>
|
* </code>
|
||||||
* </pre>
|
* </pre>
|
||||||
@@ -55,7 +55,7 @@ public interface IPartItem
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new part instance, from the item stack.
|
* create a new part INSTANCE, from the item stack.
|
||||||
*
|
*
|
||||||
* @param is item
|
* @param is item
|
||||||
* @return part from item
|
* @return part from item
|
||||||
|
|||||||
@@ -47,19 +47,19 @@ public class SelectedPart
|
|||||||
public final ForgeDirection side;
|
public final ForgeDirection side;
|
||||||
|
|
||||||
public SelectedPart() {
|
public SelectedPart() {
|
||||||
part = null;
|
this.part = null;
|
||||||
facade = null;
|
this.facade = null;
|
||||||
side = ForgeDirection.UNKNOWN;
|
this.side = ForgeDirection.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelectedPart(IPart part, ForgeDirection side) {
|
public SelectedPart(IPart part, ForgeDirection side) {
|
||||||
this.part = part;
|
this.part = part;
|
||||||
facade = null;
|
this.facade = null;
|
||||||
this.side = side;
|
this.side = side;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelectedPart(IFacadePart facade, ForgeDirection side) {
|
public SelectedPart(IFacadePart facade, ForgeDirection side) {
|
||||||
part = null;
|
this.part = null;
|
||||||
this.facade = facade;
|
this.facade = facade;
|
||||||
this.side = side;
|
this.side = side;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,30 +57,30 @@ 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 lookups.
|
* Bakes the lists in for faster runtime look-ups.
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientError
|
||||||
* @throws RegistrationError
|
* @throws RegistrationError
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,15 +33,15 @@ public class ResolverResult
|
|||||||
final public NBTTagCompound compound;
|
final public NBTTagCompound compound;
|
||||||
|
|
||||||
public ResolverResult(String name, int damage) {
|
public ResolverResult(String name, int damage) {
|
||||||
itemName = name;
|
this.itemName = name;
|
||||||
damageValue = damage;
|
this.damageValue = damage;
|
||||||
compound = null;
|
this.compound = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResolverResult(String name, int damage, NBTTagCompound data) {
|
public ResolverResult(String name, int damage, NBTTagCompound data) {
|
||||||
itemName = name;
|
this.itemName = name;
|
||||||
damageValue = damage;
|
this.damageValue = damage;
|
||||||
compound = data;
|
this.compound = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public class ResolverResultSet
|
|||||||
public final List<ItemStack> results;
|
public final List<ItemStack> results;
|
||||||
|
|
||||||
public ResolverResultSet(String myName, ItemStack... set) {
|
public ResolverResultSet(String myName, ItemStack... set) {
|
||||||
results = Arrays.asList( set );
|
this.results = Arrays.asList( set );
|
||||||
name = myName;
|
this.name = myName;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ package appeng.api.storage;
|
|||||||
import appeng.api.networking.security.IActionHost;
|
import appeng.api.networking.security.IActionHost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a IGridhost that contributes to storage, such as a ME Chest, or ME Drive.
|
* Represents an {@link appeng.api.networking.IGridHost} that contributes to storage, such as a ME Chest, or ME Drive.
|
||||||
*/
|
*/
|
||||||
public interface ICellContainer extends IActionHost, ICellProvider, ISaveProvider
|
public interface ICellContainer extends IActionHost, ICellProvider, ISaveProvider
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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(...)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public interface IStorageHelper
|
|||||||
* @param is
|
* @param is
|
||||||
* An ItemStack
|
* An ItemStack
|
||||||
*
|
*
|
||||||
* @return a new instance of {@link IAEItemStack} from a MC {@link ItemStack}
|
* @return a new INSTANCE of {@link IAEItemStack} from a MC {@link ItemStack}
|
||||||
*/
|
*/
|
||||||
IAEItemStack createItemStack(ItemStack is);
|
IAEItemStack createItemStack(ItemStack is);
|
||||||
|
|
||||||
@@ -60,17 +60,17 @@ public interface IStorageHelper
|
|||||||
* @param is
|
* @param is
|
||||||
* A FluidStack
|
* A FluidStack
|
||||||
*
|
*
|
||||||
* @return a new instance of {@link IAEFluidStack} from a Forge {@link FluidStack}
|
* @return a new INSTANCE of {@link IAEFluidStack} from a Forge {@link FluidStack}
|
||||||
*/
|
*/
|
||||||
IAEFluidStack createFluidStack(FluidStack is);
|
IAEFluidStack createFluidStack(FluidStack is);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a new instance of {@link IItemList} for items
|
* @return a new INSTANCE of {@link IItemList} for items
|
||||||
*/
|
*/
|
||||||
IItemList<IAEItemStack> createItemList();
|
IItemList<IAEItemStack> createItemList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a new instance of {@link IItemList} for fluids
|
* @return a new INSTANCE of {@link IItemList} for fluids
|
||||||
*/
|
*/
|
||||||
IItemList<IAEFluidStack> createFluidList();
|
IItemList<IAEFluidStack> createFluidList();
|
||||||
|
|
||||||
|
|||||||
@@ -51,23 +51,23 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
|||||||
|
|
||||||
protected IMEInventoryHandler<StackType> getHandler()
|
protected IMEInventoryHandler<StackType> getHandler()
|
||||||
{
|
{
|
||||||
return internalHandler;
|
return this.internalHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> getListeners()
|
protected Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> getListeners()
|
||||||
{
|
{
|
||||||
return listeners.entrySet().iterator();
|
return this.listeners.entrySet().iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src)
|
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src)
|
||||||
{
|
{
|
||||||
notifyListenersOfChange( changes, src );
|
this.notifyListenersOfChange( changes, src );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src)
|
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src)
|
||||||
{
|
{
|
||||||
hasChanged = true;// need to update the cache.
|
this.hasChanged = true;// need to update the cache.
|
||||||
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = getListeners();
|
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
|
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
|
||||||
@@ -89,108 +89,108 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
|||||||
diff.decStackSize( leftOvers.getStackSize() );
|
diff.decStackSize( leftOvers.getStackSize() );
|
||||||
|
|
||||||
if ( diff.getStackSize() != 0 )
|
if ( diff.getStackSize() != 0 )
|
||||||
postChangesToListeners( ImmutableList.of( diff ), src );
|
this.postChangesToListeners( ImmutableList.of( diff ), src );
|
||||||
|
|
||||||
return leftOvers;
|
return leftOvers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MEMonitorHandler(IMEInventoryHandler<StackType> t) {
|
public MEMonitorHandler(IMEInventoryHandler<StackType> t) {
|
||||||
internalHandler = t;
|
this.internalHandler = t;
|
||||||
cachedList = (IItemList<StackType>) t.getChannel().createList();
|
this.cachedList = (IItemList<StackType>) t.getChannel().createList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MEMonitorHandler(IMEInventoryHandler<StackType> t, StorageChannel chan) {
|
public MEMonitorHandler(IMEInventoryHandler<StackType> t, StorageChannel chan) {
|
||||||
internalHandler = t;
|
this.internalHandler = t;
|
||||||
cachedList = (IItemList<StackType>) chan.createList();
|
this.cachedList = (IItemList<StackType>) chan.createList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addListener(IMEMonitorHandlerReceiver<StackType> l, Object verificationToken)
|
public void addListener(IMEMonitorHandlerReceiver<StackType> l, Object verificationToken)
|
||||||
{
|
{
|
||||||
listeners.put( l, verificationToken );
|
this.listeners.put( l, verificationToken );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeListener(IMEMonitorHandlerReceiver<StackType> l)
|
public void removeListener(IMEMonitorHandlerReceiver<StackType> l)
|
||||||
{
|
{
|
||||||
listeners.remove( l );
|
this.listeners.remove( l );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
|
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
|
||||||
{
|
{
|
||||||
if ( mode == Actionable.SIMULATE )
|
if ( mode == Actionable.SIMULATE )
|
||||||
return getHandler().injectItems( input, mode, src );
|
return this.getHandler().injectItems( input, mode, src );
|
||||||
return monitorDifference(input.copy(), getHandler().injectItems(input, mode, src), false, src);
|
return this.monitorDifference(input.copy(), this.getHandler().injectItems(input, mode, src), false, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
|
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
|
||||||
{
|
{
|
||||||
if ( mode == Actionable.SIMULATE )
|
if ( mode == Actionable.SIMULATE )
|
||||||
return getHandler().extractItems( request, mode, src );
|
return this.getHandler().extractItems( request, mode, src );
|
||||||
return monitorDifference(request.copy(), getHandler().extractItems(request, mode, src), true, src);
|
return this.monitorDifference(request.copy(), this.getHandler().extractItems(request, mode, src), true, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemList<StackType> getStorageList()
|
public IItemList<StackType> getStorageList()
|
||||||
{
|
{
|
||||||
if ( hasChanged )
|
if ( this.hasChanged )
|
||||||
{
|
{
|
||||||
hasChanged = false;
|
this.hasChanged = false;
|
||||||
cachedList.resetStatus();
|
this.cachedList.resetStatus();
|
||||||
return getAvailableItems( cachedList );
|
return this.getAvailableItems( this.cachedList );
|
||||||
}
|
}
|
||||||
|
|
||||||
return cachedList;
|
return this.cachedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemList<StackType> getAvailableItems(IItemList out)
|
public IItemList<StackType> getAvailableItems(IItemList out)
|
||||||
{
|
{
|
||||||
return getHandler().getAvailableItems( out );
|
return this.getHandler().getAvailableItems( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StorageChannel getChannel()
|
public StorageChannel getChannel()
|
||||||
{
|
{
|
||||||
return getHandler().getChannel();
|
return this.getHandler().getChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccessRestriction getAccess()
|
public AccessRestriction getAccess()
|
||||||
{
|
{
|
||||||
return getHandler().getAccess();
|
return this.getHandler().getAccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPrioritized(StackType input)
|
public boolean isPrioritized(StackType input)
|
||||||
{
|
{
|
||||||
return getHandler().isPrioritized( input );
|
return this.getHandler().isPrioritized( input );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAccept(StackType input)
|
public boolean canAccept(StackType input)
|
||||||
{
|
{
|
||||||
return getHandler().canAccept( input );
|
return this.getHandler().canAccept( input );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPriority()
|
public int getPriority()
|
||||||
{
|
{
|
||||||
return getHandler().getPriority();
|
return this.getHandler().getPriority();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSlot()
|
public int getSlot()
|
||||||
{
|
{
|
||||||
return getHandler().getSlot();
|
return this.getHandler().getSlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean validForPass(int i)
|
public boolean validForPass(int i)
|
||||||
{
|
{
|
||||||
return getHandler().validForPass( i );
|
return this.getHandler().validForPass( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ 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 ) {
|
||||||
type = t;
|
this.type = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IItemList createList() {
|
public IItemList createList() {
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ public enum AEColor
|
|||||||
|
|
||||||
AEColor(String unlocalizedName, int blackHex, int medHex, int whiteHex) {
|
AEColor(String unlocalizedName, int blackHex, int medHex, int whiteHex) {
|
||||||
this.unlocalizedName = unlocalizedName;
|
this.unlocalizedName = unlocalizedName;
|
||||||
blackVariant = blackHex;
|
this.blackVariant = blackHex;
|
||||||
mediumVariant = medHex;
|
this.mediumVariant = medHex;
|
||||||
whiteVariant = whiteHex;
|
this.whiteVariant = whiteHex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,13 +99,13 @@ public enum AEColor
|
|||||||
*/
|
*/
|
||||||
public boolean matches(AEColor color)
|
public boolean matches(AEColor color)
|
||||||
{
|
{
|
||||||
return equals(Transparent) || color.equals(Transparent) || equals(color);
|
return this == Transparent || color == Transparent || this == color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return StatCollector.translateToLocal( unlocalizedName );
|
return StatCollector.translateToLocal( this.unlocalizedName );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -37,20 +37,20 @@ public class DimensionalCoord extends WorldCoord
|
|||||||
|
|
||||||
public DimensionalCoord(DimensionalCoord s) {
|
public DimensionalCoord(DimensionalCoord s) {
|
||||||
super( s.x, s.y, s.z );
|
super( s.x, s.y, s.z );
|
||||||
w = s.w;
|
this.w = s.w;
|
||||||
dimId = s.dimId;
|
this.dimId = s.dimId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimensionalCoord(TileEntity s) {
|
public DimensionalCoord(TileEntity s) {
|
||||||
super( s );
|
super( s );
|
||||||
w = s.getWorldObj();
|
this.w = s.getWorldObj();
|
||||||
dimId = w.provider.dimensionId;
|
this.dimId = this.w.provider.dimensionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimensionalCoord(World _w, int _x, int _y, int _z) {
|
public DimensionalCoord(World _w, int _x, int _y, int _z) {
|
||||||
super( _x, _y, _z );
|
super( _x, _y, _z );
|
||||||
w = _w;
|
this.w = _w;
|
||||||
dimId = _w.provider.dimensionId;
|
this.dimId = _w.provider.dimensionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,34 +61,34 @@ public class DimensionalCoord extends WorldCoord
|
|||||||
|
|
||||||
public boolean isEqual(DimensionalCoord c)
|
public boolean isEqual(DimensionalCoord c)
|
||||||
{
|
{
|
||||||
return x == c.x && y == c.y && z == c.z && c.w == this.w;
|
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj)
|
public boolean equals(Object obj)
|
||||||
{
|
{
|
||||||
return obj instanceof DimensionalCoord && isEqual((DimensionalCoord) obj);
|
return obj instanceof DimensionalCoord && this.isEqual((DimensionalCoord) obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
return super.hashCode() ^ dimId;
|
return super.hashCode() ^ this.dimId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInWorld(World world)
|
public boolean isInWorld(World world)
|
||||||
{
|
{
|
||||||
return w == world;
|
return this.w == world;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return dimId + "," + super.toString();
|
return "dimension=" + this.dimId + ", " + super.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public World getWorld()
|
public World getWorld()
|
||||||
{
|
{
|
||||||
return w;
|
return this.w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -39,56 +39,56 @@ public class WorldCoord
|
|||||||
|
|
||||||
public WorldCoord add(ForgeDirection direction, int length)
|
public WorldCoord add(ForgeDirection direction, int length)
|
||||||
{
|
{
|
||||||
x += direction.offsetX * length;
|
this.x += direction.offsetX * length;
|
||||||
y += direction.offsetY * length;
|
this.y += direction.offsetY * length;
|
||||||
z += direction.offsetZ * length;
|
this.z += direction.offsetZ * length;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord subtract(ForgeDirection direction, int length)
|
public WorldCoord subtract(ForgeDirection direction, int length)
|
||||||
{
|
{
|
||||||
x -= direction.offsetX * length;
|
this.x -= direction.offsetX * length;
|
||||||
y -= direction.offsetY * length;
|
this.y -= direction.offsetY * length;
|
||||||
z -= direction.offsetZ * length;
|
this.z -= direction.offsetZ * length;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord add(int _x, int _y, int _z)
|
public WorldCoord add(int _x, int _y, int _z)
|
||||||
{
|
{
|
||||||
x += _x;
|
this.x += _x;
|
||||||
y += _y;
|
this.y += _y;
|
||||||
z += _z;
|
this.z += _z;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord subtract(int _x, int _y, int _z)
|
public WorldCoord subtract(int _x, int _y, int _z)
|
||||||
{
|
{
|
||||||
x -= _x;
|
this.x -= _x;
|
||||||
y -= _y;
|
this.y -= _y;
|
||||||
z -= _z;
|
this.z -= _z;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord multiple(int _x, int _y, int _z)
|
public WorldCoord multiple(int _x, int _y, int _z)
|
||||||
{
|
{
|
||||||
x *= _x;
|
this.x *= _x;
|
||||||
y *= _y;
|
this.y *= _y;
|
||||||
z *= _z;
|
this.z *= _z;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord divide(int _x, int _y, int _z)
|
public WorldCoord divide(int _x, int _y, int _z)
|
||||||
{
|
{
|
||||||
x /= _x;
|
this.x /= _x;
|
||||||
y /= _y;
|
this.y /= _y;
|
||||||
z /= _z;
|
this.z /= _z;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord(int _x, int _y, int _z) {
|
public WorldCoord(int _x, int _y, int _z) {
|
||||||
x = _x;
|
this.x = _x;
|
||||||
y = _y;
|
this.y = _y;
|
||||||
z = _z;
|
this.z = _z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord(TileEntity s) {
|
public WorldCoord(TileEntity s) {
|
||||||
@@ -100,9 +100,9 @@ public class WorldCoord
|
|||||||
*/
|
*/
|
||||||
public ForgeDirection directionTo(WorldCoord loc)
|
public ForgeDirection directionTo(WorldCoord loc)
|
||||||
{
|
{
|
||||||
int ox = x - loc.x;
|
int ox = this.x - loc.x;
|
||||||
int oy = y - loc.y;
|
int oy = this.y - loc.y;
|
||||||
int oz = z - loc.z;
|
int oz = this.z - loc.z;
|
||||||
|
|
||||||
int xlen = Math.abs( ox );
|
int xlen = Math.abs( ox );
|
||||||
int ylen = Math.abs( oy );
|
int ylen = Math.abs( oy );
|
||||||
@@ -131,29 +131,29 @@ public class WorldCoord
|
|||||||
|
|
||||||
public boolean isEqual(WorldCoord c)
|
public boolean isEqual(WorldCoord c)
|
||||||
{
|
{
|
||||||
return x == c.x && y == c.y && z == c.z;
|
return this.x == c.x && this.y == c.y && this.z == c.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldCoord copy()
|
public WorldCoord copy()
|
||||||
{
|
{
|
||||||
return new WorldCoord( x, y, z );
|
return new WorldCoord( this.x, this.y, this.z );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj)
|
public boolean equals(Object obj)
|
||||||
{
|
{
|
||||||
return obj instanceof WorldCoord && isEqual((WorldCoord) obj);
|
return obj instanceof WorldCoord && this.isEqual((WorldCoord) obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return "" + x + "," + y + "," + z;
|
return "x=" + this.x + ", y=" + this.y + ", z=" + this.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
return (y << 24) ^ x ^ z;
|
return ( this.y << 24) ^ this.x ^ this.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,39 +102,39 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
|
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
|
||||||
{
|
{
|
||||||
this( c, mat, Optional.<String> absent() );
|
this( c, mat, Optional.<String> absent() );
|
||||||
setLightOpacity( 255 );
|
this.setLightOpacity( 255 );
|
||||||
setLightLevel( 0 );
|
this.setLightLevel( 0 );
|
||||||
setHardness( 2.2F );
|
this.setHardness( 2.2F );
|
||||||
setTileProvider( false );
|
this.setTileProvider( false );
|
||||||
setHarvestLevel( "pickaxe", 0 );
|
this.setHarvestLevel( "pickaxe", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
|
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
|
||||||
{
|
{
|
||||||
super( mat );
|
super( mat );
|
||||||
|
|
||||||
if ( mat == AEGlassMaterial.instance || mat == Material.glass )
|
if ( mat == AEGlassMaterial.INSTANCE || mat == Material.glass )
|
||||||
setStepSound( Block.soundTypeGlass );
|
this.setStepSound( Block.soundTypeGlass );
|
||||||
else if ( mat == Material.rock )
|
else if ( mat == Material.rock )
|
||||||
setStepSound( Block.soundTypeStone );
|
this.setStepSound( Block.soundTypeStone );
|
||||||
else if ( mat == Material.wood )
|
else if ( mat == Material.wood )
|
||||||
setStepSound( Block.soundTypeWood );
|
this.setStepSound( Block.soundTypeWood );
|
||||||
else
|
else
|
||||||
setStepSound( Block.soundTypeMetal );
|
this.setStepSound( Block.soundTypeMetal );
|
||||||
|
|
||||||
featureFullName = new FeatureNameExtractor( c, subName ).get();
|
this.featureFullName = new FeatureNameExtractor( c, subName ).get();
|
||||||
featureSubName = subName;
|
this.featureSubName = subName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return featureFullName;
|
return this.featureFullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerNoIcons()
|
public void registerNoIcons()
|
||||||
{
|
{
|
||||||
BlockRenderInfo info = getRendererInstance();
|
BlockRenderInfo info = this.getRendererInstance();
|
||||||
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
|
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
|
||||||
info.updateIcons( i, i, i, i, i, i );
|
info.updateIcons( i, i, i, i, i, i );
|
||||||
}
|
}
|
||||||
@@ -147,9 +147,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
protected void setTileEntity( Class<? extends TileEntity> c )
|
protected void setTileEntity( Class<? extends TileEntity> c )
|
||||||
{
|
{
|
||||||
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
|
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
|
||||||
GameRegistry.registerTileEntity( tileEntityType = c, featureFullName );
|
GameRegistry.registerTileEntity( this.tileEntityType = c, this.featureFullName );
|
||||||
isInventory = IInventory.class.isAssignableFrom( c );
|
this.isInventory = IInventory.class.isAssignableFrom( c );
|
||||||
setTileProvider( hasBlockTileEntity() );
|
this.setTileProvider( this.hasBlockTileEntity() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// update Block value.
|
// update Block value.
|
||||||
@@ -166,7 +166,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
final public IFeatureHandler handler()
|
final public IFeatureHandler handler()
|
||||||
{
|
{
|
||||||
return handler;
|
return this.handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -177,36 +177,36 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
public boolean isOpaque()
|
public boolean isOpaque()
|
||||||
{
|
{
|
||||||
return isOpaque;
|
return this.isOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
public boolean renderAsNormalBlock()
|
||||||
{
|
{
|
||||||
return isFullSize && isOpaque;
|
return this.isFullSize && this.isOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public int getRenderType()
|
public int getRenderType()
|
||||||
{
|
{
|
||||||
return WorldRender.instance.getRenderId();
|
return WorldRender.INSTANCE.getRenderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
|
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
|
||||||
{
|
{
|
||||||
return getIcon( mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
|
return this.getIcon( this.mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public IIcon getIcon( int direction, int metadata )
|
public IIcon getIcon( int direction, int metadata )
|
||||||
{
|
{
|
||||||
if ( renderIcon != null )
|
if ( this.renderIcon != null )
|
||||||
return renderIcon;
|
return this.renderIcon;
|
||||||
|
|
||||||
return getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
|
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -220,7 +220,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
collisionHandler = ( ICustomCollision ) this;
|
collisionHandler = ( ICustomCollision ) this;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AEBaseTile te = getTileEntity( w, x, y, z );
|
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te instanceof ICustomCollision )
|
if ( te instanceof ICustomCollision )
|
||||||
collisionHandler = ( ICustomCollision ) te;
|
collisionHandler = ( ICustomCollision ) te;
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
collisionHandler = ( ICustomCollision ) this;
|
collisionHandler = ( ICustomCollision ) this;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AEBaseTile te = getTileEntity( w, x, y, z );
|
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te instanceof ICustomCollision )
|
if ( te instanceof ICustomCollision )
|
||||||
collisionHandler = ( ICustomCollision ) te;
|
collisionHandler = ( ICustomCollision ) te;
|
||||||
}
|
}
|
||||||
@@ -275,11 +275,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
for ( AxisAlignedBB bb : bbs )
|
for ( AxisAlignedBB bb : bbs )
|
||||||
{
|
{
|
||||||
setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ );
|
this.setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ );
|
||||||
|
|
||||||
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
|
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
|
||||||
|
|
||||||
setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
|
|
||||||
if ( r != null )
|
if ( r != null )
|
||||||
{
|
{
|
||||||
@@ -330,7 +330,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
final public boolean isOpaqueCube()
|
final public boolean isOpaqueCube()
|
||||||
{
|
{
|
||||||
return isOpaque;
|
return this.isOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -342,7 +342,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
collisionHandler = ( ICustomCollision ) this;
|
collisionHandler = ( ICustomCollision ) this;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AEBaseTile te = getTileEntity( w, x, y, z );
|
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te instanceof ICustomCollision )
|
if ( te instanceof ICustomCollision )
|
||||||
collisionHandler = ( ICustomCollision ) te;
|
collisionHandler = ( ICustomCollision ) te;
|
||||||
}
|
}
|
||||||
@@ -356,11 +356,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
for ( AxisAlignedBB bb : bbs )
|
for ( AxisAlignedBB bb : bbs )
|
||||||
{
|
{
|
||||||
setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ );
|
this.setBlockBounds( ( float ) bb.minX, ( float ) bb.minY, ( float ) bb.minZ, ( float ) bb.maxX, ( float ) bb.maxY, ( float ) bb.maxZ );
|
||||||
|
|
||||||
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
|
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
|
||||||
|
|
||||||
setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
|
|
||||||
if ( r != null )
|
if ( r != null )
|
||||||
{
|
{
|
||||||
@@ -384,7 +384,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
return super.collisionRayTrace( w, x, y, z, a, b );
|
return super.collisionRayTrace( w, x, y, z, a, b );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
Block id = w.getBlock( x, y, z );
|
Block id = w.getBlock( x, y, z );
|
||||||
if ( id != null )
|
if ( id != null )
|
||||||
{
|
{
|
||||||
AEBaseTile tile = getTileEntity( w, x, y, z );
|
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||||
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
|
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
|
||||||
|
|
||||||
if ( tile == null )
|
if ( tile == null )
|
||||||
@@ -436,10 +436,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
IMemoryCard memoryCard = ( IMemoryCard ) is.getItem();
|
IMemoryCard memoryCard = ( IMemoryCard ) is.getItem();
|
||||||
if ( player.isSneaking() )
|
if ( player.isSneaking() )
|
||||||
{
|
{
|
||||||
AEBaseTile t = getTileEntity( w, x, y, z );
|
AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||||
if ( t != null )
|
if ( t != null )
|
||||||
{
|
{
|
||||||
String name = getUnlocalizedName();
|
String name = this.getUnlocalizedName();
|
||||||
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||||
if ( data != null )
|
if ( data != null )
|
||||||
{
|
{
|
||||||
@@ -453,9 +453,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
{
|
{
|
||||||
String name = memoryCard.getSettingsName( is );
|
String name = memoryCard.getSettingsName( is );
|
||||||
NBTTagCompound data = memoryCard.getData( is );
|
NBTTagCompound data = memoryCard.getData( is );
|
||||||
if ( getUnlocalizedName().equals( name ) )
|
if ( this.getUnlocalizedName().equals( name ) )
|
||||||
{
|
{
|
||||||
AEBaseTile t = getTileEntity( w, x, y, z );
|
AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||||
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||||
}
|
}
|
||||||
@@ -467,7 +467,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||||
@@ -480,7 +480,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
{
|
{
|
||||||
if ( is.hasDisplayName() )
|
if ( is.hasDisplayName() )
|
||||||
{
|
{
|
||||||
TileEntity te = getTileEntity( w, x, y, z );
|
TileEntity te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te instanceof AEBaseTile )
|
if ( te instanceof AEBaseTile )
|
||||||
( ( AEBaseTile ) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
|
( ( AEBaseTile ) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
|
||||||
}
|
}
|
||||||
@@ -497,13 +497,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
public boolean hasComparatorInputOverride()
|
public boolean hasComparatorInputOverride()
|
||||||
{
|
{
|
||||||
return isInventory;
|
return this.isInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
|
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
|
||||||
{
|
{
|
||||||
TileEntity te = getTileEntity( w, x, y, z );
|
TileEntity te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te instanceof IInventory )
|
if ( te instanceof IInventory )
|
||||||
return Container.calcRedstoneFromInventory( ( IInventory ) te );
|
return Container.calcRedstoneFromInventory( ( IInventory ) te );
|
||||||
return 0;
|
return 0;
|
||||||
@@ -513,7 +513,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||||
{
|
{
|
||||||
BlockRenderInfo info = getRendererInstance();
|
BlockRenderInfo info = this.getRendererInstance();
|
||||||
FlippableIcon topIcon;
|
FlippableIcon topIcon;
|
||||||
FlippableIcon bottomIcon;
|
FlippableIcon bottomIcon;
|
||||||
FlippableIcon sideIcon;
|
FlippableIcon sideIcon;
|
||||||
@@ -522,13 +522,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
FlippableIcon southIcon;
|
FlippableIcon southIcon;
|
||||||
FlippableIcon northIcon;
|
FlippableIcon northIcon;
|
||||||
|
|
||||||
this.blockIcon = topIcon = optionalIcon( iconRegistry, this.getTextureName(), null );
|
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
|
||||||
bottomIcon = optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
|
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
|
||||||
sideIcon = optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
|
sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
|
||||||
eastIcon = optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
|
eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
|
||||||
westIcon = optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
|
westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
|
||||||
southIcon = optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
|
southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
|
||||||
northIcon = optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
|
northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
|
||||||
|
|
||||||
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
|
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
|
||||||
}
|
}
|
||||||
@@ -536,7 +536,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
final public boolean isNormalCube( IBlockAccess world, int x, int y, int z )
|
final public boolean isNormalCube( IBlockAccess world, int x, int y, int z )
|
||||||
{
|
{
|
||||||
return isFullSize;
|
return this.isFullSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -544,9 +544,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
{
|
{
|
||||||
IOrientable rotatable = null;
|
IOrientable rotatable = null;
|
||||||
|
|
||||||
if ( hasBlockTileEntity() )
|
if ( this.hasBlockTileEntity() )
|
||||||
{
|
{
|
||||||
rotatable = ( AEBaseTile ) getTileEntity( w, x, y, z );
|
rotatable = ( AEBaseTile ) this.getTileEntity( w, x, y, z );
|
||||||
}
|
}
|
||||||
else if ( this instanceof IOrientableBlock )
|
else if ( this instanceof IOrientableBlock )
|
||||||
{
|
{
|
||||||
@@ -555,9 +555,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
if ( rotatable != null && rotatable.canBeRotated() )
|
if ( rotatable != null && rotatable.canBeRotated() )
|
||||||
{
|
{
|
||||||
if ( hasCustomRotation() )
|
if ( this.hasCustomRotation() )
|
||||||
{
|
{
|
||||||
customRotateBlock( rotatable, axis );
|
this.customRotateBlock( rotatable, axis );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -600,9 +600,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
final public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
|
final public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
|
||||||
{
|
{
|
||||||
if ( hasBlockTileEntity() )
|
if ( this.hasBlockTileEntity() )
|
||||||
{
|
{
|
||||||
AEBaseTile obj = getTileEntity( w, x, y, z );
|
AEBaseTile obj = this.getTileEntity( w, x, y, z );
|
||||||
if ( obj != null && obj.canBeRotated() )
|
if ( obj != null && obj.canBeRotated() )
|
||||||
{
|
{
|
||||||
return ForgeDirection.VALID_DIRECTIONS;
|
return ForgeDirection.VALID_DIRECTIONS;
|
||||||
@@ -615,7 +615,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
|
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
|
||||||
{
|
{
|
||||||
TileEntity te = getTileEntity( world, x, y, z );
|
TileEntity te = this.getTileEntity( world, x, y, z );
|
||||||
|
|
||||||
if ( te instanceof IColorableTile )
|
if ( te instanceof IColorableTile )
|
||||||
{
|
{
|
||||||
@@ -637,12 +637,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public BlockRenderInfo getRendererInstance()
|
public BlockRenderInfo getRendererInstance()
|
||||||
{
|
{
|
||||||
if ( renderInfo != null )
|
if ( this.renderInfo != null )
|
||||||
return renderInfo;
|
return this.renderInfo;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return renderInfo = new BlockRenderInfo( getRenderer().newInstance() );
|
return this.renderInfo = new BlockRenderInfo( this.getRenderer().newInstance() );
|
||||||
}
|
}
|
||||||
catch ( Throwable t )
|
catch ( Throwable t )
|
||||||
{
|
{
|
||||||
@@ -694,9 +694,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
{
|
{
|
||||||
IOrientable ori = null;
|
IOrientable ori = null;
|
||||||
|
|
||||||
if ( hasBlockTileEntity() )
|
if ( this.hasBlockTileEntity() )
|
||||||
{
|
{
|
||||||
ori = ( AEBaseTile ) getTileEntity( w, x, y, z );
|
ori = ( AEBaseTile ) this.getTileEntity( w, x, y, z );
|
||||||
}
|
}
|
||||||
else if ( this instanceof IOrientableBlock )
|
else if ( this instanceof IOrientableBlock )
|
||||||
{
|
{
|
||||||
@@ -705,7 +705,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
if ( ori != null && ori.canBeRotated() )
|
if ( ori != null && ori.canBeRotated() )
|
||||||
{
|
{
|
||||||
return mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal();
|
return this.mapRotation( ori, ForgeDirection.getOrientation( s ) ).ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
@@ -713,16 +713,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
public boolean hasBlockTileEntity()
|
public boolean hasBlockTileEntity()
|
||||||
{
|
{
|
||||||
return tileEntityType != null;
|
return this.tileEntityType != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
||||||
{
|
{
|
||||||
if ( !hasBlockTileEntity() )
|
if ( !this.hasBlockTileEntity() )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
TileEntity te = w.getTileEntity( x, y, z );
|
TileEntity te = w.getTileEntity( x, y, z );
|
||||||
if ( tileEntityType.isInstance( te ) )
|
if ( this.tileEntityType.isInstance( te ) )
|
||||||
return ( T ) te;
|
return ( T ) te;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -752,19 +752,19 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
if ( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
|
if ( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
|
||||||
west = dx;
|
west = dx;
|
||||||
|
|
||||||
if ( dir.equals( forward ) )
|
if ( dir == forward )
|
||||||
return ForgeDirection.SOUTH;
|
return ForgeDirection.SOUTH;
|
||||||
if ( dir.equals( forward.getOpposite() ) )
|
if ( dir == forward.getOpposite() )
|
||||||
return ForgeDirection.NORTH;
|
return ForgeDirection.NORTH;
|
||||||
|
|
||||||
if ( dir.equals( up ) )
|
if ( dir == up )
|
||||||
return ForgeDirection.UP;
|
return ForgeDirection.UP;
|
||||||
if ( dir.equals( up.getOpposite() ) )
|
if ( dir == up.getOpposite() )
|
||||||
return ForgeDirection.DOWN;
|
return ForgeDirection.DOWN;
|
||||||
|
|
||||||
if ( dir.equals( west ) )
|
if ( dir == west )
|
||||||
return ForgeDirection.WEST;
|
return ForgeDirection.WEST;
|
||||||
if ( dir.equals( west.getOpposite() ) )
|
if ( dir == west.getOpposite() )
|
||||||
return ForgeDirection.EAST;
|
return ForgeDirection.EAST;
|
||||||
|
|
||||||
return ForgeDirection.UNKNOWN;
|
return ForgeDirection.UNKNOWN;
|
||||||
@@ -772,7 +772,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
public Class<? extends TileEntity> getTileEntityClass()
|
public Class<? extends TileEntity> getTileEntityClass()
|
||||||
{
|
{
|
||||||
return tileEntityType;
|
return this.tileEntityType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
@@ -784,11 +784,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
final public TileEntity createNewTileEntity( World var1, int var2 )
|
final public TileEntity createNewTileEntity( World var1, int var2 )
|
||||||
{
|
{
|
||||||
if ( hasBlockTileEntity() )
|
if ( this.hasBlockTileEntity() )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return tileEntityType.newInstance();
|
return this.tileEntityType.newInstance();
|
||||||
}
|
}
|
||||||
catch ( Throwable e )
|
catch ( Throwable e )
|
||||||
{
|
{
|
||||||
@@ -801,7 +801,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
@Override
|
@Override
|
||||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||||
{
|
{
|
||||||
AEBaseTile te = getTileEntity( w, x, y, z );
|
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te != null )
|
if ( te != null )
|
||||||
{
|
{
|
||||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||||
@@ -821,7 +821,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
public String getUnlocalizedName( ItemStack is )
|
public String getUnlocalizedName( ItemStack is )
|
||||||
{
|
{
|
||||||
return getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
|
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
|
||||||
@@ -836,6 +836,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
|||||||
|
|
||||||
public boolean hasSubtypes()
|
public boolean hasSubtypes()
|
||||||
{
|
{
|
||||||
return hasSubtypes;
|
return this.hasSubtypes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.api.util.IOrientableBlock;
|
import appeng.api.util.IOrientableBlock;
|
||||||
import appeng.block.misc.BlockLightDetector;
|
import appeng.block.misc.BlockLightDetector;
|
||||||
@@ -37,8 +41,6 @@ import appeng.client.render.ItemRenderer;
|
|||||||
import appeng.me.helpers.IGridProxyable;
|
import appeng.me.helpers.IGridProxyable;
|
||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class AEBaseItemBlock extends ItemBlock
|
public class AEBaseItemBlock extends ItemBlock
|
||||||
{
|
{
|
||||||
@@ -48,17 +50,17 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
public AEBaseItemBlock(Block id)
|
public AEBaseItemBlock(Block id)
|
||||||
{
|
{
|
||||||
super( id );
|
super( id );
|
||||||
blockType = (AEBaseBlock) id;
|
this.blockType = (AEBaseBlock) id;
|
||||||
hasSubtypes = blockType.hasSubtypes;
|
this.hasSubtypes = this.blockType.hasSubtypes;
|
||||||
|
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.instance );
|
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.INSTANCE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(int dmg)
|
public int getMetadata(int dmg)
|
||||||
{
|
{
|
||||||
if ( hasSubtypes )
|
if ( this.hasSubtypes )
|
||||||
return dmg;
|
return dmg;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -66,7 +68,7 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack is)
|
public String getUnlocalizedName(ItemStack is)
|
||||||
{
|
{
|
||||||
return blockType.getUnlocalizedName( is );
|
return this.blockType.getUnlocalizedName( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,9 +93,9 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
|
|
||||||
IOrientable ori = null;
|
IOrientable ori = null;
|
||||||
|
|
||||||
if ( blockType.hasBlockTileEntity() )
|
if ( this.blockType.hasBlockTileEntity() )
|
||||||
{
|
{
|
||||||
if ( blockType instanceof BlockLightDetector )
|
if ( this.blockType instanceof BlockLightDetector )
|
||||||
{
|
{
|
||||||
up = ForgeDirection.getOrientation( side );
|
up = ForgeDirection.getOrientation( side );
|
||||||
if ( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
|
if ( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
|
||||||
@@ -101,7 +103,7 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
else
|
else
|
||||||
forward = ForgeDirection.UP;
|
forward = ForgeDirection.UP;
|
||||||
}
|
}
|
||||||
else if ( blockType instanceof BlockWireless || blockType instanceof BlockSkyCompass )
|
else if ( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass )
|
||||||
{
|
{
|
||||||
forward = ForgeDirection.getOrientation( side );
|
forward = ForgeDirection.getOrientation( side );
|
||||||
if ( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
|
if ( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
|
||||||
@@ -145,9 +147,9 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( blockType instanceof IOrientableBlock )
|
if ( this.blockType instanceof IOrientableBlock )
|
||||||
{
|
{
|
||||||
ori = ((IOrientableBlock) blockType).getOrientable( w, x, y, z );
|
ori = ((IOrientableBlock) this.blockType).getOrientable( w, x, y, z );
|
||||||
up = ForgeDirection.getOrientation( side );
|
up = ForgeDirection.getOrientation( side );
|
||||||
forward = ForgeDirection.SOUTH;
|
forward = ForgeDirection.SOUTH;
|
||||||
if ( up.offsetY == 0 )
|
if ( up.offsetY == 0 )
|
||||||
@@ -156,20 +158,20 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
ori.setOrientation( forward, up );
|
ori.setOrientation( forward, up );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !blockType.isValidOrientation( w, x, y, z, forward, up ) )
|
if ( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
|
if ( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
|
||||||
{
|
{
|
||||||
if ( blockType.hasBlockTileEntity() && !(blockType instanceof BlockLightDetector) )
|
if ( this.blockType.hasBlockTileEntity() && !(this.blockType instanceof BlockLightDetector) )
|
||||||
{
|
{
|
||||||
AEBaseTile tile = blockType.getTileEntity( w, x, y, z );
|
AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z );
|
||||||
ori = tile;
|
ori = tile;
|
||||||
|
|
||||||
if ( tile == null )
|
if ( tile == null )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( ori.canBeRotated() && !blockType.hasCustomRotation() )
|
if ( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
|
||||||
{
|
{
|
||||||
if ( ori.getForward() == null || ori.getUp() == null || // null
|
if ( ori.getForward() == null || ori.getUp() == null || // null
|
||||||
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
|
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
|
||||||
@@ -183,7 +185,7 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
|
|
||||||
tile.onPlacement( stack, player, side );
|
tile.onPlacement( stack, player, side );
|
||||||
}
|
}
|
||||||
else if ( blockType instanceof IOrientableBlock )
|
else if ( this.blockType instanceof IOrientableBlock )
|
||||||
{
|
{
|
||||||
ori.setOrientation( forward, up );
|
ori.setOrientation( forward, up );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,47 +88,47 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
|||||||
@Override
|
@Override
|
||||||
public double injectAEPower(ItemStack is, double amt)
|
public double injectAEPower(ItemStack is, double amt)
|
||||||
{
|
{
|
||||||
double internalCurrentPower = getInternal( is );
|
double internalCurrentPower = this.getInternal( is );
|
||||||
double internalMaxPower = getMaxEnergyCapacity();
|
double internalMaxPower = this.getMaxEnergyCapacity();
|
||||||
internalCurrentPower += amt;
|
internalCurrentPower += amt;
|
||||||
if ( internalCurrentPower > internalMaxPower )
|
if ( internalCurrentPower > internalMaxPower )
|
||||||
{
|
{
|
||||||
amt = internalCurrentPower - internalMaxPower;
|
amt = internalCurrentPower - internalMaxPower;
|
||||||
internalCurrentPower = internalMaxPower;
|
internalCurrentPower = internalMaxPower;
|
||||||
setInternal( is, internalCurrentPower );
|
this.setInternal( is, internalCurrentPower );
|
||||||
return amt;
|
return amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
setInternal( is, internalCurrentPower );
|
this.setInternal( is, internalCurrentPower );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double extractAEPower(ItemStack is, double amt)
|
public double extractAEPower(ItemStack is, double amt)
|
||||||
{
|
{
|
||||||
double internalCurrentPower = getInternal( is );
|
double internalCurrentPower = this.getInternal( is );
|
||||||
if ( internalCurrentPower > amt )
|
if ( internalCurrentPower > amt )
|
||||||
{
|
{
|
||||||
internalCurrentPower -= amt;
|
internalCurrentPower -= amt;
|
||||||
setInternal( is, internalCurrentPower );
|
this.setInternal( is, internalCurrentPower );
|
||||||
return amt;
|
return amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
amt = internalCurrentPower;
|
amt = internalCurrentPower;
|
||||||
setInternal( is, 0 );
|
this.setInternal( is, 0 );
|
||||||
return amt;
|
return amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getAEMaxPower(ItemStack is)
|
public double getAEMaxPower(ItemStack is)
|
||||||
{
|
{
|
||||||
return getMaxEnergyCapacity();
|
return this.getMaxEnergyCapacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getAECurrentPower(ItemStack is)
|
public double getAECurrentPower(ItemStack is)
|
||||||
{
|
{
|
||||||
return getInternal( is );
|
return this.getInternal( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,13 +20,15 @@ package appeng.block.crafting;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
|
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ package appeng.block.crafting;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||||
|
|
||||||
@@ -35,7 +37,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
|
|||||||
{
|
{
|
||||||
super( BlockCraftingStorage.class );
|
super( BlockCraftingStorage.class );
|
||||||
|
|
||||||
setTileEntity( TileCraftingStorageTile.class );
|
this.setTileEntity( TileCraftingStorageTile.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -56,7 +58,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
|
|||||||
if ( is.getItemDamage() == 3 )
|
if ( is.getItemDamage() == 3 )
|
||||||
return "tile.appliedenergistics2.BlockCraftingStorage64k";
|
return "tile.appliedenergistics2.BlockCraftingStorage64k";
|
||||||
|
|
||||||
return getItemUnlocalizedName( is );
|
return this.getItemUnlocalizedName( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ package appeng.block.crafting;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
@@ -32,6 +30,10 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockCraftingCPU;
|
import appeng.client.render.blocks.RenderBlockCraftingCPU;
|
||||||
@@ -49,21 +51,21 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
{
|
{
|
||||||
super( childClass, Material.iron );
|
super( childClass, Material.iron );
|
||||||
|
|
||||||
hasSubtypes = true;
|
this.hasSubtypes = true;
|
||||||
setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
|
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockCraftingUnit()
|
public BlockCraftingUnit()
|
||||||
{
|
{
|
||||||
this( BlockCraftingUnit.class );
|
this( BlockCraftingUnit.class );
|
||||||
|
|
||||||
setTileEntity( TileCraftingTile.class );
|
this.setTileEntity( TileCraftingTile.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
TileCraftingTile tg = getTileEntity( w, x, y, z );
|
TileCraftingTile tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
if ( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
@@ -80,7 +82,7 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
public int getDamageValue(World w, int x, int y, int z)
|
public int getDamageValue(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
int meta = w.getBlockMetadata( x, y, z );
|
int meta = w.getBlockMetadata( x, y, z );
|
||||||
return damageDropped( meta );
|
return this.damageDropped( meta );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +97,7 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
if ( is.getItemDamage() == 1 )
|
if ( is.getItemDamage() == 1 )
|
||||||
return "tile.appliedenergistics2.BlockCraftingAccelerator";
|
return "tile.appliedenergistics2.BlockCraftingAccelerator";
|
||||||
|
|
||||||
return getItemUnlocalizedName( is );
|
return this.getItemUnlocalizedName( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getItemUnlocalizedName(ItemStack is)
|
protected String getItemUnlocalizedName(ItemStack is)
|
||||||
@@ -106,9 +108,9 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public void setRenderStateByMeta(int itemDamage)
|
public void setRenderStateByMeta(int itemDamage)
|
||||||
{
|
{
|
||||||
IIcon front = getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
|
IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
|
||||||
IIcon other = getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
|
IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
|
||||||
getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
|
this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -137,7 +139,7 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public void breakBlock(World w, int x, int y, int z, Block a, int b)
|
public void breakBlock(World w, int x, int y, int z, Block a, int b)
|
||||||
{
|
{
|
||||||
TileCraftingTile cp = getTileEntity( w, x, y, z );
|
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||||
if ( cp != null )
|
if ( cp != null )
|
||||||
cp.breakCluster();
|
cp.breakCluster();
|
||||||
|
|
||||||
@@ -147,7 +149,7 @@ public class BlockCraftingUnit extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
||||||
{
|
{
|
||||||
TileCraftingTile cp = getTileEntity( w, x, y, z );
|
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||||
if ( cp != null )
|
if ( cp != null )
|
||||||
cp.updateMultiBlock();
|
cp.updateMultiBlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockAssembler;
|
import appeng.client.render.blocks.RenderBlockAssembler;
|
||||||
@@ -31,18 +35,16 @@ import appeng.core.features.AEFeature;
|
|||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.tile.crafting.TileMolecularAssembler;
|
import appeng.tile.crafting.TileMolecularAssembler;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockMolecularAssembler extends AEBaseBlock
|
public class BlockMolecularAssembler extends AEBaseBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockMolecularAssembler() {
|
public BlockMolecularAssembler() {
|
||||||
super( BlockMolecularAssembler.class, Material.iron );
|
super( BlockMolecularAssembler.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
|
this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
|
||||||
setTileEntity( TileMolecularAssembler.class );
|
this.setTileEntity( TileMolecularAssembler.class );
|
||||||
isOpaque = false;
|
this.isOpaque = false;
|
||||||
lightOpacity = 1;
|
this.lightOpacity = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean booleanAlphaPass = false;
|
public static boolean booleanAlphaPass = false;
|
||||||
@@ -70,7 +72,7 @@ public class BlockMolecularAssembler extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
TileMolecularAssembler tg = getTileEntity( w, x, y, z );
|
TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null && !p.isSneaking() )
|
if ( tg != null && !p.isSneaking() )
|
||||||
{
|
{
|
||||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
|
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package appeng.block.crafting;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.block.AEBaseItemBlock;
|
import appeng.block.AEBaseItemBlock;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.FakePlayer;
|
import net.minecraftforge.common.util.FakePlayer;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.api.implementations.tiles.ICrankable;
|
import appeng.api.implementations.tiles.ICrankable;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
@@ -43,10 +44,11 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockCrank() {
|
public BlockCrank() {
|
||||||
super( BlockCrank.class, Material.wood );
|
super( BlockCrank.class, Material.wood );
|
||||||
setFeature( EnumSet.of( AEFeature.GrindStone ) );
|
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
|
||||||
setTileEntity( TileCrank.class );
|
this.setTileEntity( TileCrank.class );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = isOpaque = false;
|
this.setHarvestLevel( "axe", 0 );
|
||||||
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,11 +56,11 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
{
|
{
|
||||||
if ( player instanceof FakePlayer || player == null )
|
if ( player instanceof FakePlayer || player == null )
|
||||||
{
|
{
|
||||||
dropCrank(w, x, y, z);
|
this.dropCrank(w, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
AEBaseTile tile = getTileEntity( w, x, y, z );
|
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile instanceof TileCrank )
|
if ( tile instanceof TileCrank )
|
||||||
{
|
{
|
||||||
if ( ((TileCrank) tile).power() )
|
if ( ((TileCrank) tile).power() )
|
||||||
@@ -86,7 +88,7 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
private ForgeDirection findCrankable( World world, int x, int y, int z )
|
private ForgeDirection findCrankable( World world, int x, int y, int z )
|
||||||
{
|
{
|
||||||
for ( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
for ( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||||
if ( isCrankable( world, x, y, z, dir ) )
|
if ( this.isCrankable( world, x, y, z, dir ) )
|
||||||
{
|
{
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
@@ -96,14 +98,14 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockAt( World world, int x, int y, int z )
|
public boolean canPlaceBlockAt( World world, int x, int y, int z )
|
||||||
{
|
{
|
||||||
return findCrankable( world , x, y, z ) != ForgeDirection.UNKNOWN;
|
return this.findCrankable( world , x, y, z ) != ForgeDirection.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
|
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
|
||||||
{
|
{
|
||||||
TileEntity te = world.getTileEntity( x, y, z );
|
TileEntity te = world.getTileEntity( x, y, z );
|
||||||
return !(te instanceof TileCrank) || isCrankable( world, x, y, z, up.getOpposite() );
|
return !(te instanceof TileCrank) || this.isCrankable( world, x, y, z, up.getOpposite() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dropCrank( World world, int x, int y, int z )
|
private void dropCrank( World world, int x, int y, int z )
|
||||||
@@ -115,10 +117,10 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack )
|
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack )
|
||||||
{
|
{
|
||||||
AEBaseTile tile = getTileEntity( world, x, y, z );
|
AEBaseTile tile = this.getTileEntity( world, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
ForgeDirection mnt = findCrankable( world, x, y, z );
|
ForgeDirection mnt = this.findCrankable( world, x, y, z );
|
||||||
ForgeDirection forward = ForgeDirection.UP;
|
ForgeDirection forward = ForgeDirection.UP;
|
||||||
if ( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
|
if ( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
|
||||||
{
|
{
|
||||||
@@ -128,24 +130,24 @@ public class BlockCrank extends AEBaseBlock
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dropCrank( world, x, y, z );
|
this.dropCrank( world, x, y, z );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block block )
|
public void onNeighborBlockChange (World world, int x, int y, int z, Block block )
|
||||||
{
|
{
|
||||||
AEBaseTile tile = getTileEntity( world, x, y, z );
|
AEBaseTile tile = this.getTileEntity( world, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
if ( !isCrankable( world, x, y, z, tile.getUp().getOpposite() ) )
|
if ( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) )
|
||||||
{
|
{
|
||||||
dropCrank( world, x, y, z );
|
this.dropCrank( world, x, y, z );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dropCrank( world, x, y, z );
|
this.dropCrank( world, x, y, z );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -35,15 +36,15 @@ public class BlockGrinder extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockGrinder() {
|
public BlockGrinder() {
|
||||||
super( BlockGrinder.class, Material.rock );
|
super( BlockGrinder.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.GrindStone ) );
|
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
|
||||||
setTileEntity( TileGrinder.class );
|
this.setTileEntity( TileGrinder.class );
|
||||||
setHardness( 3.2F );
|
this.setHardness( 3.2F );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
TileGrinder tg = getTileEntity( w, x, y, z );
|
TileGrinder tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null && !p.isSneaking() )
|
if ( tg != null && !p.isSneaking() )
|
||||||
{
|
{
|
||||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
|
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -35,8 +36,8 @@ public class BlockCellWorkbench extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockCellWorkbench() {
|
public BlockCellWorkbench() {
|
||||||
super( BlockCellWorkbench.class, Material.iron );
|
super( BlockCellWorkbench.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.StorageCells ) );
|
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
|
||||||
setTileEntity( TileCellWorkbench.class );
|
this.setTileEntity( TileCellWorkbench.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,7 +46,7 @@ public class BlockCellWorkbench extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileCellWorkbench tg = getTileEntity( w, x, y, z );
|
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
public BlockCharger() {
|
public BlockCharger() {
|
||||||
super( BlockCharger.class, Material.iron );
|
super( BlockCharger.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileCharger.class );
|
this.setTileEntity( TileCharger.class );
|
||||||
setLightOpacity( 2 );
|
this.setLightOpacity( 2 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -67,7 +67,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
{
|
{
|
||||||
TileCharger tc = getTileEntity( w, x, y, z );
|
TileCharger tc = this.getTileEntity( w, x, y, z );
|
||||||
if ( tc != null )
|
if ( tc != null )
|
||||||
{
|
{
|
||||||
tc.activate( player );
|
tc.activate( player );
|
||||||
@@ -93,7 +93,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
|||||||
if ( r.nextFloat() < 0.98 )
|
if ( r.nextFloat() < 0.98 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AEBaseTile tile = getTileEntity( w, x, y, z );
|
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile instanceof TileCharger )
|
if ( tile instanceof TileCharger )
|
||||||
{
|
{
|
||||||
TileCharger tc = (TileCharger) tile;
|
TileCharger tc = (TileCharger) tile;
|
||||||
@@ -120,7 +120,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
|||||||
@Override
|
@Override
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
||||||
{
|
{
|
||||||
TileCharger tile = getTileEntity( w, x, y, z );
|
TileCharger tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
double twoPixels = 2.0 / 16.0;
|
double twoPixels = 2.0 / 16.0;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -35,8 +36,8 @@ public class BlockCondenser extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockCondenser() {
|
public BlockCondenser() {
|
||||||
super( BlockCondenser.class, Material.iron );
|
super( BlockCondenser.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileCondenser.class );
|
this.setTileEntity( TileCondenser.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -47,7 +48,7 @@ public class BlockCondenser extends AEBaseBlock
|
|||||||
|
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
{
|
{
|
||||||
TileCondenser tc = getTileEntity( w, x, y, z );
|
TileCondenser tc = this.getTileEntity( w, x, y, z );
|
||||||
if ( tc != null && !player.isSneaking() )
|
if ( tc != null && !player.isSneaking() )
|
||||||
{
|
{
|
||||||
Platform.openGUI( player, tc, ForgeDirection.getOrientation(side), GuiBridge.GUI_CONDENSER );
|
Platform.openGUI( player, tc, ForgeDirection.getOrientation(side), GuiBridge.GUI_CONDENSER );
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockInscriber;
|
import appeng.client.render.blocks.RenderBlockInscriber;
|
||||||
@@ -37,10 +38,10 @@ public class BlockInscriber extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockInscriber() {
|
public BlockInscriber() {
|
||||||
super( BlockInscriber.class, Material.iron );
|
super( BlockInscriber.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Inscriber ) );
|
this.setFeature( EnumSet.of( AEFeature.Inscriber ) );
|
||||||
setTileEntity( TileInscriber.class );
|
this.setTileEntity( TileInscriber.class );
|
||||||
setLightOpacity( 2 );
|
this.setLightOpacity( 2 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,7 +56,7 @@ public class BlockInscriber extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileInscriber tg = getTileEntity( w, x, y, z );
|
TileInscriber tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
@@ -38,8 +39,8 @@ public class BlockInterface extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockInterface() {
|
public BlockInterface() {
|
||||||
super( BlockInterface.class, Material.iron );
|
super( BlockInterface.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileInterface.class );
|
this.setTileEntity( TileInterface.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,7 +70,7 @@ public class BlockInterface extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileInterface tg = getTileEntity( w, x, y, z );
|
TileInterface tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -23,18 +23,20 @@ import java.util.Random;
|
|||||||
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import appeng.core.features.AEFeature;
|
|
||||||
import appeng.tile.misc.TileLightDetector;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import appeng.core.features.AEFeature;
|
||||||
|
import appeng.tile.misc.TileLightDetector;
|
||||||
|
|
||||||
public class BlockLightDetector extends BlockQuartzTorch
|
public class BlockLightDetector extends BlockQuartzTorch
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockLightDetector() {
|
public BlockLightDetector() {
|
||||||
super( BlockLightDetector.class );
|
super( BlockLightDetector.class );
|
||||||
setFeature( EnumSet.of( AEFeature.LightDetector ) );
|
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
|
||||||
setTileEntity( TileLightDetector.class );
|
this.setTileEntity( TileLightDetector.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -42,7 +44,7 @@ public class BlockLightDetector extends BlockQuartzTorch
|
|||||||
{
|
{
|
||||||
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ );
|
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ );
|
||||||
|
|
||||||
TileLightDetector tld = getTileEntity( world, x, y, z );
|
TileLightDetector tld = this.getTileEntity( world, x, y, z );
|
||||||
if ( tld != null )
|
if ( tld != null )
|
||||||
tld.updateLight();
|
tld.updateLight();
|
||||||
}
|
}
|
||||||
@@ -50,7 +52,7 @@ public class BlockLightDetector extends BlockQuartzTorch
|
|||||||
@Override
|
@Override
|
||||||
public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side)
|
public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
if ( w instanceof World && ((TileLightDetector) getTileEntity( w, x, y, z )).isReady() )
|
if ( w instanceof World && ((TileLightDetector) this.getTileEntity( w, x, y, z )).isReady() )
|
||||||
return ((World) w).getBlockLightValue( x, y, z ) - 6;
|
return ((World) w).getBlockLightValue( x, y, z ) - 6;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.MapColor;
|
import net.minecraft.block.material.MapColor;
|
||||||
import net.minecraft.block.material.MaterialLiquid;
|
import net.minecraft.block.material.MaterialLiquid;
|
||||||
@@ -33,6 +31,10 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockPaint;
|
import appeng.client.render.blocks.RenderBlockPaint;
|
||||||
@@ -45,11 +47,11 @@ public class BlockPaint extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockPaint() {
|
public BlockPaint() {
|
||||||
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
|
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
|
||||||
setFeature( EnumSet.of( AEFeature.PaintBalls ) );
|
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
|
||||||
setTileEntity( TilePaint.class );
|
this.setTileEntity( TilePaint.class );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = false;
|
this.isFullSize = false;
|
||||||
isOpaque = false;
|
this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,7 +63,7 @@ public class BlockPaint extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public int getLightValue(IBlockAccess w, int x, int y, int z)
|
public int getLightValue(IBlockAccess w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TilePaint tp = getTileEntity( w, x, y, z );
|
TilePaint tp = this.getTileEntity( w, x, y, z );
|
||||||
|
|
||||||
if ( tp != null )
|
if ( tp != null )
|
||||||
{
|
{
|
||||||
@@ -82,13 +84,13 @@ public class BlockPaint extends AEBaseBlock
|
|||||||
public void fillWithRain(World w, int x, int y, int z)
|
public void fillWithRain(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
w.setBlock( x, y, z, Platform.AIR, 0, 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
||||||
{
|
{
|
||||||
TilePaint tp = getTileEntity( w, x, y, z );
|
TilePaint tp = this.getTileEntity( w, x, y, z );
|
||||||
|
|
||||||
if ( tp != null )
|
if ( tp != null )
|
||||||
tp.onNeighborBlockChange();
|
tp.onNeighborBlockChange();
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.api.util.IOrientableBlock;
|
import appeng.api.util.IOrientableBlock;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
@@ -39,17 +43,15 @@ import appeng.core.features.AEFeature;
|
|||||||
import appeng.helpers.MetaRotation;
|
import appeng.helpers.MetaRotation;
|
||||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
|
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockQuartzGrowthAccelerator() {
|
public BlockQuartzGrowthAccelerator() {
|
||||||
super( BlockQuartzGrowthAccelerator.class, Material.rock );
|
super( BlockQuartzGrowthAccelerator.class, Material.rock );
|
||||||
setStepSound( Block.soundTypeMetal );
|
this.setStepSound( Block.soundTypeMetal );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileQuartzGrowthAccelerator.class );
|
this.setTileEntity( TileQuartzGrowthAccelerator.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,7 +73,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
|
|||||||
if ( !AEConfig.instance.enableEffects )
|
if ( !AEConfig.instance.enableEffects )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = getTileEntity( w, x, y, z );
|
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
|
||||||
|
|
||||||
if ( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
if ( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,14 +53,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||||||
|
|
||||||
protected BlockQuartzTorch(Class which) {
|
protected BlockQuartzTorch(Class which) {
|
||||||
super( which, Material.circuits );
|
super( which, Material.circuits );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockQuartzTorch() {
|
public BlockQuartzTorch() {
|
||||||
this( BlockQuartzTorch.class );
|
this( BlockQuartzTorch.class );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
|
||||||
setLightLevel( 0.9375F );
|
this.setLightLevel( 0.9375F );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -86,7 +86,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||||||
public boolean canPlaceBlockAt(World w, int x, int y, int z)
|
public boolean canPlaceBlockAt(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||||
if ( canPlaceAt( w, x, y, z, dir ) )
|
if ( this.canPlaceAt( w, x, y, z, dir ) )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -99,21 +99,21 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||||||
@Override
|
@Override
|
||||||
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up)
|
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up)
|
||||||
{
|
{
|
||||||
return canPlaceAt( w, x, y, z, up.getOpposite() );
|
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block id)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block id)
|
||||||
{
|
{
|
||||||
ForgeDirection up = getOrientable( w, x, y, z ).getUp();
|
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||||
if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
||||||
dropTorch( w, x, y, z );
|
this.dropTorch( w, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
||||||
{
|
{
|
||||||
ForgeDirection up = getOrientable( w, x, y, z ).getUp();
|
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||||
double xOff = -0.3 * up.offsetX;
|
double xOff = -0.3 * up.offsetX;
|
||||||
double yOff = -0.3 * up.offsetY;
|
double yOff = -0.3 * up.offsetY;
|
||||||
double zOff = -0.3 * up.offsetZ;
|
double zOff = -0.3 * up.offsetZ;
|
||||||
@@ -139,7 +139,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||||||
if ( r.nextFloat() < 0.98 )
|
if ( r.nextFloat() < 0.98 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ForgeDirection up = getOrientable( w, x, y, z ).getUp();
|
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||||
double xOff = -0.3 * up.offsetX;
|
double xOff = -0.3 * up.offsetX;
|
||||||
double yOff = -0.3 * up.offsetY;
|
double yOff = -0.3 * up.offsetY;
|
||||||
double zOff = -0.3 * up.offsetZ;
|
double zOff = -0.3 * up.offsetZ;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RendererSecurity;
|
import appeng.client.render.blocks.RendererSecurity;
|
||||||
@@ -37,8 +38,8 @@ public class BlockSecurity extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockSecurity() {
|
public BlockSecurity() {
|
||||||
super( BlockSecurity.class, Material.iron );
|
super( BlockSecurity.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Security ) );
|
this.setFeature( EnumSet.of( AEFeature.Security ) );
|
||||||
setTileEntity( TileSecurity.class );
|
this.setTileEntity( TileSecurity.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,7 +54,7 @@ public class BlockSecurity extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileSecurity tg = getTileEntity( w, x, y, z );
|
TileSecurity tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
public BlockSkyCompass() {
|
public BlockSkyCompass() {
|
||||||
super( BlockSkyCompass.class, Material.iron );
|
super( BlockSkyCompass.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) );
|
this.setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) );
|
||||||
setTileEntity( TileSkyCompass.class );
|
this.setTileEntity( TileSkyCompass.class );
|
||||||
isOpaque = isFullSize = false;
|
this.isOpaque = this.isFullSize = false;
|
||||||
lightOpacity = 0;
|
this.lightOpacity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -78,7 +78,7 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
|||||||
public boolean canPlaceBlockAt(World w, int x, int y, int z)
|
public boolean canPlaceBlockAt(World w, int x, int y, int z)
|
||||||
{
|
{
|
||||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||||
if ( canPlaceAt( w, x, y, z, dir ) )
|
if ( this.canPlaceAt( w, x, y, z, dir ) )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -91,25 +91,25 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
|||||||
@Override
|
@Override
|
||||||
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up)
|
public boolean isValidOrientation(World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up)
|
||||||
{
|
{
|
||||||
TileSkyCompass sc = getTileEntity( w, x, y, z );
|
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
|
||||||
if ( sc != null )
|
if ( sc != null )
|
||||||
return false;
|
return false;
|
||||||
return canPlaceAt( w, x, y, z, forward.getOpposite() );
|
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block id)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block id)
|
||||||
{
|
{
|
||||||
TileSkyCompass sc = getTileEntity( w, x, y, z );
|
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
|
||||||
ForgeDirection up = sc.getForward();
|
ForgeDirection up = sc.getForward();
|
||||||
if ( !canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
if ( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
||||||
dropTorch( w, x, y, z );
|
this.dropTorch( w, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
|
||||||
{
|
{
|
||||||
TileSkyCompass tile = getTileEntity( w, x, y, z );
|
TileSkyCompass tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
ForgeDirection forward = tile.getForward();
|
ForgeDirection forward = tile.getForward();
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
public BlockTinyTNT() {
|
public BlockTinyTNT() {
|
||||||
super( BlockTinyTNT.class, Material.tnt );
|
super( BlockTinyTNT.class, Material.tnt );
|
||||||
setFeature( EnumSet.of( AEFeature.TinyTNT ) );
|
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
|
||||||
setLightOpacity( 1 );
|
this.setLightOpacity( 1 );
|
||||||
setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
setStepSound( soundTypeGrass );
|
this.setStepSound( soundTypeGrass );
|
||||||
setHardness( 0F );
|
this.setHardness( 0F );
|
||||||
|
|
||||||
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
|
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user