Compare commits
123 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -8,17 +8,18 @@ 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
|
waila_version=1.5.10_1.7.10
|
||||||
|
bc_version=6.4.3
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# API Stubs #
|
# API Stubs #
|
||||||
@@ -38,4 +39,3 @@ api_railcraft_version=1
|
|||||||
api_rblocks_version=1
|
api_rblocks_version=1
|
||||||
api_rf_version=2
|
api_rf_version=2
|
||||||
api_rotarycraft_version=1
|
api_rotarycraft_version=1
|
||||||
dev_buildcraft_version=1
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -45,6 +45,8 @@ dependencies {
|
|||||||
|
|
||||||
compile "mcp.mobius.waila:Waila:${config.waila_version}:dev"
|
compile "mcp.mobius.waila:Waila:${config.waila_version}:dev"
|
||||||
|
|
||||||
|
compile "com.mod-buildcraft:buildcraft:${config.bc_version}:dev"
|
||||||
|
|
||||||
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}")
|
||||||
@@ -57,10 +59,6 @@ dependencies {
|
|||||||
compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}")
|
compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}")
|
||||||
compile(group: 'api', name: 'rf', version: "${config.api_rf_version}")
|
compile(group: 'api', name: 'rf', version: "${config.api_rf_version}")
|
||||||
compile(group: 'api', name: 'rotarycraft', version: "${config.api_rotarycraft_version}")
|
compile(group: 'api', name: 'rotarycraft', version: "${config.api_rotarycraft_version}")
|
||||||
compile(group: 'dev', name: 'buildcraft', version: "${config.dev_buildcraft_version}")
|
|
||||||
|
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,27 +30,27 @@ public enum AccessRestriction
|
|||||||
private final int permissionBit;
|
private final int permissionBit;
|
||||||
|
|
||||||
private AccessRestriction(int v) {
|
private 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)
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ public enum FuzzyMode
|
|||||||
final public float percentage;
|
final public float percentage;
|
||||||
|
|
||||||
private FuzzyMode(float p) {
|
private 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public enum PowerUnits
|
|||||||
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
|
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
|
||||||
|
|
||||||
private PowerUnits(String un) {
|
private 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) {
|
private 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) {
|
private 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ 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);
|
public IGridNode getGridNode(ForgeDirection dir);
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,6 @@ public enum CableRenderMode
|
|||||||
|
|
||||||
private CableRenderMode(boolean hideFacades) {
|
private 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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public interface IIngredient {
|
|||||||
public int getQty();
|
public 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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public enum StorageChannel
|
|||||||
public final Class<? extends IAEStack> type;
|
public final Class<? extends IAEStack> type;
|
||||||
|
|
||||||
private StorageChannel( Class<? extends IAEStack> t ) {
|
private StorageChannel( Class<? extends IAEStack> t ) {
|
||||||
type = t;
|
this.type = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IItemList createList() {
|
public IItemList createList() {
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import net.minecraft.util.IIcon;
|
|||||||
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 appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
@@ -41,9 +42,9 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockVibrationChamber() {
|
public BlockVibrationChamber() {
|
||||||
super( BlockVibrationChamber.class, Material.iron );
|
super( BlockVibrationChamber.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.PowerGen ) );
|
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
|
||||||
setTileEntity( TileVibrationChamber.class );
|
this.setTileEntity( TileVibrationChamber.class );
|
||||||
setHardness( 4.2F );
|
this.setHardness( 4.2F );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,7 +55,7 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||||||
|
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
{
|
{
|
||||||
TileVibrationChamber tc = getTileEntity( w, x, y, z );
|
TileVibrationChamber 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_VIBRATION_CHAMBER );
|
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
|
||||||
@@ -69,9 +70,9 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||||||
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)
|
||||||
{
|
{
|
||||||
IIcon ico = super.getIcon( w, x, y, z, s );
|
IIcon ico = super.getIcon( w, x, y, z, s );
|
||||||
TileVibrationChamber tvc = getTileEntity( w, x, y, z );
|
TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
|
||||||
|
|
||||||
if ( tvc != null && tvc.isOn && ico == getRendererInstance().getTexture( ForgeDirection.SOUTH ) )
|
if ( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) )
|
||||||
{
|
{
|
||||||
return ExtraBlockTextures.BlockVibrationChamberFrontOn.getIcon();
|
return ExtraBlockTextures.BlockVibrationChamberFrontOn.getIcon();
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,7 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||||||
if ( !AEConfig.instance.enableEffects )
|
if ( !AEConfig.instance.enableEffects )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AEBaseTile tile = getTileEntity( w, x, y, z );
|
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile instanceof TileVibrationChamber )
|
if ( tile instanceof TileVibrationChamber )
|
||||||
{
|
{
|
||||||
TileVibrationChamber tc = (TileVibrationChamber) tile;
|
TileVibrationChamber tc = (TileVibrationChamber) tile;
|
||||||
|
|||||||
@@ -39,8 +39,14 @@ import net.minecraft.util.Vec3;
|
|||||||
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.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection;
|
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection;
|
||||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||||
|
|
||||||
import appeng.api.parts.IPart;
|
import appeng.api.parts.IPart;
|
||||||
import appeng.api.parts.IPartHost;
|
import appeng.api.parts.IPartHost;
|
||||||
import appeng.api.parts.PartItemStack;
|
import appeng.api.parts.PartItemStack;
|
||||||
@@ -64,18 +70,15 @@ import appeng.parts.NullCableBusContainer;
|
|||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.tile.networking.TileCableBus;
|
import appeng.tile.networking.TileCableBus;
|
||||||
import appeng.tile.networking.TileCableBusTESR;
|
import appeng.tile.networking.TileCableBusTESR;
|
||||||
import appeng.transformer.annotations.integration.Interface;
|
import appeng.transformer.annotations.Integration.Interface;
|
||||||
import appeng.transformer.annotations.integration.Method;
|
import appeng.transformer.annotations.Integration.Method;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
|
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
|
||||||
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||||
{
|
{
|
||||||
|
|
||||||
static private final ICableBusContainer nullCB = new NullCableBusContainer();
|
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||||
static public Class<? extends TileEntity> noTesrTile;
|
static public Class<? extends TileEntity> noTesrTile;
|
||||||
static public Class<? extends TileEntity> tesrTile;
|
static public Class<? extends TileEntity> tesrTile;
|
||||||
|
|
||||||
@@ -94,10 +97,10 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BlockCableBus() {
|
public BlockCableBus() {
|
||||||
super( BlockCableBus.class, AEGlassMaterial.instance );
|
super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,7 +115,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer)
|
public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer)
|
||||||
{
|
{
|
||||||
Object object = cb( world, target.blockX, target.blockY, target.blockZ );
|
Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
|
||||||
if ( object instanceof IPartHost )
|
if ( object instanceof IPartHost )
|
||||||
{
|
{
|
||||||
IPartHost host = (IPartHost) object;
|
IPartHost host = (IPartHost) object;
|
||||||
@@ -120,7 +123,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
for (ForgeDirection side : ForgeDirection.values())
|
for (ForgeDirection side : ForgeDirection.values())
|
||||||
{
|
{
|
||||||
IPart p = host.getPart( side );
|
IPart p = host.getPart( side );
|
||||||
IIcon ico = getIcon( p );
|
IIcon ico = this.getIcon( p );
|
||||||
|
|
||||||
if ( ico == null )
|
if ( ico == null )
|
||||||
continue;
|
continue;
|
||||||
@@ -159,7 +162,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
|
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
|
||||||
{
|
{
|
||||||
Object object = cb( world, x, y, z );
|
Object object = this.cb( world, x, y, z );
|
||||||
if ( object instanceof IPartHost )
|
if ( object instanceof IPartHost )
|
||||||
{
|
{
|
||||||
IPartHost host = (IPartHost) object;
|
IPartHost host = (IPartHost) object;
|
||||||
@@ -167,7 +170,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
for (ForgeDirection side : ForgeDirection.values())
|
for (ForgeDirection side : ForgeDirection.values())
|
||||||
{
|
{
|
||||||
IPart p = host.getPart( side );
|
IPart p = host.getPart( side );
|
||||||
IIcon ico = getIcon( p );
|
IIcon ico = this.getIcon( p );
|
||||||
|
|
||||||
if ( ico == null )
|
if ( ico == null )
|
||||||
continue;
|
continue;
|
||||||
@@ -224,7 +227,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
public boolean canRenderInPass(int pass)
|
public boolean canRenderInPass(int pass)
|
||||||
{
|
{
|
||||||
BusRenderHelper.instance.setPass( pass );
|
BusRenderHelper.INSTANCE.setPass( pass );
|
||||||
|
|
||||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
||||||
return true;
|
return true;
|
||||||
@@ -235,20 +238,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
||||||
{
|
{
|
||||||
return cb( world, x, y, z ).isLadder( entity );
|
return this.cb( world, x, y, z ).isLadder( entity );
|
||||||
}
|
}
|
||||||
|
|
||||||
@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)
|
||||||
{
|
{
|
||||||
return recolourBlock( world, x, y, z, side, colour, null );
|
return this.recolourBlock( world, x, y, z, side, colour, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who)
|
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
|
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
|
||||||
}
|
}
|
||||||
catch (Throwable ignored)
|
catch (Throwable ignored)
|
||||||
{
|
{
|
||||||
@@ -259,7 +262,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random r)
|
public void randomDisplayTick(World world, int x, int y, int z, Random r)
|
||||||
{
|
{
|
||||||
cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
|
this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -272,14 +275,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
}
|
}
|
||||||
if ( block == null )
|
if ( block == null )
|
||||||
return 0;
|
return 0;
|
||||||
return cb( world, x, y, z ).getLightValue();
|
return this.cb( world, x, y, z ).getLightValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
|
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
|
||||||
SelectedPart sp = cb( world, x, y, z ).selectPart( v3 );
|
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
|
||||||
|
|
||||||
if ( sp.part != null )
|
if ( sp.part != null )
|
||||||
return sp.part.getItemStack( PartItemStack.Pick );
|
return sp.part.getItemStack( PartItemStack.Pick );
|
||||||
@@ -292,7 +295,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
return cb( world, x, y, z ).isEmpty();
|
return this.cb( world, x, y, z ).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@@ -301,7 +304,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
{
|
{
|
||||||
if ( player.capabilities.isCreativeMode )
|
if ( player.capabilities.isCreativeMode )
|
||||||
{
|
{
|
||||||
AEBaseTile tile = getTileEntity( world, x, y, z );
|
AEBaseTile tile = this.getTileEntity( world, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
tile.disableDrops();
|
tile.disableDrops();
|
||||||
// maybe ray trace?
|
// maybe ray trace?
|
||||||
@@ -312,7 +315,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@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( s, 0 );
|
return this.getIcon( s, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -346,20 +349,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
public boolean isSideSolid(IBlockAccess w, int x, int y, int z, ForgeDirection side)
|
public boolean isSideSolid(IBlockAccess w, int x, int y, int z, ForgeDirection side)
|
||||||
{
|
{
|
||||||
return cb( w, x, y, z ).isSolidOnSide( side );
|
return this.cb( w, x, y, z ).isSolidOnSide( side );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block meh)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block meh)
|
||||||
{
|
{
|
||||||
cb( w, x, y, z ).onNeighborChanged();
|
this.cb( w, x, y, z ).onNeighborChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ)
|
public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ)
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
cb( w, x, y, z ).onNeighborChanged();
|
this.cb( w, x, y, z ).onNeighborChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -371,13 +374,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Override
|
@Override
|
||||||
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)
|
||||||
{
|
{
|
||||||
return cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World w, int x, int y, int z, Entity e)
|
public void onEntityCollidedWithBlock(World w, int x, int y, int z, Entity e)
|
||||||
{
|
{
|
||||||
cb( w, x, y, z ).onEntityCollision( e );
|
this.cb( w, x, y, z ).onEntityCollision( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -387,15 +390,15 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
case 4:
|
case 4:
|
||||||
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) );
|
return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) );
|
||||||
case 0:
|
case 0:
|
||||||
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.NORTH ) );
|
return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.NORTH ) );
|
||||||
case 1:
|
case 1:
|
||||||
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.EAST ) );
|
return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.EAST ) );
|
||||||
case 2:
|
case 2:
|
||||||
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.SOUTH ) );
|
return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.SOUTH ) );
|
||||||
case 3:
|
case 3:
|
||||||
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.WEST ) );
|
return this.cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.WEST ) );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -403,13 +406,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@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)
|
||||||
{
|
{
|
||||||
return cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int isProvidingStrongPower(IBlockAccess w, int x, int y, int z, int side)
|
public int isProvidingStrongPower(IBlockAccess w, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
return cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -421,10 +424,10 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
|
|
||||||
public void setupTile()
|
public void setupTile()
|
||||||
{
|
{
|
||||||
setTileEntity( noTesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBus.class.getName() ) );
|
this.setTileEntity( noTesrTile = Api.INSTANCE.partHelper.getCombinedInstance( TileCableBus.class.getName() ) );
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
{
|
{
|
||||||
tesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() );
|
tesrTile = Api.INSTANCE.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() );
|
||||||
GameRegistry.registerTileEntity( tesrTile, "ClientOnly_TESR_CableBus" );
|
GameRegistry.registerTileEntity( tesrTile, "ClientOnly_TESR_CableBus" );
|
||||||
CommonHelper.proxy.bindTileEntitySpecialRenderer( tesrTile, this );
|
CommonHelper.proxy.bindTileEntitySpecialRenderer( tesrTile, this );
|
||||||
}
|
}
|
||||||
@@ -441,7 +444,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
else if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
|
else if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
|
||||||
out = ((IFMP) AppEng.instance.getIntegration( IntegrationType.FMP )).getCableContainer( te );
|
out = ((IFMP) AppEng.instance.getIntegration( IntegrationType.FMP )).getCableContainer( te );
|
||||||
|
|
||||||
return out == null ? nullCB : out;
|
return out == null ? NULL_CABLE_BUS : out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -453,20 +456,20 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
|||||||
@Method(iname = "MFR")
|
@Method(iname = "MFR")
|
||||||
public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side)
|
public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side)
|
||||||
{
|
{
|
||||||
return cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
int myColorMultiplier = 0xffffff;
|
int myColorMultiplier = 0xffffff;
|
||||||
|
|
||||||
public void setRenderColor(int color)
|
public void setRenderColor(int color)
|
||||||
{
|
{
|
||||||
myColorMultiplier = color;
|
this.myColorMultiplier = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
|
public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
|
||||||
{
|
{
|
||||||
return myColorMultiplier;
|
return this.myColorMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.util.EnumSet;
|
|||||||
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.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockController;
|
import appeng.client.render.blocks.RenderBlockController;
|
||||||
@@ -34,15 +35,15 @@ public class BlockController extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockController() {
|
public BlockController() {
|
||||||
super( BlockController.class, Material.iron );
|
super( BlockController.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Channels ) );
|
this.setFeature( EnumSet.of( AEFeature.Channels ) );
|
||||||
setTileEntity( TileController.class );
|
this.setTileEntity( TileController.class );
|
||||||
setHardness( 6 );
|
this.setHardness( 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block id_junk)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block id_junk)
|
||||||
{
|
{
|
||||||
TileController tc = getTileEntity( w, x, y, z );
|
TileController tc = this.getTileEntity( w, x, y, z );
|
||||||
if ( tc != null )
|
if ( tc != null )
|
||||||
tc.onNeighborChange( false );
|
tc.onNeighborChange( false );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ public class BlockCreativeEnergyCell extends AEBaseBlock
|
|||||||
{
|
{
|
||||||
|
|
||||||
public BlockCreativeEnergyCell() {
|
public BlockCreativeEnergyCell() {
|
||||||
super( BlockCreativeEnergyCell.class, AEGlassMaterial.instance );
|
super( BlockCreativeEnergyCell.class, AEGlassMaterial.INSTANCE );
|
||||||
setFeature( EnumSet.of( AEFeature.Creative ) );
|
this.setFeature( EnumSet.of( AEFeature.Creative ) );
|
||||||
setTileEntity( TileCreativeEnergyCell.class );
|
this.setTileEntity( TileCreativeEnergyCell.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package appeng.block.networking;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.tile.networking.TileDenseEnergyCell;
|
import appeng.tile.networking.TileDenseEnergyCell;
|
||||||
@@ -36,8 +37,8 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
|
|||||||
|
|
||||||
public BlockDenseEnergyCell() {
|
public BlockDenseEnergyCell() {
|
||||||
super( BlockDenseEnergyCell.class );
|
super( BlockDenseEnergyCell.class );
|
||||||
setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
|
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
|
||||||
setTileEntity( TileDenseEnergyCell.class );
|
this.setTileEntity( TileDenseEnergyCell.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package appeng.block.networking;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.tile.networking.TileEnergyAcceptor;
|
import appeng.tile.networking.TileEnergyAcceptor;
|
||||||
@@ -30,8 +31,8 @@ public class BlockEnergyAcceptor extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockEnergyAcceptor() {
|
public BlockEnergyAcceptor() {
|
||||||
super( BlockEnergyAcceptor.class, Material.iron );
|
super( BlockEnergyAcceptor.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileEnergyAcceptor.class );
|
this.setTileEntity( TileEnergyAcceptor.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,17 @@ package appeng.block.networking;
|
|||||||
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 appeng.block.AEBaseItemBlock;
|
|
||||||
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.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
|
import appeng.block.AEBaseItemBlock;
|
||||||
import appeng.block.AEBaseItemBlockChargeable;
|
import appeng.block.AEBaseItemBlockChargeable;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
||||||
@@ -48,13 +50,13 @@ public class BlockEnergyCell extends AEBaseBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BlockEnergyCell(Class c) {
|
public BlockEnergyCell(Class c) {
|
||||||
super( c, AEGlassMaterial.instance );
|
super( c, AEGlassMaterial.INSTANCE );
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockEnergyCell() {
|
public BlockEnergyCell() {
|
||||||
this( BlockEnergyCell.class );
|
this( BlockEnergyCell.class );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setTileEntity( TileEnergyCell.class );
|
this.setTileEntity( TileEnergyCell.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,8 +67,8 @@ public class BlockEnergyCell extends AEBaseBlock
|
|||||||
|
|
||||||
ItemStack charged = new ItemStack( this, 1 );
|
ItemStack charged = new ItemStack( this, 1 );
|
||||||
NBTTagCompound tag = Platform.openNbtData( charged );
|
NBTTagCompound tag = Platform.openNbtData( charged );
|
||||||
tag.setDouble( "internalCurrentPower", getMaxPower() );
|
tag.setDouble( "internalCurrentPower", this.getMaxPower() );
|
||||||
tag.setDouble( "internalMaxPower", getMaxPower() );
|
tag.setDouble( "internalMaxPower", this.getMaxPower() );
|
||||||
|
|
||||||
itemStacks.add( charged );
|
itemStacks.add( charged );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
|
|
||||||
public BlockWireless() {
|
public BlockWireless() {
|
||||||
super( BlockWireless.class, AEGlassMaterial.instance );
|
super( BlockWireless.class, AEGlassMaterial.INSTANCE );
|
||||||
setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) );
|
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) );
|
||||||
setTileEntity( TileWireless.class );
|
this.setTileEntity( TileWireless.class );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = false;
|
this.isFullSize = false;
|
||||||
isOpaque = false;
|
this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -60,7 +60,7 @@ public class BlockWireless 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)
|
||||||
{
|
{
|
||||||
TileWireless tile = getTileEntity( w, x, y, z );
|
TileWireless tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
ForgeDirection forward = tile.getForward();
|
ForgeDirection forward = tile.getForward();
|
||||||
@@ -122,7 +122,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
|||||||
@Override
|
@Override
|
||||||
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
|
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
|
||||||
{
|
{
|
||||||
TileWireless tile = getTileEntity( w, x, y, z );
|
TileWireless tile = this.getTileEntity( w, x, y, z );
|
||||||
if ( tile != null )
|
if ( tile != null )
|
||||||
{
|
{
|
||||||
ForgeDirection forward = tile.getForward();
|
ForgeDirection forward = tile.getForward();
|
||||||
@@ -188,7 +188,7 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileWireless tg = getTileEntity( w, x, y, z );
|
TileWireless tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -50,20 +50,20 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
|
|||||||
{
|
{
|
||||||
|
|
||||||
public BlockQuantumLinkChamber() {
|
public BlockQuantumLinkChamber() {
|
||||||
super( BlockQuantumLinkChamber.class, AEGlassMaterial.instance );
|
super( BlockQuantumLinkChamber.class, AEGlassMaterial.INSTANCE );
|
||||||
setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
||||||
setTileEntity( TileQuantumBridge.class );
|
this.setTileEntity( TileQuantumBridge.class );
|
||||||
float shave = 2.0f / 16.0f;
|
float shave = 2.0f / 16.0f;
|
||||||
setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void randomDisplayTick(World w, int bx, int by, int bz, Random r)
|
public void randomDisplayTick(World w, int bx, int by, int bz, Random r)
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( w, bx, by, bz );
|
TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz );
|
||||||
if ( bridge != null )
|
if ( bridge != null )
|
||||||
{
|
{
|
||||||
if ( bridge.hasQES() )
|
if ( bridge.hasQES() )
|
||||||
@@ -77,7 +77,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null )
|
if ( bridge != null )
|
||||||
bridge.neighborUpdate();
|
bridge.neighborUpdate();
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
|
|||||||
@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)
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null )
|
if ( bridge != null )
|
||||||
bridge.breakCluster();
|
bridge.breakCluster();
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileQuantumBridge tg = getTileEntity( w, x, y, z );
|
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -41,18 +41,18 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
public BlockQuantumRing() {
|
public BlockQuantumRing() {
|
||||||
super( BlockQuantumRing.class, Material.iron );
|
super( BlockQuantumRing.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
||||||
setTileEntity( TileQuantumBridge.class );
|
this.setTileEntity( TileQuantumBridge.class );
|
||||||
float shave = 2.0f / 16.0f;
|
float shave = 2.0f / 16.0f;
|
||||||
setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||||
setLightOpacity( 1 );
|
this.setLightOpacity( 1 );
|
||||||
isFullSize = isOpaque = false;
|
this.isFullSize = this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null )
|
if ( bridge != null )
|
||||||
bridge.neighborUpdate();
|
bridge.neighborUpdate();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
|
|||||||
@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)
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null )
|
if ( bridge != null )
|
||||||
bridge.breakCluster();
|
bridge.breakCluster();
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
|
|||||||
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)
|
||||||
{
|
{
|
||||||
double OnePx = 2.0 / 16.0;
|
double OnePx = 2.0 / 16.0;
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null && bridge.isCorner() )
|
if ( bridge != null && bridge.isCorner() )
|
||||||
{
|
{
|
||||||
OnePx = 4.0 / 16.0;
|
OnePx = 4.0 / 16.0;
|
||||||
@@ -93,7 +93,7 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
|
|||||||
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
|
public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e)
|
||||||
{
|
{
|
||||||
double OnePx = 2.0 / 16.0;
|
double OnePx = 2.0 / 16.0;
|
||||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||||
if ( bridge != null && bridge.isCorner() )
|
if ( bridge != null && bridge.isCorner() )
|
||||||
{
|
{
|
||||||
OnePx = 4.0 / 16.0;
|
OnePx = 4.0 / 16.0;
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ public class BlockFluix extends AEDecorativeBlock
|
|||||||
public BlockFluix()
|
public BlockFluix()
|
||||||
{
|
{
|
||||||
super( BlockFluix.class, Material.rock );
|
super( BlockFluix.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package appeng.block.solids;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
import appeng.block.AEDecorativeBlock;
|
import appeng.block.AEDecorativeBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ public class BlockQuartz extends AEDecorativeBlock
|
|||||||
|
|
||||||
public BlockQuartz() {
|
public BlockQuartz() {
|
||||||
super( BlockQuartz.class, Material.rock );
|
super( BlockQuartz.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package appeng.block.solids;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
import appeng.block.AEDecorativeBlock;
|
import appeng.block.AEDecorativeBlock;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock
|
|||||||
|
|
||||||
public BlockQuartzChiseled() {
|
public BlockQuartzChiseled() {
|
||||||
super( BlockQuartzChiseled.class, Material.rock );
|
super( BlockQuartzChiseled.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,15 @@ import java.util.EnumSet;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
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.RenderQuartzGlass;
|
import appeng.client.render.blocks.RenderQuartzGlass;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockQuartzGlass extends AEBaseBlock
|
public class BlockQuartzGlass extends AEBaseBlock
|
||||||
{
|
{
|
||||||
@@ -48,7 +50,7 @@ public class BlockQuartzGlass extends AEBaseBlock
|
|||||||
public boolean shouldSideBeRendered(IBlockAccess w, int x, int y, int z, int side)
|
public boolean shouldSideBeRendered(IBlockAccess w, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
Material mat = w.getBlock( x, y, z ).getMaterial();
|
Material mat = w.getBlock( x, y, z ).getMaterial();
|
||||||
if ( mat == Material.glass || mat == AEGlassMaterial.instance )
|
if ( mat == Material.glass || mat == AEGlassMaterial.INSTANCE )
|
||||||
{
|
{
|
||||||
if ( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
|
if ( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
|
||||||
return false;
|
return false;
|
||||||
@@ -58,9 +60,9 @@ public class BlockQuartzGlass extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockQuartzGlass(Class c) {
|
public BlockQuartzGlass(Class c) {
|
||||||
super( c, Material.glass );
|
super( c, Material.glass );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isOpaque = false;
|
this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,21 +23,23 @@ import java.util.Random;
|
|||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.client.render.effects.VibrantFX;
|
import appeng.client.render.effects.VibrantFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.CommonHelper;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockQuartzLamp extends BlockQuartzGlass
|
public class BlockQuartzLamp extends BlockQuartzGlass
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockQuartzLamp() {
|
public BlockQuartzLamp() {
|
||||||
super( BlockQuartzLamp.class );
|
super( BlockQuartzLamp.class );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
|
||||||
setLightLevel( 1.0f );
|
this.setLightLevel( 1.0f );
|
||||||
setBlockTextureName( "BlockQuartzGlass" );
|
this.setBlockTextureName( "BlockQuartzGlass" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.util.EnumSet;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
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;
|
||||||
@@ -33,7 +34,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
|
|||||||
|
|
||||||
public BlockQuartzPillar() {
|
public BlockQuartzPillar() {
|
||||||
super( BlockQuartzPillar.class, Material.rock );
|
super( BlockQuartzPillar.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -34,7 +35,13 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import rblocks.api.RotatableBlockEnable;
|
import rblocks.api.RotatableBlockEnable;
|
||||||
|
|
||||||
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;
|
||||||
@@ -46,9 +53,6 @@ import appeng.helpers.NullRotation;
|
|||||||
import appeng.integration.IntegrationType;
|
import appeng.integration.IntegrationType;
|
||||||
import appeng.integration.abstraction.IRB;
|
import appeng.integration.abstraction.IRB;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@RotatableBlockEnable
|
@RotatableBlockEnable
|
||||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||||
@@ -81,11 +85,11 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
|
|
||||||
public BlockSkyStone() {
|
public BlockSkyStone() {
|
||||||
super( BlockSkyStone.class, Material.rock );
|
super( BlockSkyStone.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setHardness( 50 );
|
this.setHardness( 50 );
|
||||||
hasSubtypes = true;
|
this.hasSubtypes = true;
|
||||||
blockResistance = 150.0f;
|
this.blockResistance = 150.0f;
|
||||||
setHarvestLevel( "pickaxe", 3, 0 );
|
this.setHarvestLevel( "pickaxe", 3, 0 );
|
||||||
MinecraftForge.EVENT_BUS.register( this );
|
MinecraftForge.EVENT_BUS.register( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,15 +103,15 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
public String getUnlocalizedName(ItemStack is)
|
public String getUnlocalizedName(ItemStack is)
|
||||||
{
|
{
|
||||||
if ( is.getItemDamage() == 1 )
|
if ( is.getItemDamage() == 1 )
|
||||||
return getUnlocalizedName() + ".Block";
|
return this.getUnlocalizedName() + ".Block";
|
||||||
|
|
||||||
if ( is.getItemDamage() == 2 )
|
if ( is.getItemDamage() == 2 )
|
||||||
return getUnlocalizedName() + ".Brick";
|
return this.getUnlocalizedName() + ".Brick";
|
||||||
|
|
||||||
if ( is.getItemDamage() == 3 )
|
if ( is.getItemDamage() == 3 )
|
||||||
return getUnlocalizedName() + ".SmallBrick";
|
return this.getUnlocalizedName() + ".SmallBrick";
|
||||||
|
|
||||||
return getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -135,9 +139,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
public void registerBlockIcons(IIconRegister ir)
|
public void registerBlockIcons(IIconRegister ir)
|
||||||
{
|
{
|
||||||
super.registerBlockIcons( ir );
|
super.registerBlockIcons( ir );
|
||||||
Block = ir.registerIcon( getTextureName() + ".Block" );
|
this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
|
||||||
Brick = ir.registerIcon( getTextureName() + ".Brick" );
|
this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
|
||||||
SmallBrick = ir.registerIcon( getTextureName() + ".SmallBrick" );
|
this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -145,25 +149,26 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
public IIcon getIcon(int direction, int metadata)
|
public IIcon getIcon(int direction, int metadata)
|
||||||
{
|
{
|
||||||
if ( metadata == 1 )
|
if ( metadata == 1 )
|
||||||
return Block;
|
return this.Block;
|
||||||
if ( metadata == 2 )
|
if ( metadata == 2 )
|
||||||
return Brick;
|
return this.Brick;
|
||||||
if ( metadata == 3 )
|
if ( metadata == 3 )
|
||||||
return SmallBrick;
|
return this.SmallBrick;
|
||||||
return super.getIcon( direction, metadata );
|
return super.getIcon( direction, metadata );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRenderStateByMeta(int metadata)
|
public void setRenderStateByMeta(int metadata)
|
||||||
{
|
{
|
||||||
getRendererInstance().setTemporaryRenderIcon( getIcon( 0, metadata ) );
|
this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
|
||||||
{
|
{
|
||||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
|
||||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +202,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
|||||||
// use AE2's renderer, no rotatable blocks.
|
// use AE2's renderer, no rotatable blocks.
|
||||||
int getRealRenderType()
|
int getRealRenderType()
|
||||||
{
|
{
|
||||||
return getRenderType();
|
return this.getRenderType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
@@ -43,12 +44,12 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
|
|
||||||
public OreQuartz(Class self) {
|
public OreQuartz(Class self) {
|
||||||
super( self, Material.rock );
|
super( self, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||||
setHardness( 3.0F );
|
this.setHardness( 3.0F );
|
||||||
setResistance( 5.0F );
|
this.setResistance( 5.0F );
|
||||||
boostBrightnessLow = 0;
|
this.boostBrightnessLow = 0;
|
||||||
boostBrightnessHigh = 1;
|
this.boostBrightnessHigh = 1;
|
||||||
enhanceBrightness = false;
|
this.enhanceBrightness = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -67,14 +68,14 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4)
|
public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
|
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
|
||||||
if ( enhanceBrightness )
|
if ( this.enhanceBrightness )
|
||||||
{
|
{
|
||||||
j1 = Math.max( j1 >> 20, j1 >> 4 );
|
j1 = Math.max( j1 >> 20, j1 >> 4 );
|
||||||
|
|
||||||
if ( j1 > 4 )
|
if ( j1 > 4 )
|
||||||
j1 += boostBrightnessHigh;
|
j1 += this.boostBrightnessHigh;
|
||||||
else
|
else
|
||||||
j1 += boostBrightnessLow;
|
j1 += this.boostBrightnessLow;
|
||||||
|
|
||||||
if ( j1 > 15 )
|
if ( j1 > 15 )
|
||||||
j1 = 15;
|
j1 = 15;
|
||||||
@@ -95,13 +96,13 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int id, Random rand, int meta)
|
public Item getItemDropped(int id, Random rand, int meta)
|
||||||
{
|
{
|
||||||
return getItemDropped().getItem();
|
return this.getItemDropped().getItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int id)
|
public int damageDropped(int id)
|
||||||
{
|
{
|
||||||
return getItemDropped().getItemDamage();
|
return this.getItemDropped().getItemDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -113,7 +114,7 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
@Override
|
@Override
|
||||||
public int quantityDroppedWithBonus(int fortune, Random rand)
|
public int quantityDroppedWithBonus(int fortune, Random rand)
|
||||||
{
|
{
|
||||||
if ( fortune > 0 && Item.getItemFromBlock( this ) != getItemDropped( 0, rand, fortune ) )
|
if ( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) )
|
||||||
{
|
{
|
||||||
int j = rand.nextInt( fortune + 2 ) - 1;
|
int j = rand.nextInt( fortune + 2 ) - 1;
|
||||||
|
|
||||||
@@ -135,7 +136,7 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
{
|
{
|
||||||
super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta );
|
super.dropBlockAsItemWithChance( w, x, y, z, blockID, something, meta );
|
||||||
|
|
||||||
if ( getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) )
|
if ( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) )
|
||||||
{
|
{
|
||||||
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
|
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
|
||||||
|
|
||||||
|
|||||||
@@ -23,20 +23,22 @@ import java.util.Random;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.client.render.effects.ChargedOreFX;
|
import appeng.client.render.effects.ChargedOreFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.CommonHelper;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class OreQuartzCharged extends OreQuartz
|
public class OreQuartzCharged extends OreQuartz
|
||||||
{
|
{
|
||||||
|
|
||||||
public OreQuartzCharged() {
|
public OreQuartzCharged() {
|
||||||
super( OreQuartzCharged.class );
|
super( OreQuartzCharged.class );
|
||||||
boostBrightnessLow = 2;
|
this.boostBrightnessLow = 2;
|
||||||
boostBrightnessHigh = 5;
|
this.boostBrightnessHigh = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,13 +31,15 @@ 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.RenderNull;
|
import appeng.client.render.blocks.RenderNull;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
@@ -45,11 +47,11 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
|||||||
public BlockMatrixFrame()
|
public BlockMatrixFrame()
|
||||||
{
|
{
|
||||||
super( BlockMatrixFrame.class, Material.anvil );
|
super( BlockMatrixFrame.class, Material.anvil );
|
||||||
setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||||
setResistance( 6000000.0F );
|
this.setResistance( 6000000.0F );
|
||||||
setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
isOpaque = false;
|
this.isOpaque = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,6 +25,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;
|
||||||
@@ -36,14 +37,14 @@ public class BlockSpatialIOPort extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockSpatialIOPort() {
|
public BlockSpatialIOPort() {
|
||||||
super( BlockSpatialIOPort.class, Material.iron );
|
super( BlockSpatialIOPort.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||||
setTileEntity( TileSpatialIOPort.class );
|
this.setTileEntity( TileSpatialIOPort.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
||||||
{
|
{
|
||||||
TileSpatialIOPort te = getTileEntity( w, x, y, z );
|
TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te != null )
|
if ( te != null )
|
||||||
te.updateRedstoneState();
|
te.updateRedstoneState();
|
||||||
}
|
}
|
||||||
@@ -54,7 +55,7 @@ public class BlockSpatialIOPort extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileSpatialIOPort tg = getTileEntity( w, x, y, z );
|
TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.util.EnumSet;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
import appeng.client.render.BaseBlockRender;
|
||||||
import appeng.client.render.blocks.RenderSpatialPylon;
|
import appeng.client.render.blocks.RenderSpatialPylon;
|
||||||
@@ -34,15 +35,15 @@ public class BlockSpatialPylon extends AEBaseBlock
|
|||||||
{
|
{
|
||||||
|
|
||||||
public BlockSpatialPylon() {
|
public BlockSpatialPylon() {
|
||||||
super( BlockSpatialPylon.class, AEGlassMaterial.instance );
|
super( BlockSpatialPylon.class, AEGlassMaterial.INSTANCE );
|
||||||
setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||||
setTileEntity( TileSpatialPylon.class );
|
this.setTileEntity( TileSpatialPylon.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@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)
|
||||||
{
|
{
|
||||||
TileSpatialPylon tsp = getTileEntity( w, x, y, z );
|
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
|
||||||
if ( tsp != null )
|
if ( tsp != null )
|
||||||
tsp.onNeighborBlockChange();
|
tsp.onNeighborBlockChange();
|
||||||
}
|
}
|
||||||
@@ -50,7 +51,7 @@ public class BlockSpatialPylon 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)
|
||||||
{
|
{
|
||||||
TileSpatialPylon tsp = getTileEntity( w, x, y, z );
|
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
|
||||||
if ( tsp != null )
|
if ( tsp != null )
|
||||||
return tsp.getLightValue();
|
return tsp.getLightValue();
|
||||||
return super.getLightValue( w, x, y, z );
|
return super.getLightValue( w, x, y, z );
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
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.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.storage.ICellHandler;
|
import appeng.api.storage.ICellHandler;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
@@ -41,8 +42,8 @@ public class BlockChest extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockChest() {
|
public BlockChest() {
|
||||||
super( BlockChest.class, Material.iron );
|
super( BlockChest.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
|
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
|
||||||
setTileEntity( TileChest.class );
|
this.setTileEntity( TileChest.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,7 +55,7 @@ public class BlockChest 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)
|
||||||
{
|
{
|
||||||
TileChest tg = getTileEntity( w, x, y, z );
|
TileChest tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null && !p.isSneaking() )
|
if ( tg != null && !p.isSneaking() )
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
|
|||||||
@@ -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.RenderDrive;
|
import appeng.client.render.blocks.RenderDrive;
|
||||||
@@ -37,8 +38,8 @@ public class BlockDrive extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockDrive() {
|
public BlockDrive() {
|
||||||
super( BlockDrive.class, Material.iron );
|
super( BlockDrive.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
|
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
|
||||||
setTileEntity( TileDrive.class );
|
this.setTileEntity( TileDrive.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,7 +54,7 @@ public class BlockDrive extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileDrive tg = getTileEntity( w, x, y, z );
|
TileDrive tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -25,6 +25,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;
|
||||||
@@ -36,14 +37,14 @@ public class BlockIOPort extends AEBaseBlock
|
|||||||
|
|
||||||
public BlockIOPort() {
|
public BlockIOPort() {
|
||||||
super( BlockIOPort.class, Material.iron );
|
super( BlockIOPort.class, Material.iron );
|
||||||
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
|
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
|
||||||
setTileEntity( TileIOPort.class );
|
this.setTileEntity( TileIOPort.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
public final void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
||||||
{
|
{
|
||||||
TileIOPort te = getTileEntity( w, x, y, z );
|
TileIOPort te = this.getTileEntity( w, x, y, z );
|
||||||
if ( te != null )
|
if ( te != null )
|
||||||
te.updateRedstoneState();
|
te.updateRedstoneState();
|
||||||
}
|
}
|
||||||
@@ -54,7 +55,7 @@ public class BlockIOPort extends AEBaseBlock
|
|||||||
if ( p.isSneaking() )
|
if ( p.isSneaking() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileIOPort tg = getTileEntity( w, x, y, z );
|
TileIOPort tg = this.getTileEntity( w, x, y, z );
|
||||||
if ( tg != null )
|
if ( tg != null )
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
|
|||||||
@@ -54,22 +54,22 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
public BlockSkyChest() {
|
public BlockSkyChest() {
|
||||||
super( BlockSkyChest.class, Material.rock );
|
super( BlockSkyChest.class, Material.rock );
|
||||||
setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
|
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
|
||||||
setTileEntity( TileSkyChest.class );
|
this.setTileEntity( TileSkyChest.class );
|
||||||
isOpaque = isFullSize = false;
|
this.isOpaque = this.isFullSize = false;
|
||||||
lightOpacity = 0;
|
this.lightOpacity = 0;
|
||||||
hasSubtypes = true;
|
this.hasSubtypes = true;
|
||||||
setHardness( 50 );
|
this.setHardness( 50 );
|
||||||
blockResistance = 150.0f;
|
this.blockResistance = 150.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack is)
|
public String getUnlocalizedName(ItemStack is)
|
||||||
{
|
{
|
||||||
if ( is.getItemDamage() == 1 )
|
if ( is.getItemDamage() == 1 )
|
||||||
return getUnlocalizedName() + ".Block";
|
return this.getUnlocalizedName() + ".Block";
|
||||||
|
|
||||||
return getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -87,10 +87,11 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
|
||||||
{
|
{
|
||||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
final ItemStack is = super.getPickBlock( target, world, x, y, z, player );
|
||||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
|||||||
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)
|
||||||
{
|
{
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
Platform.openGUI( player, getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
|
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -121,7 +122,7 @@ public class BlockSkyChest 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)
|
||||||
{
|
{
|
||||||
TileSkyChest sk = getTileEntity( w, x, y, z );
|
TileSkyChest sk = this.getTileEntity( w, x, y, z );
|
||||||
double sc = 0.06;
|
double sc = 0.06;
|
||||||
ForgeDirection o = ForgeDirection.UNKNOWN;
|
ForgeDirection o = ForgeDirection.UNKNOWN;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
@@ -48,7 +50,9 @@ import net.minecraftforge.client.event.RenderLivingEvent;
|
|||||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
import appeng.api.parts.CableRenderMode;
|
import appeng.api.parts.CableRenderMode;
|
||||||
import appeng.api.util.AEColor;
|
import appeng.api.util.AEColor;
|
||||||
@@ -81,15 +85,12 @@ import appeng.hooks.TickHandler.PlayerColor;
|
|||||||
import appeng.server.ServerHelper;
|
import appeng.server.ServerHelper;
|
||||||
import appeng.transformer.MissingCoreMod;
|
import appeng.transformer.MissingCoreMod;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
public class ClientHelper extends ServerHelper
|
public class ClientHelper extends ServerHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final RenderItem itemRenderer = new RenderItem();
|
private static final RenderItem ITEM_RENDERER = new RenderItem();
|
||||||
private static final RenderBlocks blockRenderer = new RenderBlocks();
|
private static final RenderBlocks BLOCK_RENDERER = new RenderBlocks();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CableRenderMode getRenderMode()
|
public CableRenderMode getRenderMode()
|
||||||
@@ -100,7 +101,7 @@ public class ClientHelper extends ServerHelper
|
|||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
EntityPlayer player = mc.thePlayer;
|
EntityPlayer player = mc.thePlayer;
|
||||||
|
|
||||||
return renderModeForPlayer( player );
|
return this.renderModeForPlayer( player );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -127,7 +128,7 @@ public class ClientHelper extends ServerHelper
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void postPlayerRender(RenderLivingEvent.Pre p)
|
public void postPlayerRender(RenderLivingEvent.Pre p)
|
||||||
{
|
{
|
||||||
PlayerColor player = TickHandler.instance.getPlayerColors().get( p.entity.getEntityId() );
|
PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() );
|
||||||
if ( player != null )
|
if ( player != null )
|
||||||
{
|
{
|
||||||
AEColor col = player.myColor;
|
AEColor col = player.myColor;
|
||||||
@@ -209,9 +210,9 @@ public class ClientHelper extends ServerHelper
|
|||||||
|
|
||||||
RenderItem.renderInFrame = false;
|
RenderItem.renderInFrame = false;
|
||||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||||
if ( !ForgeHooksClient.renderInventoryItem( blockRenderer, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0 ) )
|
if ( !ForgeHooksClient.renderInventoryItem( BLOCK_RENDERER, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0 ) )
|
||||||
{
|
{
|
||||||
itemRenderer.renderItemIntoGUI( fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false );
|
ITEM_RENDERER.renderItemIntoGUI( fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +229,7 @@ public class ClientHelper extends ServerHelper
|
|||||||
@Override
|
@Override
|
||||||
public void postInit()
|
public void postInit()
|
||||||
{
|
{
|
||||||
RenderingRegistry.registerBlockHandler( WorldRender.instance );
|
RenderingRegistry.registerBlockHandler( WorldRender.INSTANCE );
|
||||||
RenderManager.instance.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed() );
|
RenderManager.instance.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed() );
|
||||||
RenderManager.instance.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem() );
|
RenderManager.instance.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem() );
|
||||||
}
|
}
|
||||||
@@ -314,22 +315,22 @@ public class ClientHelper extends ServerHelper
|
|||||||
switch (effect)
|
switch (effect)
|
||||||
{
|
{
|
||||||
case Assembler:
|
case Assembler:
|
||||||
spawnAssembler( worldObj, posX, posY, posZ, o );
|
this.spawnAssembler( worldObj, posX, posY, posZ, o );
|
||||||
return;
|
return;
|
||||||
case Vibrant:
|
case Vibrant:
|
||||||
spawnVibrant( worldObj, posX, posY, posZ );
|
this.spawnVibrant( worldObj, posX, posY, posZ );
|
||||||
return;
|
return;
|
||||||
case Crafting:
|
case Crafting:
|
||||||
spawnCrafting( worldObj, posX, posY, posZ );
|
this.spawnCrafting( worldObj, posX, posY, posZ );
|
||||||
return;
|
return;
|
||||||
case Energy:
|
case Energy:
|
||||||
spawnEnergy( worldObj, posX, posY, posZ );
|
this.spawnEnergy( worldObj, posX, posY, posZ );
|
||||||
return;
|
return;
|
||||||
case Lightning:
|
case Lightning:
|
||||||
spawnLightning( worldObj, posX, posY, posZ );
|
this.spawnLightning( worldObj, posX, posY, posZ );
|
||||||
return;
|
return;
|
||||||
case LightningArc:
|
case LightningArc:
|
||||||
spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o );
|
this.spawnLightningArc( worldObj, posX, posY, posZ, (Vec3) o );
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
|
import com.google.common.base.Stopwatch;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
@@ -49,9 +52,6 @@ import net.minecraft.util.ResourceLocation;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import com.google.common.base.Stopwatch;
|
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.client.gui.widgets.GuiScrollbar;
|
import appeng.client.gui.widgets.GuiScrollbar;
|
||||||
import appeng.client.gui.widgets.ITooltip;
|
import appeng.client.gui.widgets.ITooltip;
|
||||||
@@ -92,7 +92,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
public AEBaseGui(Container container)
|
public AEBaseGui(Container container)
|
||||||
{
|
{
|
||||||
super( container );
|
super( container );
|
||||||
subGui = switchingGuis;
|
this.subGui = switchingGuis;
|
||||||
switchingGuis = false;
|
switchingGuis = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
public boolean isSubGui()
|
public boolean isSubGui()
|
||||||
{
|
{
|
||||||
return subGui;
|
return this.subGui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,7 +125,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
if ( i.next() instanceof SlotME )
|
if ( i.next() instanceof SlotME )
|
||||||
i.remove();
|
i.remove();
|
||||||
|
|
||||||
for (InternalSlotME me : meSlots)
|
for (InternalSlotME me : this.meSlots)
|
||||||
slots.add( new SlotME( me ) );
|
slots.add( new SlotME( me ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,21 +145,21 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
|
int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
|
||||||
int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
||||||
mouseWheelEvent( x, y, i / Math.abs( i ) );
|
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
|
||||||
}
|
}
|
||||||
else if ( i != 0 && myScrollBar != null )
|
else if ( i != 0 && this.myScrollBar != null )
|
||||||
myScrollBar.wheel( i );
|
this.myScrollBar.wheel( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void mouseWheelEvent(int x, int y, int wheel)
|
protected void mouseWheelEvent(int x, int y, int wheel)
|
||||||
{
|
{
|
||||||
Slot slot = getSlot( x, y );
|
Slot slot = this.getSlot( x, y );
|
||||||
if ( slot instanceof SlotME )
|
if ( slot instanceof SlotME )
|
||||||
{
|
{
|
||||||
IAEItemStack item = ((SlotME) slot).getAEStack();
|
IAEItemStack item = ((SlotME) slot).getAEStack();
|
||||||
if ( item != null )
|
if ( item != null )
|
||||||
{
|
{
|
||||||
((AEBaseContainer) inventorySlots).setTargetStack( item );
|
((AEBaseContainer) this.inventorySlots).setTargetStack( item );
|
||||||
InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
|
InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
|
||||||
int times = Math.abs( wheel );
|
int times = Math.abs( wheel );
|
||||||
final int inventorySize = this.getInventorySlots().size();
|
final int inventorySize = this.getInventorySlots().size();
|
||||||
@@ -176,13 +176,13 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
public void onGuiClosed()
|
public void onGuiClosed()
|
||||||
{
|
{
|
||||||
super.onGuiClosed();
|
super.onGuiClosed();
|
||||||
subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
|
this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClicked(int xCoord, int yCoord, int btn)
|
protected void mouseClicked(int xCoord, int yCoord, int btn)
|
||||||
{
|
{
|
||||||
drag_click.clear();
|
this.drag_click.clear();
|
||||||
|
|
||||||
if ( btn == 1 )
|
if ( btn == 1 )
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||||
|
|
||||||
if ( drag_click.size() > 1 )
|
if ( this.drag_click.size() > 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||||
@@ -259,7 +259,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
|
if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
|
||||||
{
|
{
|
||||||
if ( enableSpaceClicking() )
|
if ( this.enableSpaceClicking() )
|
||||||
{
|
{
|
||||||
IAEItemStack stack = null;
|
IAEItemStack stack = null;
|
||||||
if ( slot instanceof SlotME )
|
if ( slot instanceof SlotME )
|
||||||
@@ -270,7 +270,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
if ( !(slot instanceof SlotME) && slot != null )
|
if ( !(slot instanceof SlotME) && slot != null )
|
||||||
slotNum = slot.slotNumber;
|
slotNum = slot.slotNumber;
|
||||||
|
|
||||||
((AEBaseContainer) inventorySlots).setTargetStack( stack );
|
((AEBaseContainer) this.inventorySlots).setTargetStack( stack );
|
||||||
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
|
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
|
||||||
NetworkHandler.instance.sendToServer( p );
|
NetworkHandler.instance.sendToServer( p );
|
||||||
return;
|
return;
|
||||||
@@ -356,7 +356,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if ( action != null )
|
if ( action != null )
|
||||||
{
|
{
|
||||||
((AEBaseContainer) inventorySlots).setTargetStack( stack );
|
((AEBaseContainer) this.inventorySlots).setTargetStack( stack );
|
||||||
PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
|
PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
|
||||||
NetworkHandler.instance.sendToServer( p );
|
NetworkHandler.instance.sendToServer( p );
|
||||||
}
|
}
|
||||||
@@ -364,21 +364,21 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !disableShiftClick && isShiftKeyDown() )
|
if ( !this.disableShiftClick && isShiftKeyDown() )
|
||||||
{
|
{
|
||||||
disableShiftClick = true;
|
this.disableShiftClick = true;
|
||||||
|
|
||||||
if ( dbl_whichItem == null || bl_clicked != slot || dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 )
|
if ( this.dbl_whichItem == null || this.bl_clicked != slot || this.dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 )
|
||||||
{
|
{
|
||||||
// some simple double click logic.
|
// some simple double click logic.
|
||||||
bl_clicked = slot;
|
this.bl_clicked = slot;
|
||||||
dbl_clickTimer = Stopwatch.createStarted();
|
this.dbl_clickTimer = Stopwatch.createStarted();
|
||||||
if ( slot != null )
|
if ( slot != null )
|
||||||
dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null;
|
this.dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null;
|
||||||
else
|
else
|
||||||
dbl_whichItem = null;
|
this.dbl_whichItem = null;
|
||||||
}
|
}
|
||||||
else if ( dbl_whichItem != null )
|
else if ( this.dbl_whichItem != null )
|
||||||
{
|
{
|
||||||
// a replica of the weird broken vanilla feature.
|
// a replica of the weird broken vanilla feature.
|
||||||
|
|
||||||
@@ -386,14 +386,14 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
for (Slot inventorySlot : slots)
|
for (Slot inventorySlot : slots)
|
||||||
{
|
{
|
||||||
if ( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack()
|
if ( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack()
|
||||||
&& inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, dbl_whichItem, true ) )
|
&& inventorySlot.inventory == slot.inventory && Container.func_94527_a( inventorySlot, this.dbl_whichItem, true ) )
|
||||||
{
|
{
|
||||||
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, ctrlDown, 1 );
|
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, ctrlDown, 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
disableShiftClick = false;
|
this.disableShiftClick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.handleMouseClick( slot, slotIdx, ctrlDown, key );
|
super.handleMouseClick( slot, slotIdx, ctrlDown, key );
|
||||||
@@ -407,10 +407,10 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if ( slot instanceof SlotFake && itemstack != null )
|
if ( slot instanceof SlotFake && itemstack != null )
|
||||||
{
|
{
|
||||||
drag_click.add( slot );
|
this.drag_click.add( slot );
|
||||||
if ( drag_click.size() > 1 )
|
if ( this.drag_click.size() > 1 )
|
||||||
{
|
{
|
||||||
for (Slot dr : drag_click)
|
for (Slot dr : this.drag_click)
|
||||||
{
|
{
|
||||||
PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
|
PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
|
||||||
dr.slotNumber, 0 );
|
dr.slotNumber, 0 );
|
||||||
@@ -450,9 +450,9 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
final List<Slot> slots = this.getInventorySlots();
|
final List<Slot> slots = this.getInventorySlots();
|
||||||
for (Slot s : slots)
|
for (Slot s : slots)
|
||||||
{
|
{
|
||||||
if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) inventorySlots).getPlayerInv() )
|
if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) this.inventorySlots).getPlayerInv() )
|
||||||
{
|
{
|
||||||
if ( !s.canTakeStack( ((AEBaseContainer) inventorySlots).getPlayerInv().player ) )
|
if ( !s.canTakeStack( ((AEBaseContainer) this.inventorySlots).getPlayerInv().player ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -468,7 +468,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
for (Slot s : slots)
|
for (Slot s : slots)
|
||||||
{
|
{
|
||||||
if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) inventorySlots).getPlayerInv() )
|
if ( s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) this.inventorySlots).getPlayerInv() )
|
||||||
{
|
{
|
||||||
NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
NetworkHandler.instance.sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
||||||
return true;
|
return true;
|
||||||
@@ -488,10 +488,10 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
super.drawScreen( mouse_x, mouse_y, btn );
|
super.drawScreen( mouse_x, mouse_y, btn );
|
||||||
|
|
||||||
boolean hasClicked = Mouse.isButtonDown( 0 );
|
boolean hasClicked = Mouse.isButtonDown( 0 );
|
||||||
if ( hasClicked && myScrollBar != null )
|
if ( hasClicked && this.myScrollBar != null )
|
||||||
myScrollBar.click( this, mouse_x - guiLeft, mouse_y - guiTop );
|
this.myScrollBar.click( this, mouse_x - this.guiLeft, mouse_y - this.guiTop );
|
||||||
|
|
||||||
for (Object c : buttonList)
|
for (Object c : this.buttonList)
|
||||||
{
|
{
|
||||||
if ( c instanceof ITooltip )
|
if ( c instanceof ITooltip )
|
||||||
{
|
{
|
||||||
@@ -508,7 +508,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
String msg = tooltip.getMessage();
|
String msg = tooltip.getMessage();
|
||||||
if ( msg != null )
|
if ( msg != null )
|
||||||
drawTooltip( x + 11, y + 4, 0, msg );
|
this.drawTooltip( x + 11, y + 4, 0, msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +532,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
for (var6 = 0; var6 < var4.length; ++var6)
|
for (var6 = 0; var6 < var4.length; ++var6)
|
||||||
{
|
{
|
||||||
var7 = fontRendererObj.getStringWidth( var4[var6] );
|
var7 = this.fontRendererObj.getStringWidth( var4[var6] );
|
||||||
|
|
||||||
if ( var7 > var5 )
|
if ( var7 > var5 )
|
||||||
{
|
{
|
||||||
@@ -637,10 +637,10 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
@Override
|
@Override
|
||||||
final protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
|
final protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
|
||||||
{
|
{
|
||||||
int ox = guiLeft; // (width - xSize) / 2;
|
int ox = this.guiLeft; // (width - xSize) / 2;
|
||||||
int oy = guiTop; // (height - ySize) / 2;
|
int oy = this.guiTop; // (height - ySize) / 2;
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
drawBG( ox, oy, x, y );
|
this.drawBG( ox, oy, x, y );
|
||||||
|
|
||||||
final List<Slot> slots = this.getInventorySlots();
|
final List<Slot> slots = this.getInventorySlots();
|
||||||
for (Slot slot : slots)
|
for (Slot slot : slots)
|
||||||
@@ -671,30 +671,30 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
@Override
|
@Override
|
||||||
final protected void drawGuiContainerForegroundLayer(int x, int y)
|
final protected void drawGuiContainerForegroundLayer(int x, int y)
|
||||||
{
|
{
|
||||||
int ox = guiLeft; // (width - xSize) / 2;
|
int ox = this.guiLeft; // (width - xSize) / 2;
|
||||||
int oy = guiTop; // (height - ySize) / 2;
|
int oy = this.guiTop; // (height - ySize) / 2;
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
||||||
if ( myScrollBar != null )
|
if ( this.myScrollBar != null )
|
||||||
myScrollBar.draw( this );
|
this.myScrollBar.draw( this );
|
||||||
|
|
||||||
drawFG( ox, oy, x, y );
|
this.drawFG( ox, oy, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getGuiDisplayName(String in)
|
protected String getGuiDisplayName(String in)
|
||||||
{
|
{
|
||||||
return hasCustomInventoryName() ? getInventoryName() : in;
|
return this.hasCustomInventoryName() ? this.getInventoryName() : in;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getInventoryName()
|
private String getInventoryName()
|
||||||
{
|
{
|
||||||
return ((AEBaseContainer) inventorySlots).customName;
|
return ((AEBaseContainer) this.inventorySlots).customName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasCustomInventoryName()
|
private boolean hasCustomInventoryName()
|
||||||
{
|
{
|
||||||
if ( inventorySlots instanceof AEBaseContainer )
|
if ( this.inventorySlots instanceof AEBaseContainer )
|
||||||
return ((AEBaseContainer) inventorySlots).customName != null;
|
return ((AEBaseContainer) this.inventorySlots).customName != null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -704,7 +704,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
for (Slot slot : slots)
|
for (Slot slot : slots)
|
||||||
{
|
{
|
||||||
// isPointInRegion
|
// isPointInRegion
|
||||||
if ( func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) )
|
if ( this.func_146978_c( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) )
|
||||||
{
|
{
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
@@ -761,25 +761,25 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
public void a(Slot s)
|
public void a(Slot s)
|
||||||
{
|
{
|
||||||
drawSlot( s );
|
this.drawSlot( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_146977_a(Slot s)
|
public void func_146977_a(Slot s)
|
||||||
{
|
{
|
||||||
drawSlot( s );
|
this.drawSlot( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawSlot(Slot s)
|
public void drawSlot(Slot s)
|
||||||
{
|
{
|
||||||
if ( s instanceof SlotME )
|
if ( s instanceof SlotME )
|
||||||
{
|
{
|
||||||
RenderItem pIR = setItemRender( aeRenderItem );
|
RenderItem pIR = this.setItemRender( this.aeRenderItem );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.zLevel = 100.0F;
|
this.zLevel = 100.0F;
|
||||||
itemRender.zLevel = 100.0F;
|
itemRender.zLevel = 100.0F;
|
||||||
|
|
||||||
if ( !isPowered() )
|
if ( !this.isPowered() )
|
||||||
{
|
{
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
GL11.glDisable( GL11.GL_LIGHTING );
|
||||||
drawRect( s.xDisplayPosition, s.yDisplayPosition, 16 + s.xDisplayPosition, 16 + s.yDisplayPosition, 0x66111111 );
|
drawRect( s.xDisplayPosition, s.yDisplayPosition, 16 + s.xDisplayPosition, 16 + s.yDisplayPosition, 0x66111111 );
|
||||||
@@ -789,9 +789,9 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
this.zLevel = 0.0F;
|
this.zLevel = 0.0F;
|
||||||
itemRender.zLevel = 0.0F;
|
itemRender.zLevel = 0.0F;
|
||||||
|
|
||||||
aeRenderItem.aeStack = ((SlotME) s).getAEStack();
|
this.aeRenderItem.aeStack = ((SlotME) s).getAEStack();
|
||||||
|
|
||||||
safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
}
|
}
|
||||||
catch (Exception err)
|
catch (Exception err)
|
||||||
{
|
{
|
||||||
@@ -799,7 +799,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
if ( Platform.isDrawing( Tessellator.instance ) )
|
if ( Platform.isDrawing( Tessellator.instance ) )
|
||||||
Tessellator.instance.draw();
|
Tessellator.instance.draw();
|
||||||
}
|
}
|
||||||
setItemRender( pIR );
|
this.setItemRender( pIR );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -812,7 +812,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
AppEngSlot aes = (AppEngSlot) s;
|
AppEngSlot aes = (AppEngSlot) s;
|
||||||
if ( aes.getIcon() >= 0 )
|
if ( aes.getIcon() >= 0 )
|
||||||
{
|
{
|
||||||
bindTexture( "guis/states.png" );
|
this.bindTexture( "guis/states.png" );
|
||||||
|
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
@@ -894,10 +894,10 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
if ( s instanceof AppEngSlot )
|
if ( s instanceof AppEngSlot )
|
||||||
{
|
{
|
||||||
((AppEngSlot) s).isDisplay = true;
|
((AppEngSlot) s).isDisplay = true;
|
||||||
safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -907,7 +907,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// do the usual for non-ME Slots.
|
// do the usual for non-ME Slots.
|
||||||
safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.util.Locale;
|
|||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.client.me.SlotME;
|
import appeng.client.me.SlotME;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
@@ -40,7 +41,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
|||||||
{
|
{
|
||||||
if ( stack != null )
|
if ( stack != null )
|
||||||
{
|
{
|
||||||
Slot s = getSlot( mouseX, mouseY );
|
Slot s = this.getSlot( mouseX, mouseY );
|
||||||
if ( s instanceof SlotME )
|
if ( s instanceof SlotME )
|
||||||
{
|
{
|
||||||
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||||
@@ -78,7 +79,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
|||||||
@Override
|
@Override
|
||||||
protected void renderToolTip(ItemStack stack, int x, int y)
|
protected void renderToolTip(ItemStack stack, int x, int y)
|
||||||
{
|
{
|
||||||
Slot s = getSlot( x, y );
|
Slot s = this.getSlot( x, y );
|
||||||
if ( s instanceof SlotME && stack != null )
|
if ( s instanceof SlotME && stack != null )
|
||||||
{
|
{
|
||||||
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||||
@@ -105,13 +106,13 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
|||||||
if ( myStack.getCountRequestable() > 0 )
|
if ( myStack.getCountRequestable() > 0 )
|
||||||
currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) );
|
currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) );
|
||||||
|
|
||||||
drawTooltip( x, y, 0, join( currentToolTip, "\n" ) );
|
this.drawTooltip( x, y, 0, join( currentToolTip, "\n" ) );
|
||||||
}
|
}
|
||||||
else if ( stack.stackSize > BigNumber )
|
else if ( stack.stackSize > BigNumber )
|
||||||
{
|
{
|
||||||
List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
|
List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
|
||||||
var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) );
|
var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) );
|
||||||
drawTooltip( x, y, 0, join( var4, "\n" ) );
|
this.drawTooltip( x, y, 0, join( var4, "\n" ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user