mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42573b3fa4 | ||
|
|
c4cbe05dfe | ||
|
|
a591baf426 | ||
|
|
4131a1e7b7 | ||
|
|
32c251d805 | ||
|
|
b237c6cb4d | ||
|
|
58e8bf712c | ||
|
|
f1978a6a15 | ||
|
|
5bd58bd981 | ||
|
|
b0f7c8600a | ||
|
|
1b2c38cf0a | ||
|
|
e6c216ab31 | ||
|
|
745b6ed528 | ||
|
|
9422337282 | ||
|
|
3b0025500e | ||
|
|
dd739ba58e | ||
|
|
edbd5621c3 | ||
|
|
d90c7dae1b |
No files matched your search
@@ -27,4 +27,3 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
+13
-15
@@ -1,24 +1,22 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.14:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.66-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.38:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.0:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev')
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.2.11:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.13.42-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.12:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-660-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.7.3:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-400-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.395:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.16-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.32:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.5-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.8-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.16-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.05:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.14.1-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
@@ -26,5 +24,5 @@ dependencies {
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta51:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha45:api') {transitive = false}
|
||||
}
|
||||
+6
-17
@@ -14,7 +14,7 @@ modId = EnderIO
|
||||
modGroup = crazypants.enderio
|
||||
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
@@ -41,11 +41,11 @@ developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
enableModernJavaSyntax = false
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = true
|
||||
enableGenericInjection = false
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
@@ -80,16 +80,11 @@ apiPackage = api
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
accessTransformersFile = enderio_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
@@ -122,15 +117,9 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
@@ -151,7 +140,7 @@ modrinthProjectId =
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -57,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -86,7 +84,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -205,7 +203,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
Vendored
-2
@@ -13,8 +13,6 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.BlockConduitBundle;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.facade.FacadeRenderer;
|
||||
import crazypants.enderio.conduit.gas.GasConduit;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
@@ -103,8 +104,11 @@ import crazypants.enderio.machine.painter.BlockPaintedFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
|
||||
import crazypants.enderio.machine.painter.PaintedBlockRenderer;
|
||||
import crazypants.enderio.machine.painter.PaintedItemRenderer;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.ranged.RangeRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeRenerer;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import crazypants.enderio.machine.solar.BlockSolarPanel;
|
||||
@@ -318,6 +322,13 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCapBank.class, newCbr);
|
||||
}
|
||||
|
||||
CapacitorBankRenderer capr = new CapacitorBankRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockCapacitorBank), capr);
|
||||
|
||||
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
CapBankRenderer2 cbr2 = new CapBankRenderer2();
|
||||
RenderingRegistry.registerBlockHandler(cbr2);
|
||||
|
||||
BlockVacuumChest.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
VacuumChestRenderer vcr = new VacuumChestRenderer();
|
||||
RenderingRegistry.registerBlockHandler(vcr);
|
||||
@@ -367,6 +378,7 @@ public class ClientProxy extends CommonProxy {
|
||||
cbr = new ConduitBundleRenderer((float) Config.conduitScale);
|
||||
BlockConduitBundle.rendererId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(cbr);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileConduitBundle.class, cbr);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTravelAnchor.class, new TravelEntitySpecialRenderer());
|
||||
|
||||
@@ -409,7 +421,7 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(KeyTracker.instance);
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(SoundEntity.class, new SoundRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenerer());
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(SoundDetector.instance);
|
||||
FMLCommonHandler.instance().bus().register(SoundDetector.instance);
|
||||
|
||||
@@ -132,6 +132,7 @@ import crazypants.enderio.machine.painter.BlockPaintedStair;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedWall;
|
||||
import crazypants.enderio.machine.painter.BlockPainter;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.reservoir.BlockReservoir;
|
||||
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
|
||||
@@ -181,17 +182,12 @@ import crazypants.enderio.thaumcraft.ThaumcraftCompat;
|
||||
import crazypants.enderio.tool.EnderIOCrashCallable;
|
||||
import crazypants.util.EE3Util;
|
||||
|
||||
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = """
|
||||
required-after:CoFHLib@[1.7.10R1.0.3B3,);\
|
||||
required-after:endercore;\
|
||||
required-after:gtnhlib@[0.2.10,);\
|
||||
after:MineFactoryReloaded;\
|
||||
after:Forestry;\
|
||||
after:Waila@[1.5.8,);\
|
||||
after:Thaumcraft;\
|
||||
after:appliedenergistics2@[rv2-beta-8,);\
|
||||
after:Railcraft@[9.16.7,)\
|
||||
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
@Mod(
|
||||
modid = MODID,
|
||||
name = MOD_NAME,
|
||||
version = VERSION,
|
||||
dependencies = "required-after:CoFHLib@(1.0.3B3,);after:endercore;after:MineFactoryReloaded;after:Forestry;after:Waila@[1.5.8,);after:Thaumcraft;after:appliedenergistics2@[rv2-beta-8,);after:chisel",
|
||||
guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
|
||||
public static final String MODID = "EnderIO";
|
||||
@@ -212,7 +208,7 @@ public class EnderIO {
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi_post");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -284,6 +280,7 @@ public class EnderIO {
|
||||
public static BlockSolarPanel blockSolarPanel;
|
||||
public static BlockReservoir blockReservoir;
|
||||
public static BlockAlloySmelter blockAlloySmelter;
|
||||
public static BlockCapacitorBank blockCapacitorBank;
|
||||
public static BlockCapBank blockCapBank;
|
||||
public static BlockWirelessCharger blockWirelessCharger;
|
||||
public static BlockCrusher blockCrusher;
|
||||
@@ -393,6 +390,7 @@ public class EnderIO {
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
blockAlloySmelter = BlockAlloySmelter.create();
|
||||
blockCapacitorBank = BlockCapacitorBank.create();
|
||||
blockCapBank = BlockCapBank.create();
|
||||
|
||||
blockPainter = BlockPainter.create();
|
||||
@@ -812,6 +810,7 @@ public class EnderIO {
|
||||
return Config.xpJuiceName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addModIntegration() {
|
||||
|
||||
if (Loader.isModLoaded("TConstruct")) {
|
||||
@@ -822,7 +821,6 @@ public class EnderIO {
|
||||
|
||||
Class<?> modFluxClass = Class.forName("tconstruct.modifiers.tools.ModFlux");
|
||||
Field batteriesField = modFluxClass.getField("batteries");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ItemStack> batteries = (List<ItemStack>) batteriesField.get(modFluxInst);
|
||||
batteries.add(new ItemStack(blockCapBank));
|
||||
Log.info("Registered Capacitor Banks as Tinkers Construct Flux Upgrades");
|
||||
|
||||
@@ -55,6 +55,7 @@ public enum ModObject {
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
blockCapacitorBank,
|
||||
blockCapBank,
|
||||
blockSagMill,
|
||||
blockHyperCube,
|
||||
|
||||
@@ -148,9 +148,10 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List<ItemStack> items) {
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List items) {
|
||||
items.add(new ItemStack(this, 1, 0));
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ public class ContainerDarkSteelAnvil extends ContainerRepair {
|
||||
private final Field _materialCost = ReflectionHelper
|
||||
.findField(ContainerRepair.class, "materialCost", "stackSizeToBeUsedInRepair", "field_82856_l");
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ContainerDarkSteelAnvil(InventoryPlayer playerInv, final World world, final int x, final int y, final int z,
|
||||
EntityPlayer player) {
|
||||
super(playerInv, world, x, y, z, player);
|
||||
|
||||
@@ -190,8 +190,9 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < subtypes.length; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
|
||||
@@ -160,6 +160,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
BlockConduitBundle result = new BlockConduitBundle();
|
||||
result.init();
|
||||
MinecraftForge.EVENT_BUS.register(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -291,6 +292,41 @@ public class BlockConduitBundle extends BlockEio
|
||||
effectRenderer.addEffect(digFX);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySound(PlaySoundSourceEvent event) {
|
||||
String path = event.sound.getPositionedSoundLocation().getResourcePath();
|
||||
if ("silence.step".equals(path)) {
|
||||
ISound snd = event.sound;
|
||||
World world = EnderIO.proxy.getClientWorld();
|
||||
BlockCoord bc = new BlockCoord(snd.getXPosF(), snd.getYPosF(), snd.getZPosF());
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playHitSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playHitSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySoundAtEntity(PlaySoundAtEntityEvent event) {
|
||||
String path = event.name;
|
||||
World world = event.entity.worldObj;
|
||||
if ("EnderIO:silence.step".equals(path) && world.isRemote) {
|
||||
BlockCoord bc = new BlockCoord(event.entity.posX, event.entity.posY - 2, event.entity.posZ);
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playStepSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playStepSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -298,7 +334,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE + dir.ordinal(), this);
|
||||
}
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_EXTERNAL_CONNECTION_SELECTOR, this);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -438,6 +473,24 @@ public class BlockConduitBundle extends BlockEio
|
||||
: resist;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeed(BreakSpeed event) {
|
||||
if (event.block == this) {
|
||||
ItemStack held = event.entityPlayer.getCurrentEquippedItem();
|
||||
if (held == null || held.getItem().getHarvestLevel(held, "pickaxe") == -1) {
|
||||
event.newSpeed += 2;
|
||||
}
|
||||
IConduitBundle te = (IConduitBundle) event.entity.worldObj.getTileEntity(event.x, event.y, event.z);
|
||||
if (te != null && te.getFacadeType() == FacadeType.HARDENED) {
|
||||
if (!ConduitUtil.isSolidFacadeRendered(te, event.entityPlayer)) {
|
||||
event.newSpeed *= 6;
|
||||
} else {
|
||||
event.newSpeed *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
@@ -870,7 +923,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb,
|
||||
List<AxisAlignedBB> arraylist, Entity par7Entity) {
|
||||
@SuppressWarnings("rawtypes") List arraylist, Entity par7Entity) {
|
||||
|
||||
if (MicroblocksUtil.supportMicroblocks()) {
|
||||
IM__addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, par7Entity);
|
||||
@@ -1208,8 +1261,9 @@ public class BlockConduitBundle extends BlockEio
|
||||
return IMultipartSystem.instance.hook_collisionRayTrace(cur, world, x, y, z, src, dst);
|
||||
}
|
||||
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask,
|
||||
List<AxisAlignedBB> list, Entity entity) {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
|
||||
Entity entity) {
|
||||
IMultipartSystem.instance.hook_addCollisionBoxesToList(world, x, y, z, mask, list, entity);
|
||||
}
|
||||
|
||||
@@ -1221,61 +1275,4 @@ public class BlockConduitBundle extends BlockEio
|
||||
private boolean hasMicroblocks(IConduitBundle bundle) {
|
||||
return !bundle.getCoverSystem().getAllParts().isEmpty();
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySound(PlaySoundSourceEvent event) {
|
||||
String path = event.sound.getPositionedSoundLocation().getResourcePath();
|
||||
if ("silence.step".equals(path)) {
|
||||
ISound snd = event.sound;
|
||||
World world = EnderIO.proxy.getClientWorld();
|
||||
if (world == null) return;
|
||||
BlockCoord bc = new BlockCoord(snd.getXPosF(), snd.getYPosF(), snd.getZPosF());
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playHitSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playHitSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySoundAtEntity(PlaySoundAtEntityEvent event) {
|
||||
String path = event.name;
|
||||
World world = event.entity.worldObj;
|
||||
if ("EnderIO:silence.step".equals(path) && world.isRemote) {
|
||||
BlockCoord bc = new BlockCoord(event.entity.posX, event.entity.posY - 2, event.entity.posZ);
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playStepSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playStepSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeed(BreakSpeed event) {
|
||||
if (event.block == BlockConduitBundle.this) {
|
||||
ItemStack held = event.entityPlayer.getCurrentEquippedItem();
|
||||
if (held == null || held.getItem().getHarvestLevel(held, "pickaxe") == -1) {
|
||||
event.newSpeed += 2;
|
||||
}
|
||||
IConduitBundle te = (IConduitBundle) event.entity.worldObj.getTileEntity(event.x, event.y, event.z);
|
||||
if (te != null && te.getFacadeType() == FacadeType.HARDENED) {
|
||||
if (!ConduitUtil.isSolidFacadeRendered(te, event.entityPlayer)) {
|
||||
event.newSpeed *= 6;
|
||||
} else {
|
||||
event.newSpeed *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -688,7 +688,7 @@ public class ConduitRecipes {
|
||||
String fluix = "crystalFluix";
|
||||
String pureFluix = "crystalPureFluix";
|
||||
|
||||
ItemStack quartzFiber = AEApi.instance().definitions().parts().quartzFiber().maybeStack(1).get().copy();
|
||||
ItemStack quartzFiber = AEApi.instance().parts().partQuartzFiber.stack(1).copy();
|
||||
ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
|
||||
ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
|
||||
|
||||
@@ -697,6 +697,10 @@ public class ConduitRecipes {
|
||||
|
||||
res.stackSize = 1;
|
||||
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
|
||||
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
|
||||
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
if (Config.enableMEUltraDenseConduits) {
|
||||
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class ConduitUtil {
|
||||
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static void ensureValidNetwork(IConduit conduit) {
|
||||
TileEntity te = conduit.getBundle().getEntity();
|
||||
World world = te.getWorldObj();
|
||||
@@ -54,15 +54,13 @@ public class ConduitUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork res = conduit.createNetworkForType();
|
||||
res.init(conduit.getBundle(), connections, world);
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
private static boolean reuseNetwork(IConduit con, Collection<? extends IConduit> connections, World world) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork network = null;
|
||||
for (IConduit conduit : connections) {
|
||||
if (network == null) {
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.gtnewhorizon.gtnhlib.concurrent.cas.CasList;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -67,7 +66,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
public static final short NBT_VERSION = 1;
|
||||
|
||||
private final List<IConduit> conduits = new CasList<>();
|
||||
private final List<IConduit> conduits = new ArrayList<IConduit>();
|
||||
|
||||
private Block facadeId = null;
|
||||
private int facadeMeta = 0;
|
||||
@@ -75,9 +74,9 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
private boolean facadeChanged;
|
||||
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<>();
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<CollidableComponent>();
|
||||
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<>();
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<CollidableComponent>();
|
||||
|
||||
private boolean conduitsDirty = true;
|
||||
private boolean collidablesDirty = true;
|
||||
@@ -537,12 +536,11 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public List<CollidableComponent> getConnectors() {
|
||||
List<CollidableComponent> result = new ArrayList<>();
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
addConnectors(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addConnectors(List<CollidableComponent> result) {
|
||||
|
||||
if (conduits.isEmpty()) {
|
||||
@@ -966,6 +964,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
return (IGridNode) node;
|
||||
}
|
||||
|
||||
@SuppressWarnings("cast")
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void setGridNode(Object node) {
|
||||
|
||||
@@ -109,6 +109,7 @@ public class BlockConduitFacade extends BlockEio implements IPaintedBlock, Clone
|
||||
}
|
||||
|
||||
Block block = cb.getFacadeId();
|
||||
int meta = cb.getFacadeMetadata();
|
||||
if (block == null || block == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,9 +65,10 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
GameRegistry.registerItem(this, ModObject.itemConduitFacade.unlocalisedName);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
for (FacadeType t : FacadeType.values()) {
|
||||
list.add(new ItemStack(item, 1, t.ordinal()));
|
||||
}
|
||||
@@ -170,9 +171,10 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
super.addInformation(item, par2EntityPlayer, list, par4);
|
||||
}
|
||||
|
||||
@@ -181,13 +183,15 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (PainterUtil.getSourceBlock(itemstack) == null) {
|
||||
list.add(EnderIO.lang.localize("item.itemConduitFacade.tooltip.notpainted"));
|
||||
} else {
|
||||
@@ -195,9 +199,10 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
if (itemstack.getItemDamage() == FacadeType.HARDENED.ordinal()) {
|
||||
list.add("");
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -87,6 +88,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -101,6 +103,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
return;
|
||||
}
|
||||
|
||||
Gas f = tank.getGas() == null ? null : tank.getGas().getGas();
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if (autoExtractForDir(dir)) {
|
||||
if (network.extractFrom(this, dir, MAX_EXTRACT_PER_TICK)) {
|
||||
|
||||
@@ -56,15 +56,15 @@ public class ItemGasConduit extends AbstractItemConduit implements IAdvancedTool
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
String gpt = " " + EnderIO.lang.localize("gas.gasTick");
|
||||
int extractRate = Config.gasConduitExtractRate;
|
||||
int maxIo = Config.gasConduitMaxIoRate;
|
||||
|
||||
@@ -103,6 +103,8 @@ public class GasSettings extends BaseSettingsPanel {
|
||||
protected void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
boolean isInput = isInput();
|
||||
if (isInput) {
|
||||
int x = gui.getGuiLeft() + gap + gui.getFontRenderer().getStringWidth(autoExtractStr) + gap + 2;
|
||||
int y = customTop;
|
||||
gui.getFontRenderer().drawString(autoExtractStr, left, top, ColorUtil.getRGB(Color.DARK_GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
}
|
||||
|
||||
public void createFilterSlots() {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
|
||||
@@ -101,7 +101,7 @@ public class LimitedItemFilterGui implements IItemFilterGui {
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
}
|
||||
|
||||
public void createFilterSlots() {
|
||||
|
||||
@@ -64,8 +64,9 @@ public class ItemExtractSpeedUpgrade extends Item implements IResourceTooltipPro
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -64,8 +64,9 @@ public class ItemFunctionUpgrade extends Item implements IResourceTooltipProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -82,8 +82,9 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
@@ -91,8 +92,7 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (!SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnderIO.lang.localize("itemConduitFilterUpgrade"));
|
||||
|
||||
@@ -89,8 +89,7 @@ public class ItemExistingItemFilter extends Item implements IItemFilterUpgrade,
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -91,10 +91,11 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return doesItemPassFilter(item);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SimplifiableConditionalExpression")
|
||||
public boolean doesItemPassFilter(ItemStack item) {
|
||||
boolean allow = isValid() && itemMatched(item);
|
||||
|
||||
return isBlacklist ^ allow;
|
||||
return isBlacklist ? !allow : allow;
|
||||
}
|
||||
|
||||
protected boolean itemMatched(ItemStack item) {
|
||||
|
||||
@@ -60,8 +60,7 @@ public class ItemLimitedItemFilter extends Item implements IItemFilterUpgrade, I
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -60,8 +60,7 @@ public class ItemModItemFilter extends Item implements IItemFilterUpgrade, IReso
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -308,6 +308,7 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -91,6 +92,7 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
// Extraction can happen on extract mode or in/out mode
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
@@ -106,6 +108,7 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
return;
|
||||
}
|
||||
|
||||
Fluid f = tank.getFluid() == null ? null : tank.getFluid().getFluid();
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if (autoExtractForDir(dir)) {
|
||||
if (network.extractFrom(this, dir, MAX_EXTRACT_PER_TICK)) {
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ConduitTank implements IFluidTank {
|
||||
addAmount(-used);
|
||||
}
|
||||
|
||||
FluidStack drained = new FluidStack(fluid.getFluid(), used);
|
||||
FluidStack drained = new FluidStack(fluid.getFluidID(), used);
|
||||
|
||||
if (fluid.amount < 0) {
|
||||
fluid.amount = 0;
|
||||
|
||||
@@ -77,15 +77,15 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
int extractRate;
|
||||
int maxIo;
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
}
|
||||
if (!foundFluid) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
FluidStack couldDrain = extTank.drain(dir.getOpposite(), MAX_EXTRACT_PER_TICK, false);
|
||||
@@ -360,7 +360,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
return false;
|
||||
}
|
||||
|
||||
AbstractTankConduitNetwork<?> n = (AbstractTankConduitNetwork<?>) network;
|
||||
AbstractTankConduitNetwork n = (AbstractTankConduitNetwork) network;
|
||||
if (tank.getFluid() == null) {
|
||||
tank.setLiquid(n.getFluidType() == null ? null : n.getFluidType().copy());
|
||||
} else if (n.getFluidType() == null) {
|
||||
|
||||
@@ -279,11 +279,13 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
loc.y,
|
||||
loc.z,
|
||||
ILiquidConduit.class);
|
||||
int numTargets = 0;
|
||||
for (ILiquidConduit n : connections) {
|
||||
LiquidConduit neighbour = (LiquidConduit) n;
|
||||
if (canFlowTo(con, neighbour)) { // can only flow within same network
|
||||
totalAmount += neighbour.getTank().getFluidAmount();
|
||||
totalCapacity += neighbour.getTank().getCapacity();
|
||||
numTargets++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -56,17 +56,10 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
}
|
||||
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (isNSEWUD(component.dir)) {
|
||||
LiquidConduit lc = (LiquidConduit) conduit;
|
||||
IIcon fluidTex = conduit.getTransmitionTextureForState(component);
|
||||
FluidStack fluid = lc.getFluidType();
|
||||
if (fluid != null) {
|
||||
renderFluidOutline(component, fluid);
|
||||
@@ -74,40 +67,33 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(cube, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), component.dir, false);
|
||||
// This check is kinda broken, but whatever, it was like that when this was done in a TESR too
|
||||
if (lc.getTank().getFilledRatio() <= 0) {
|
||||
continue;
|
||||
}
|
||||
tessellator.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
drawSection(
|
||||
cube,
|
||||
fluidTex.getMinU(),
|
||||
fluidTex.getMaxU(),
|
||||
fluidTex.getMinV(),
|
||||
fluidTex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(
|
||||
component.dir,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
} else {
|
||||
drawSection(
|
||||
component.bound,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound
|
||||
.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,29 +113,27 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = Collections
|
||||
.synchronizedMap(new WeakHashMap<>());
|
||||
private static Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = new WeakHashMap<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>>();
|
||||
|
||||
public static List<CachableRenderStatement> computeFluidOutlineToCache(CollidableComponent component, Fluid fluid,
|
||||
double scaleFactor, float outlineWidth) {
|
||||
|
||||
// Only init once per component across all threads so the cache stays accurate.
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache
|
||||
.computeIfAbsent(component, _k -> new ConcurrentHashMap<>());
|
||||
// The rest of this function 'should' be in a `computeIfAbsent` as well for:
|
||||
// `cache0.computeIfAbsent(fluid, _k -> ...)` but that won't cause a bug in this case,
|
||||
// just a bit more garbage.
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache.get(component);
|
||||
if (cache0 == null) {
|
||||
cache0 = new HashMap<Fluid, List<CachableRenderStatement>>();
|
||||
cache.put(component, cache0);
|
||||
}
|
||||
List<CachableRenderStatement> data = cache0.get(fluid);
|
||||
if (data != null) {
|
||||
return data;
|
||||
}
|
||||
data = new ArrayList<>();
|
||||
data = new ArrayList<CachableRenderStatement>();
|
||||
cache0.put(fluid, data);
|
||||
|
||||
IIcon texture = fluid.getStillIcon();
|
||||
if (texture == null) {
|
||||
texture = fluid.getIcon();
|
||||
if (texture == null) {
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -208,7 +192,6 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
}
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -256,6 +239,49 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
// done in the dynamic section
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
if (((LiquidConduit) conduit).getTank().getFilledRatio() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Collection<CollidableComponent> components = conduit.getCollidableComponents();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
calculateRatios((LiquidConduit) conduit);
|
||||
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
|
||||
|
||||
IIcon tex;
|
||||
for (CollidableComponent component : components) {
|
||||
if (renderComponent(component)) {
|
||||
if (isNSEWUD(component.dir) && conduit.getTransmitionTextureForState(component) != null) {
|
||||
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tex = conduit.getTransmitionTextureForState(component);
|
||||
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(
|
||||
cube,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setVerticesForTransmission(BoundingBox bound, ForgeDirection id) {
|
||||
|
||||
|
||||
@@ -14,5 +14,7 @@ public interface IMEConduit extends IConduit {
|
||||
|
||||
boolean isDense();
|
||||
|
||||
boolean isDenseUltra();
|
||||
|
||||
int getChannelsInUse();
|
||||
}
|
||||
@@ -15,7 +15,8 @@ public class ItemMEConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMeConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense") };
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "DenseUltra", "enderio:itemMeConduitDenseUltra") };
|
||||
|
||||
public static ItemMEConduit create() {
|
||||
ItemMEConduit result = new ItemMEConduit();
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -50,6 +51,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public static IIcon[] longTextures;
|
||||
|
||||
private boolean isDense;
|
||||
private boolean isDenseUltra;
|
||||
private int playerID = -1;
|
||||
|
||||
public MEConduit() {
|
||||
@@ -57,6 +59,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
|
||||
public MEConduit(int itemDamage) {
|
||||
isDenseUltra = itemDamage == 2;
|
||||
isDense = itemDamage == 1;
|
||||
}
|
||||
|
||||
@@ -65,14 +68,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
coreTextures = new IIcon[2];
|
||||
longTextures = new IIcon[2];
|
||||
coreTextures = new IIcon[3];
|
||||
longTextures = new IIcon[3];
|
||||
|
||||
coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
|
||||
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
|
||||
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");
|
||||
|
||||
longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
|
||||
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
|
||||
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,7 +87,10 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
});
|
||||
}
|
||||
|
||||
public static int getDamageForState(boolean isDense) {
|
||||
public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
|
||||
if (isDenseUltra) {
|
||||
return 2;
|
||||
}
|
||||
if (isDense) {
|
||||
return 1;
|
||||
}
|
||||
@@ -96,7 +104,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,6 +122,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setBoolean("isDense", isDense);
|
||||
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
|
||||
nbtRoot.setInteger("playerID", playerID);
|
||||
}
|
||||
|
||||
@@ -126,6 +135,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
} else {
|
||||
playerID = -1;
|
||||
}
|
||||
if (nbtRoot.hasKey("isDenseUltra")) {
|
||||
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerID(int playerID) {
|
||||
@@ -196,12 +208,22 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Method(modid = "appliedenergistics2")
|
||||
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
|
||||
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
|
||||
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
|
||||
if (isDenseUltra()) {
|
||||
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|
||||
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
|
||||
} else if (isDense()) {
|
||||
return true;
|
||||
} else {
|
||||
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
int state = getDamageForState(isDense);
|
||||
int state = getDamageForState(isDense, isDenseUltra);
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return coreTextures[state];
|
||||
} else {
|
||||
@@ -378,4 +400,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean isDense() {
|
||||
return isDense;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDenseUltra() {
|
||||
return isDenseUltra;
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,9 @@ public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
@Override
|
||||
public EnumSet<GridFlags> getFlags() {
|
||||
if (conduit.isDenseUltra()) {
|
||||
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
if (conduit.isDense()) {
|
||||
return EnumSet.of(GridFlags.DENSE_CAPACITY);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -266,6 +266,7 @@ public class NetworkPowerManager {
|
||||
|
||||
float filledRatio = (float) energyStored / maxEnergyStored;
|
||||
int energyLeft = energyStored;
|
||||
int given = 0;
|
||||
for (IPowerConduit con : network.getConduits()) {
|
||||
if (energyLeft > 0) {
|
||||
// NB: use ceil to ensure we dont through away any energy due to
|
||||
@@ -275,6 +276,7 @@ public class NetworkPowerManager {
|
||||
give = Math.min(give, con.getMaxEnergyStored());
|
||||
give = Math.min(give, energyLeft);
|
||||
con.setEnergyStored(give);
|
||||
given += give;
|
||||
energyLeft -= give;
|
||||
} else {
|
||||
con.setEnergyStored(0);
|
||||
|
||||
@@ -137,7 +137,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
if (ConduitUtil.isProbeEquipped(player)) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
PacketConduitProbe.sendInfoMessage(player, this);
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if (col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
@@ -283,6 +283,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if (mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
@@ -297,12 +298,10 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ public class PowerConduitRenderer extends DefaultConduitRenderer {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_I(c);
|
||||
|
||||
Offset offset = conduit.getBundle().getOffset(IPowerConduit.class, component.dir);
|
||||
BoundingBox bound = component.bound;
|
||||
if (conMode != ConnectionMode.IN_OUT) {
|
||||
Vector3d trans = ForgeDirectionOffsets.offsetScaled(component.dir, -0.075);
|
||||
|
||||
@@ -13,8 +13,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -72,9 +72,10 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
|
||||
protected boolean neighbourDirty = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public RedstoneConduit() {
|
||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||
externalSignals.add(new HashSet<>());
|
||||
for (ForgeDirection ignored : ForgeDirection.VALID_DIRECTIONS) {
|
||||
externalSignals.add(new HashSet<Signal>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -18,9 +19,13 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.IBlockAccessWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -48,12 +53,59 @@ import crazypants.util.RenderPassHelper;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@ThreadSafeISBRH(perThread = false)
|
||||
public class ConduitBundleRenderer implements ISimpleBlockRenderingHandler {
|
||||
public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public ConduitBundleRenderer(float conduitScale) {}
|
||||
|
||||
public ConduitBundleRenderer() {}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
if (bundle == null || (bundle.hasFacade() && bundle.getFacadeId().isOpaqueCube()
|
||||
&& !ConduitUtil.isFacadeHidden(bundle, player))) {
|
||||
return;
|
||||
}
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
float brightness = -1;
|
||||
for (IConduit con : bundle.getConduits()) {
|
||||
if (ConduitUtil.renderConduit(player, con)) {
|
||||
final ConduitRenderer renderer = con.getRenderer();
|
||||
if (renderer.isDynamic()) {
|
||||
if (brightness == -1) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
brightness = bundle.getEntity().getWorldObj()
|
||||
.getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);
|
||||
|
||||
RenderUtil.bindBlockTexture();
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
renderer.renderDynamicEntity(this, bundle, con, x, y, z, partialTick, brightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (brightness != -1) {
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks rb) {
|
||||
|
||||
@@ -10,4 +10,8 @@ public interface ConduitRenderer {
|
||||
void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x, double y,
|
||||
double z, float partialTick, float worldLight, RenderBlocks rb);
|
||||
|
||||
boolean isDynamic();
|
||||
|
||||
void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x,
|
||||
double y, double z, float partialTick, float worldLight);
|
||||
}
|
||||
@@ -63,6 +63,10 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con,
|
||||
double x, double y, double z, float partialTick, float worldLight) {}
|
||||
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
|
||||
@@ -93,6 +97,7 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
@@ -344,4 +349,8 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
return new BoundingBox[] { bb };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,7 @@ public final class Config {
|
||||
public static final Section sectionMobConfig = new Section("Mob Config", "mobconfig");
|
||||
public static final Section sectionRailConfig = new Section("Rail", "railconfig");
|
||||
public static final Section sectionEnchantments = new Section("Enchantments", "enchantments");
|
||||
public static final Section sectionWeather = new Section("Weather", "weather");
|
||||
public static final Section sectionTelepad = new Section("Telepad", "telepad");
|
||||
public static final Section sectionInventoryPanel = new Section("InventoryPanel", "inventorypanel");
|
||||
public static final Section sectionMisc = new Section("Misc", "misc");
|
||||
@@ -173,6 +174,8 @@ public final class Config {
|
||||
* The distance travelled when no block is found within {@link #teleportStaffMaxBlinkDistance}.
|
||||
*/
|
||||
public static int teleportStaffFailedBlinkDistance = 64;
|
||||
/** If true, use the original staff of teleportation controls. */
|
||||
public static boolean teleportStaffOriginalControls = false;
|
||||
|
||||
/**
|
||||
* Sets the teleport staff right-click action.
|
||||
@@ -185,6 +188,9 @@ public final class Config {
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor <em>(default)</em>
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* Overridden if {@link #teleportStaffOriginalControls} is true.
|
||||
*/
|
||||
public static int teleportStaffAction = 3;
|
||||
|
||||
@@ -199,6 +205,9 @@ public final class Config {
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* Overridden if {@link #teleportStaffOriginalControls} is true.
|
||||
*/
|
||||
public static int teleportStaffSneakAction = 1;
|
||||
|
||||
@@ -284,8 +293,6 @@ public final class Config {
|
||||
|
||||
public static int darkSteelApiaristArmorCost = 10;
|
||||
|
||||
public static int darkSteelTrackmanGogglesCost = 10;
|
||||
|
||||
public static int darkSteelSwimCost = 10;
|
||||
|
||||
public static int darkSteelNightVisionCost = 10;
|
||||
@@ -476,6 +483,7 @@ public final class Config {
|
||||
|
||||
public static boolean isGasConduitEnabled = true;
|
||||
public static boolean enableMEConduits = true;
|
||||
public static boolean enableMEUltraDenseConduits = false;
|
||||
public static boolean enableOCConduits = true;
|
||||
public static boolean enableOCConduitsAnimatedTexture = true;
|
||||
|
||||
@@ -543,6 +551,10 @@ public final class Config {
|
||||
public static boolean spawnGuardStopAllSlimesDebug = false;
|
||||
public static boolean spawnGuardStopAllSquidSpawning = false;
|
||||
|
||||
public static int weatherObeliskClearFluid = 2000;
|
||||
public static int weatherObeliskRainFluid = 500;
|
||||
public static int weatherObeliskThunderFluid = 1000;
|
||||
|
||||
// Loot Defaults
|
||||
public static boolean lootDarkSteel = true;
|
||||
public static boolean lootItemConduitProbe = true;
|
||||
@@ -595,8 +607,6 @@ public final class Config {
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static float fusedQuartzExplosionResistance = 2000.0f;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -1297,25 +1307,35 @@ public final class Config {
|
||||
"Number of blocks teleported when no block is being looked at.")
|
||||
.getInt(teleportStaffFailedBlinkDistance);
|
||||
|
||||
teleportStaffOriginalControls = config.get(
|
||||
sectionPersonal.name,
|
||||
"teleportStaffOriginalControls",
|
||||
teleportStaffOriginalControls,
|
||||
"If true, the staff of teleportation will use its original controls: R-Click for teleport to look, Shift R-Click for teleport to anchor.")
|
||||
.getBoolean(teleportStaffOriginalControls);
|
||||
|
||||
teleportStaffAction = config.get(
|
||||
sectionStaff.name,
|
||||
sectionPersonal.name,
|
||||
"teleportStaffAction",
|
||||
teleportStaffAction,
|
||||
"Sets the action for right-click with the staff of teleportation. Values:\n" + " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor (default)")
|
||||
+ " 3: Teleport to anchor, or look if no anchor (default)\n"
|
||||
+ "Overridden if teleportStaffOriginalControls is true.")
|
||||
.getInt(teleportStaffAction);
|
||||
|
||||
teleportStaffSneakAction = config.get(
|
||||
sectionStaff.name,
|
||||
"teleportStaffSneakAction",
|
||||
teleportStaffSneakAction,
|
||||
"Sets the action for sneak right-click with the staff of teleportation. Values:\n"
|
||||
+ " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look (default)\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor")
|
||||
teleportStaffSneakAction = config
|
||||
.get(
|
||||
sectionPersonal.name,
|
||||
"teleportStaffSneakAction",
|
||||
teleportStaffSneakAction,
|
||||
"Sets the action for sneak right-click with the staff of teleportation. Values:\n"
|
||||
+ " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look (default)\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor\n"
|
||||
+ "Overridden if teleportStaffOriginalControls is true.")
|
||||
.getInt(teleportStaffSneakAction);
|
||||
|
||||
enderIoRange = config.get(
|
||||
@@ -1608,14 +1628,6 @@ public final class Config {
|
||||
darkSteelApiaristArmorCost,
|
||||
"Number of levels required for the Apiarist Armor upgrade.").getInt(darkSteelApiaristArmorCost);
|
||||
|
||||
darkSteelTrackmanGogglesCost = config
|
||||
.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTrackmanGogglesCost",
|
||||
darkSteelTrackmanGogglesCost,
|
||||
"Number of levels required for the Trackman's Goggles upgrade.")
|
||||
.getInt(darkSteelTrackmanGogglesCost);
|
||||
|
||||
darkSteelTravelCost = config.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTravelCost",
|
||||
@@ -2421,6 +2433,11 @@ public final class Config {
|
||||
sectionItems.name,
|
||||
enableMEConduits,
|
||||
"Allows ME conduits. Only has an effect with AE2 installed.");
|
||||
enableMEUltraDenseConduits = config.getBoolean(
|
||||
"enableMEUltraDenseConduits",
|
||||
sectionItems.name,
|
||||
enableMEUltraDenseConduits,
|
||||
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
|
||||
enableOCConduits = config.getBoolean(
|
||||
"enableOCConduits",
|
||||
sectionItems.name,
|
||||
@@ -2743,6 +2760,22 @@ public final class Config {
|
||||
spawnGuardStopAllSquidSpawning,
|
||||
"When true no squid will be spawned.");
|
||||
|
||||
weatherObeliskClearFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskClearFluid",
|
||||
weatherObeliskClearFluid,
|
||||
"The fluid required (in mB) to set the world to clear weather").getInt();
|
||||
weatherObeliskRainFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskRainFluid",
|
||||
weatherObeliskRainFluid,
|
||||
"The fluid required (in mB) to set the world to rainy weather").getInt();
|
||||
weatherObeliskThunderFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskThunderFluid",
|
||||
weatherObeliskThunderFluid,
|
||||
"The fluid required (in mB) to set the world to thundering weather").getInt();
|
||||
|
||||
// Loot Config
|
||||
lootDarkSteel = config.getBoolean(
|
||||
"lootDarkSteel",
|
||||
@@ -2971,13 +3004,6 @@ public final class Config {
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
fusedQuartzExplosionResistance = config.getFloat(
|
||||
"fusedQuartzExplosionResistance",
|
||||
sectionMisc.name,
|
||||
fusedQuartzExplosionResistance,
|
||||
0.0f,
|
||||
Float.MAX_VALUE,
|
||||
"How blast resistant the three Fused Quartz blocks should be.");
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWrapper extends net.minecraft.inventory.Container {
|
||||
|
||||
@@ -31,8 +28,9 @@ public class ContainerWrapper extends net.minecraft.inventory.Container {
|
||||
return wrapped.getSlot(arg0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public List<ItemStack> getInventory() {
|
||||
public java.util.List getInventory() {
|
||||
return wrapped.getInventory();
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ public class GuiEnderface extends GuiScreen {
|
||||
|
||||
if (hit != null) {
|
||||
Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if (block == EnderIO.blockHyperCube) {
|
||||
if (block == EnderIO.blockHyperCube || block == EnderIO.blockCapacitorBank) {
|
||||
block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, 0, 0, 0, 0);
|
||||
} else {
|
||||
openInterface(hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, hit.hitVec);
|
||||
@@ -538,13 +538,34 @@ public class GuiEnderface extends GuiScreen {
|
||||
int h = gh;
|
||||
int left = guiLeft;
|
||||
int top = guiTop;
|
||||
int cx = left + w / 2;
|
||||
int cy = top + h / 2;
|
||||
|
||||
// black outline
|
||||
drawRect(left, top, left + w, top + h, 0xFF000000);
|
||||
left += 2;
|
||||
top += 2;
|
||||
w -= 4;
|
||||
h -= 4;
|
||||
left += 1;
|
||||
top += 1;
|
||||
w -= 2;
|
||||
h -= 2;
|
||||
|
||||
// border
|
||||
int topH = 0xFFFFFFFF;
|
||||
int botH = 0xFF555555;
|
||||
int rightH = 0xFF555555;
|
||||
int leftH = 0xFFFFFFFF;
|
||||
if (animateInX) {
|
||||
leftH = 0xFF555555;
|
||||
rightH = 0xFFFFFFFF;
|
||||
}
|
||||
if (animateInY) {
|
||||
topH = 0xFF555555;
|
||||
botH = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
left += 1;
|
||||
top += 1;
|
||||
w -= 2;
|
||||
h -= 2;
|
||||
drawRect(left, top, left + w, top + h, 0xFF00331C);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.generator.stirling.StirlingGeneratorContainer;
|
||||
import crazypants.enderio.machine.generator.stirling.TileEntityStirlingGenerator;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerBurnTime implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.FluidFuelRegister;
|
||||
import crazypants.enderio.fluid.IFluidCoolant;
|
||||
import crazypants.enderio.fluid.IFluidFuel;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerFluid implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ public class ItemConduitProbe extends Item implements IResourceTooltipProvider,
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
return false;
|
||||
}
|
||||
IConduitBundle cb = (IConduitBundle) te;
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
if (PacketConduitProbe.canCreatePacket(world, x, y, z)) {
|
||||
if (world.isRemote) {
|
||||
|
||||
@@ -133,8 +133,9 @@ public class ItemEnderFood extends ItemFood implements IResourceTooltipProvider
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (EnderFood f : EnderFood.VALUES) {
|
||||
list.add(f.getStack());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.util.BaublesUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
@@ -96,7 +96,7 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
setFull(is);
|
||||
par3List.add(is);
|
||||
@@ -108,7 +108,7 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemStack, par2EntityPlayer, list, par4);
|
||||
String str = PowerDisplayUtil.formatPower(getEnergyStored(itemStack)) + "/"
|
||||
+ PowerDisplayUtil.formatPower(getMaxEnergyStored(itemStack))
|
||||
|
||||
@@ -367,8 +367,7 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (par1ItemStack != null) {
|
||||
String mobName = getMobTypeFromStack(par1ItemStack);
|
||||
if (mobName != null) {
|
||||
|
||||
@@ -190,14 +190,18 @@ public class ItemYetaWrench extends Item
|
||||
}
|
||||
|
||||
/* IAdvancedTooltipProvider */
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
ArrayList<String> tmp = new ArrayList<String>();
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(tmp, getUnlocalizedName());
|
||||
String keyName = Keyboard.getKeyName(KeyTracker.instance.getYetaWrenchMode().getKeyCode());
|
||||
|
||||
@@ -25,19 +25,16 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketMagnetState.SlotType;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelController;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState.Type;
|
||||
import crazypants.enderio.item.darksteel.SoundDetector;
|
||||
import crazypants.enderio.item.darksteel.upgrade.JumpUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import crazypants.util.BaublesUtil;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
|
||||
public class KeyTracker {
|
||||
|
||||
@@ -57,8 +54,6 @@ public class KeyTracker {
|
||||
|
||||
private final KeyBinding gogglesKey;
|
||||
|
||||
private final KeyBinding trackmansGogglesKey;
|
||||
|
||||
private final KeyBinding yetaWrenchMode;
|
||||
|
||||
private final KeyBinding magnetKey;
|
||||
@@ -89,12 +84,6 @@ public class KeyTracker {
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(gogglesKey);
|
||||
|
||||
trackmansGogglesKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.trackmansgoggles"),
|
||||
Keyboard.KEY_NONE,
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(trackmansGogglesKey);
|
||||
|
||||
stepAssistKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.stepassist"),
|
||||
Keyboard.KEY_NONE,
|
||||
@@ -139,7 +128,6 @@ public class KeyTracker {
|
||||
handleNightVision();
|
||||
handleYetaWrench();
|
||||
handleGoggles();
|
||||
handleTrackmanGoggles();
|
||||
handleStepAssist();
|
||||
handleSpeed();
|
||||
handleJump();
|
||||
@@ -166,8 +154,7 @@ public class KeyTracker {
|
||||
if (player != null) {
|
||||
ItemStack travelItem = player.getHeldItem();
|
||||
if (travelItem == null || travelItem.getItem() == null
|
||||
|| !(travelItem.getItem() instanceof IItemOfTravel)
|
||||
|| !((IItemOfTravel) travelItem.getItem()).isActive(player, travelItem)) {
|
||||
|| !(travelItem.getItem() instanceof IItemOfTravel)) {
|
||||
travelItem = TravelController.instance.findTravelItemInInventoryOrBaubles(player);
|
||||
}
|
||||
|
||||
@@ -244,22 +231,6 @@ public class KeyTracker {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTrackmanGoggles() {
|
||||
if (trackmansGogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (!TrackmanGogglesUpgrade.isUpgradeEquipped(player)) {
|
||||
return;
|
||||
}
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
((ItemDarkSteelArmor) helmet.getItem()).incrementAura(helmet);
|
||||
IToolGoggles.displaySwitchMessage(
|
||||
Minecraft.getMinecraft().theWorld,
|
||||
Minecraft.getMinecraft().thePlayer,
|
||||
((ItemDarkSteelArmor) helmet.getItem()).getCurrentAura(helmet));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGoggles() {
|
||||
if (gogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
@@ -120,7 +120,6 @@ public class MagnetController {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Entity> selectEntitiesWithinAABB(World world, AxisAlignedBB bb) {
|
||||
List<Entity> arraylist = null;
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.NetworkPowerManager;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.power.PowerTracker;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.EnergyHandlerPI;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConduitProbe implements IMessage, IMessageHandler<PacketConduitProbe, IMessage> {
|
||||
|
||||
@@ -33,7 +33,6 @@ import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SwimUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.endergy.AlloyEndergy;
|
||||
@@ -76,9 +75,6 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(ApiaristArmorUpgrade.LEGS);
|
||||
upgrades.add(ApiaristArmorUpgrade.BOOTS);
|
||||
}
|
||||
if (Loader.isModLoaded("Railcraft")) {
|
||||
upgrades.add(TrackmanGogglesUpgrade.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -144,8 +140,8 @@ public class DarkSteelRecipeManager {
|
||||
public static int getEnchantmentRepairCost(ItemStack itemStack) {
|
||||
// derived from ContainerRepair
|
||||
int res = 0;
|
||||
Map<Integer, Integer> map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator<Integer> iter = map1.keySet().iterator();
|
||||
Map map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator iter = map1.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
int i1 = ((Integer) iter.next()).intValue();
|
||||
Enchantment enchantment = Enchantment.enchantmentsList[i1];
|
||||
@@ -186,8 +182,7 @@ public class DarkSteelRecipeManager {
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addCommonEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -195,8 +190,7 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addBasicEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -204,8 +198,7 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>();
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
@@ -35,13 +34,9 @@ import crazypants.enderio.item.darksteel.upgrade.ApiaristArmorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.NaturalistEyeUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
import mods.railcraft.common.core.RailcraftConfig;
|
||||
import mods.railcraft.common.items.ItemGoggles.GoggleAura;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -50,12 +45,11 @@ import thaumcraft.api.nodes.IRevealer;
|
||||
@InterfaceList({ @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
|
||||
@Interface(iface = "mods.railcraft.api.core.items.IToolGoggles", modid = "Railcraft"),
|
||||
@Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry"),
|
||||
@Interface(iface = "forestry.api.core.IArmorNaturalist", modid = "Forestry") })
|
||||
public class ItemDarkSteelArmor extends ItemArmor
|
||||
implements IEnergyContainerItem, ISpecialArmor, IAdvancedTooltipProvider, IDarkSteelItem, IGoggles, IRevealer,
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist, IToolGoggles {
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("darkSteel", 35, new int[] { 2, 6, 5, 2 }, 15);
|
||||
@@ -131,9 +125,10 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -168,17 +163,17 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -327,45 +322,9 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
@Override
|
||||
@Method(modid = "Forestry")
|
||||
public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee) {
|
||||
if (armor == null || !DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
if (armor == null || DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
return NaturalistEyeUpgrade.isUpgradeEquipped(player);
|
||||
}
|
||||
|
||||
// Railcraft
|
||||
|
||||
public void incrementAura(ItemStack goggles) {
|
||||
if (goggles != null && goggles.getItem() instanceof ItemDarkSteelArmor
|
||||
&& DarkSteelItems.isArmorPart(goggles.getItem(), 0)) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data == null) {
|
||||
data = new NBTTagCompound();
|
||||
goggles.setTagCompound(data);
|
||||
}
|
||||
byte aura = data.getByte("aura");
|
||||
aura++;
|
||||
if (aura >= GoggleAura.VALUES.length) aura = 0;
|
||||
data.setByte("aura", aura);
|
||||
|
||||
if (this.getCurrentAura(goggles) == GoggleAura.TRACKING && !RailcraftConfig.isTrackingAuraEnabled()) {
|
||||
incrementAura(goggles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Railcraft")
|
||||
public GoggleAura getCurrentAura(ItemStack goggles) {
|
||||
if (TrackmanGogglesUpgrade.loadFromItem(goggles) != null) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data != null) {
|
||||
return GoggleAura.VALUES[data.getByte("aura")];
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
public static ItemDarkSteelAxe create() {
|
||||
ItemDarkSteelAxe res = new ItemDarkSteelAxe();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -95,7 +96,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -187,6 +188,18 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
return usedPower;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.entityPlayer.isSneaking()
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelAxePowerUsePerDamagePointMultiHarvest)
|
||||
&& isLog(evt.block, evt.metadata)) {
|
||||
evt.newSpeed = evt.originalSpeed / Config.darkSteelAxeSpeedPenaltyMultiHarvest;
|
||||
}
|
||||
if (isEquipped(evt.entityPlayer) && evt.block.getMaterial() == Material.leaves) {
|
||||
evt.newSpeed = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float par8, float par9, float par10) {
|
||||
@@ -245,7 +258,6 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,17 +287,17 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -316,7 +328,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
public int compare(BlockCoord arg0, BlockCoord arg1) {
|
||||
int d1 = refPoint.getDistSq(arg0);
|
||||
int d2 = refPoint.getDistSq(arg1);
|
||||
return compare(d1, d2);
|
||||
return compare(d1, d1);
|
||||
}
|
||||
|
||||
// NB: Copy of Integer.compare, which i sonly in Java 1.7+
|
||||
@@ -324,19 +336,4 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
return (x < y) ? -1 : ((x == y) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.entityPlayer.isSneaking()
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelAxePowerUsePerDamagePointMultiHarvest)
|
||||
&& isLog(evt.block, evt.metadata)) {
|
||||
evt.newSpeed = evt.originalSpeed / Config.darkSteelAxeSpeedPenaltyMultiHarvest;
|
||||
}
|
||||
if (isEquipped(evt.entityPlayer) && evt.block.getMaterial() == Material.leaves) {
|
||||
evt.newSpeed = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
@@ -33,7 +34,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
@@ -60,6 +61,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
public static ItemDarkSteelPickaxe create() {
|
||||
ItemDarkSteelPickaxe res = new ItemDarkSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -81,7 +83,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -272,17 +274,17 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
|
||||
@@ -62,12 +62,13 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
public static ItemDarkSteelShears create() {
|
||||
ItemDarkSteelShears res = new ItemDarkSteelShears();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
private final EntityComparator entityComparator = new EntityComparator();
|
||||
protected final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
protected final EntityComparator entityComparator = new EntityComparator();
|
||||
protected String name;
|
||||
|
||||
protected ItemDarkSteelShears(String name) {
|
||||
@@ -91,7 +92,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -162,7 +163,6 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
|
||||
if (entity.worldObj.isRemote) {
|
||||
@@ -182,15 +182,15 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
entity.posX + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posY + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posZ + Config.darkSteelShearsEntityAreaBoostWhenPowered);
|
||||
List<IShearable> sortedTargets = new ArrayList<>(
|
||||
List<Entity> sortedTargets = new ArrayList<Entity>(
|
||||
entity.worldObj.selectEntitiesWithinAABB(IShearable.class, bb, selectShearable));
|
||||
entityComparator.refPoint = entity;
|
||||
Collections.sort((List<Entity>) (Object) sortedTargets, entityComparator);
|
||||
Collections.sort(sortedTargets, entityComparator);
|
||||
|
||||
boolean result = false;
|
||||
int maxSheep = Math.min(sortedTargets.size(), powerStored / Config.darkSteelShearsPowerUsePerDamagePoint);
|
||||
for (int i = 0; i < maxSheep; i++) {
|
||||
Entity entity2 = (Entity) sortedTargets.get(i);
|
||||
Entity entity2 = sortedTargets.get(i);
|
||||
if (entity2 instanceof EntityLivingBase
|
||||
&& super.itemInteractionForEntity(itemstack, player, (EntityLivingBase) entity2)) {
|
||||
result = true;
|
||||
@@ -201,6 +201,14 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.originalSpeed > 2.0
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelShearsPowerUsePerDamagePoint)) {
|
||||
evt.newSpeed = evt.originalSpeed * Config.darkSteelShearsEffeciencyBoostWhenPowered;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int newDamage) {
|
||||
int oldDamage = getDamage(stack);
|
||||
@@ -222,7 +230,6 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -257,17 +264,17 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -322,15 +329,4 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.originalSpeed > 2.0
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelShearsPowerUsePerDamagePoint)) {
|
||||
evt.newSpeed = evt.originalSpeed * Config.darkSteelShearsEffeciencyBoostWhenPowered;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
public static ItemDarkSteelSword create() {
|
||||
ItemDarkSteelSword res = new ItemDarkSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -116,6 +117,71 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEnderTeleport(EnderTeleportEvent evt) {
|
||||
if (evt.entityLiving.getEntityData().getBoolean("hitByDarkSteelSword")) {
|
||||
evt.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
// by the time this is called to prevent multiple head drops
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onEntityDrop(LivingDropsEvent evt) {
|
||||
|
||||
if (!(evt.source.getEntity() instanceof EntityPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) evt.source.getEntity();
|
||||
// Handle TiC weapons with beheading differently
|
||||
if (handleBeheadingWeapons(player, evt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double skullDropChance = getSkullDropChance(player, evt);
|
||||
if (player instanceof FakePlayer) {
|
||||
skullDropChance *= Config.fakePlayerSkullChance;
|
||||
}
|
||||
if (Math.random() <= skullDropChance) {
|
||||
dropSkull(evt, player);
|
||||
}
|
||||
|
||||
// Special handling for ender pear drops
|
||||
if (isEquipped(player)) {
|
||||
String name = EntityList.getEntityString(evt.entityLiving);
|
||||
if (evt.entityLiving instanceof EntityEnderman || ENDERZOO_ENDERMINY.equals(name)) {
|
||||
int numPearls = 0;
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChance) {
|
||||
numPearls++;
|
||||
}
|
||||
for (int i = 0; i < evt.lootingLevel; i++) {
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChancePerLooting) {
|
||||
numPearls++;
|
||||
}
|
||||
}
|
||||
|
||||
int existing = 0;
|
||||
for (EntityItem stack : evt.drops) {
|
||||
if (stack.getEntityItem() != null && stack.getEntityItem().getItem() == Items.ender_pearl) {
|
||||
existing += stack.getEntityItem().stackSize;
|
||||
}
|
||||
}
|
||||
int toDrop = numPearls - existing;
|
||||
if (toDrop > 0) {
|
||||
evt.drops.add(
|
||||
Util.createDrop(
|
||||
player.worldObj,
|
||||
new ItemStack(Items.ender_pearl, toDrop, 0),
|
||||
evt.entityLiving.posX,
|
||||
evt.entityLiving.posY,
|
||||
evt.entityLiving.posZ,
|
||||
false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void dropSkull(LivingDropsEvent evt, EntityPlayer player) {
|
||||
ItemStack skull = getSkullForEntity(evt.entityLiving);
|
||||
if (skull != null && !containsDrop(evt, skull)) {
|
||||
@@ -226,7 +292,6 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,17 +354,17 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -321,15 +386,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
@Override
|
||||
public boolean isActive(EntityPlayer ep, ItemStack equipped) {
|
||||
if (ep != null && equipped != null && isTravelUpgradeActive(ep, equipped)) {
|
||||
// Only "active" if held while sneaking. But still "active" for the purposes of travel keybind if not held
|
||||
if (isEquipped(ep)) {
|
||||
return ep.isSneaking();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return isTravelUpgradeActive(ep, equipped);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -343,12 +400,12 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return ep != null && equipped != null && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (isActive(player, stack)) {
|
||||
if (isTravelUpgradeActive(player, stack)) {
|
||||
if (world.isRemote) {
|
||||
if (TravelController.instance.activateTravelAccessable(stack, world, player, TravelSource.STAFF)) {
|
||||
player.swingItem();
|
||||
@@ -372,73 +429,4 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEnderTeleport(EnderTeleportEvent evt) {
|
||||
if (evt.entityLiving.getEntityData().getBoolean("hitByDarkSteelSword")) {
|
||||
evt.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
// by the time this is called to prevent multiple head drops
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onEntityDrop(LivingDropsEvent evt) {
|
||||
|
||||
if (!(evt.source.getEntity() instanceof EntityPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) evt.source.getEntity();
|
||||
// Handle TiC weapons with beheading differently
|
||||
if (handleBeheadingWeapons(player, evt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double skullDropChance = getSkullDropChance(player, evt);
|
||||
if (player instanceof FakePlayer) {
|
||||
skullDropChance *= Config.fakePlayerSkullChance;
|
||||
}
|
||||
if (Math.random() <= skullDropChance) {
|
||||
dropSkull(evt, player);
|
||||
}
|
||||
|
||||
// Special handling for ender pear drops
|
||||
if (isEquipped(player)) {
|
||||
String name = EntityList.getEntityString(evt.entityLiving);
|
||||
if (evt.entityLiving instanceof EntityEnderman || ENDERZOO_ENDERMINY.equals(name)) {
|
||||
int numPearls = 0;
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChance) {
|
||||
numPearls++;
|
||||
}
|
||||
for (int i = 0; i < evt.lootingLevel; i++) {
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChancePerLooting) {
|
||||
numPearls++;
|
||||
}
|
||||
}
|
||||
|
||||
int existing = 0;
|
||||
for (EntityItem stack : evt.drops) {
|
||||
if (stack.getEntityItem() != null && stack.getEntityItem().getItem() == Items.ender_pearl) {
|
||||
existing += stack.getEntityItem().stackSize;
|
||||
}
|
||||
}
|
||||
int toDrop = numPearls - existing;
|
||||
if (toDrop > 0) {
|
||||
evt.drops.add(
|
||||
Util.createDrop(
|
||||
player.worldObj,
|
||||
new ItemStack(Items.ender_pearl, toDrop, 0),
|
||||
evt.entityLiving.posX,
|
||||
evt.entityLiving.posY,
|
||||
evt.entityLiving.posZ,
|
||||
false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,17 +8,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem, IHazardProtector {
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("endSteel", 50, new int[] { 4, 7, 10, 5 }, 25);
|
||||
@@ -60,9 +56,10 @@ public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelIt
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -80,11 +77,4 @@ public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelIt
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
/// GT5 Hazmat protection
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
@Override
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -29,6 +30,7 @@ public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
public static ItemEndSteelAxe create() {
|
||||
ItemEndSteelAxe res = new ItemEndSteelAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -38,7 +40,7 @@ public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -29,6 +30,7 @@ public class ItemEndSteelPickaxe extends ItemDarkSteelPickaxe implements IEndSte
|
||||
public static ItemEndSteelPickaxe create() {
|
||||
ItemEndSteelPickaxe res = new ItemEndSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -38,7 +40,7 @@ public class ItemEndSteelPickaxe extends ItemDarkSteelPickaxe implements IEndSte
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -34,6 +35,7 @@ public class ItemEndSteelSword extends ItemDarkSteelSword implements IEndSteelIt
|
||||
public static ItemEndSteelSword create() {
|
||||
ItemEndSteelSword res = new ItemEndSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -43,7 +45,7 @@ public class ItemEndSteelSword extends ItemDarkSteelSword implements IEndSteelIt
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -70,8 +70,9 @@ public class ItemGliderWing extends Item implements IResourceTooltipProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -8,17 +8,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
|
||||
public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem, IHazardProtector {
|
||||
public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("stellarAlloy", 75, new int[] { 8, 14, 18, 7 }, 25);
|
||||
@@ -61,9 +57,10 @@ public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -81,11 +78,4 @@ public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
/// GT5 Hazmat protection
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
@Override
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -29,6 +30,7 @@ public class ItemStellarAxe extends ItemDarkSteelAxe implements IStellarItem {
|
||||
public static ItemStellarAxe create() {
|
||||
ItemStellarAxe res = new ItemStellarAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -38,7 +40,7 @@ public class ItemStellarAxe extends ItemDarkSteelAxe implements IStellarItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -29,6 +30,7 @@ public class ItemStellarPickaxe extends ItemDarkSteelPickaxe implements IStellar
|
||||
public static ItemStellarPickaxe create() {
|
||||
ItemStellarPickaxe res = new ItemStellarPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -38,7 +40,7 @@ public class ItemStellarPickaxe extends ItemDarkSteelPickaxe implements IStellar
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -34,6 +35,7 @@ public class ItemStellarSword extends ItemDarkSteelSword implements IStellarItem
|
||||
public static ItemStellarSword create() {
|
||||
ItemStellarSword res = new ItemStellarSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -43,7 +45,7 @@ public class ItemStellarSword extends ItemDarkSteelSword implements IStellarItem
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ public class SoundRenderer extends RenderEntity {
|
||||
|
||||
GL11.glColor4f(1, 1, 1, alpha);
|
||||
|
||||
float scale = se.lifeSpan / 20f;
|
||||
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
@@ -66,19 +66,19 @@ public abstract class AbstractUpgrade implements IDarkSteelUpgrade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
SpecialTooltipHandler.addCommonTooltipFromResources(list, getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name"));
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, getUnlocalizedName());
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class EnergyUpgrade extends AbstractUpgrade {
|
||||
|
||||
@@ -216,7 +216,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
List<String> upgradeStr = new ArrayList<String>();
|
||||
upgradeStr.add(EnumChatFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name"));
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class TrackmanGogglesUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "trackmansGoggles";
|
||||
|
||||
public static final TrackmanGogglesUpgrade INSTANCE = new TrackmanGogglesUpgrade();
|
||||
|
||||
public static ItemStack getGoggles() {
|
||||
Item i = GameRegistry.findItem("Railcraft", "armor.goggles");
|
||||
if (i != null) {
|
||||
return new ItemStack(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TrackmanGogglesUpgrade loadFromItem(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
if (stack.stackTagCompound == null) {
|
||||
return null;
|
||||
}
|
||||
if (!stack.stackTagCompound.hasKey(KEY_UPGRADE_PREFIX + UPGRADE_NAME)) {
|
||||
return null;
|
||||
}
|
||||
return new TrackmanGogglesUpgrade(
|
||||
(NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
public static boolean isUpgradeEquipped(EntityPlayer player) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return TrackmanGogglesUpgrade.loadFromItem(helmet) != null;
|
||||
}
|
||||
|
||||
public TrackmanGogglesUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public TrackmanGogglesUpgrade() {
|
||||
super(
|
||||
UPGRADE_NAME,
|
||||
"enderio.darksteel.upgrade.trackmansGoggles",
|
||||
getGoggles(),
|
||||
Config.darkSteelTrackmanGogglesCost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if (stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0) || getUpgradeItem() == null) {
|
||||
return false;
|
||||
}
|
||||
TrackmanGogglesUpgrade up = loadFromItem(stack);
|
||||
return up == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {}
|
||||
|
||||
@Override
|
||||
public ItemStack getUpgradeItem() {
|
||||
if (upgradeItem != null) {
|
||||
return upgradeItem;
|
||||
}
|
||||
upgradeItem = getGoggles();
|
||||
return upgradeItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpgradeItemName() {
|
||||
if (getUpgradeItem() == null) {
|
||||
return "Trackman's Helmet";
|
||||
}
|
||||
return super.getUpgradeItemName();
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,9 @@ public class ItemEndermanSkull extends ItemBlockWithMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < SkullType.values().length; ++j) {
|
||||
if (!SkullType.values()[j].showEyes) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
|
||||
@@ -168,8 +168,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio
|
||||
public final boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
if (slotDefinition.isUpgradeSlot(i)) {
|
||||
return itemstack != null && itemstack.getItem() == EnderIO.itemBasicCapacitor
|
||||
&& itemstack.getItemDamage() > 0
|
||||
&& itemstack.getItemDamage() != 7;
|
||||
&& itemstack.getItemDamage() > 0;
|
||||
}
|
||||
return isMachineItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@@ -221,12 +221,15 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
|
||||
|
||||
protected int mergeItemResult(ItemStack item, List<ItemStack> outputStacks) {
|
||||
|
||||
int res = 0;
|
||||
|
||||
ItemStack copy = item.copy();
|
||||
// try to add it to existing stacks first
|
||||
for (ItemStack outStack : outputStacks) {
|
||||
if (outStack != null && copy != null) {
|
||||
int num = getNumCanMerge(outStack, copy);
|
||||
outStack.stackSize += num;
|
||||
res += num;
|
||||
copy.stackSize -= num;
|
||||
if (copy.stackSize <= 0) {
|
||||
return item.stackSize;
|
||||
|
||||
@@ -28,6 +28,7 @@ import crazypants.enderio.item.skull.BlockEndermanSkull;
|
||||
import crazypants.enderio.machine.buffer.BlockItemBuffer.Type;
|
||||
import crazypants.enderio.machine.capbank.BlockItemCapBank;
|
||||
import crazypants.enderio.machine.capbank.CapBankType;
|
||||
import crazypants.enderio.machine.capbank.ConvertOldRecipe;
|
||||
import crazypants.enderio.machine.light.BlockItemElectricLight;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
@@ -342,6 +343,9 @@ public class MachineRecipes {
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
RecipeUtil.addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new UpgradeCapBankRecipe(
|
||||
capBank2,
|
||||
|
||||
@@ -25,6 +25,7 @@ public class OverlayRenderer implements IRenderFace {
|
||||
this.te = te;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y, double z,
|
||||
IIcon texture, List<Vertex> refVertices, boolean translateToXyz) {
|
||||
@@ -40,7 +41,6 @@ public class OverlayRenderer implements IRenderFace {
|
||||
Tessellator.instance.addTranslation((float) offset.x, (float) offset.y, (float) offset.z);
|
||||
|
||||
IoMode mode = te.getIoMode(face);
|
||||
@SuppressWarnings("unchecked")
|
||||
IIcon tex = ((AbstractMachineBlock<AbstractMachineEntity>) par1Block).getOverlayIconForMode(te, face, mode);
|
||||
if (tex != null) {
|
||||
ccr.getCustomRenderBlocks().setRenderBoundsFromBlock(par1Block);
|
||||
|
||||
@@ -47,10 +47,10 @@ public class TechneMachineRenderer<T extends AbstractMachineEntity> extends Tech
|
||||
super.renderInventoryBlock(block, metadata, modelId, renderer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
@SuppressWarnings("unchecked")
|
||||
T te = (T) world.getTileEntity(x, y, z);
|
||||
if (te != null) {
|
||||
setFacingDir(te.getFacingDir());
|
||||
|
||||
@@ -38,13 +38,14 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
|
||||
vanillaFurnaceTooltip = new GuiToolTip(
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 43, BUTTON_SIZE, BUTTON_SIZE),
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 62, BUTTON_SIZE, BUTTON_SIZE),
|
||||
(String[]) null);
|
||||
|
||||
addProgressTooltip(55, 35, 14, 14);
|
||||
addProgressTooltip(103, 35, 14, 14);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
@@ -102,6 +102,7 @@ public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
@Override
|
||||
public ResultStack[] getCompletedResult(float chance, MachineRecipeInput... inputs) {
|
||||
ItemStack output = null;
|
||||
int inputCount = 0;
|
||||
for (MachineRecipeInput ri : inputs) {
|
||||
if (ri != null && ri.item != null && output == null) {
|
||||
output = FurnaceRecipes.smelting().getSmeltingResult(ri.item);
|
||||
|
||||
@@ -53,9 +53,10 @@ public class BlockItemBuffer extends ItemBlockWithMetadata {
|
||||
super(block, block);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (Type type : Type.values()) {
|
||||
list.add(new ItemStack(item, 1, type.ordinal()));
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
|
||||
@@ -93,6 +93,11 @@ public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketBufferIO(getTileEntity(), lastInput, lastOutput));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean renderPowerBar() {
|
||||
return getTileEntity().hasPower();
|
||||
|
||||
@@ -49,8 +49,8 @@ import crazypants.enderio.machine.capbank.packet.PacketNetworkIdRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkIdResponse;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateResponse;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
@@ -142,7 +142,7 @@ public class BlockCapBank extends BlockEio
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List list) {
|
||||
int meta = 0;
|
||||
for (CapBankType type : CapBankType.types()) {
|
||||
if (type.isCreative()) {
|
||||
@@ -162,11 +162,11 @@ public class BlockCapBank extends BlockEio
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(
|
||||
PowerDisplayUtil.formatStoredPower(
|
||||
PowerHandlerUtil.getStoredEnergyForItem(itemstack),
|
||||
@@ -180,7 +180,7 @@ public class BlockCapBank extends BlockEio
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
}
|
||||
|
||||
@@ -523,6 +523,20 @@ public class BlockCapBank extends BlockEio
|
||||
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World w, int x, int y, int z, int side) {
|
||||
TileEntity te = w.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapBank) {
|
||||
return ((TileCapBank) te).getComparatorOutput();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package crazypants.enderio.machine.capbank;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class ConvertOldRecipe implements IRecipe {
|
||||
|
||||
static {
|
||||
RecipeSorter.register(
|
||||
"EnderIO:convertOldCapBankRecipe",
|
||||
ConvertOldRecipe.class,
|
||||
Category.SHAPELESS,
|
||||
"after:minecraft:shapeless");
|
||||
}
|
||||
|
||||
private ItemStack output;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
ItemStack input = null;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack checkStack = inv.getStackInSlot(i);
|
||||
if (checkStack != null) {
|
||||
if (input != null) {
|
||||
return false;
|
||||
}
|
||||
if (Block.getBlockFromItem(checkStack.getItem()) == EnderIO.blockCapacitorBank) {
|
||||
input = checkStack;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
output = new ItemStack(EnderIO.blockCapBank, 1, CapBankType.getMetaFromType(CapBankType.ACTIVATED));
|
||||
PowerHandlerUtil.setStoredEnergyForItem(output, PowerHandlerUtil.getStoredEnergyForItem(input));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return output.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.gui.GuiButtonIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiOverlayIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCapBank extends GuiContainerBaseEIO {
|
||||
|
||||
@@ -291,8 +291,9 @@ public class GuiCapBank extends GuiContainerBaseEIO {
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void drawHoveringText(@SuppressWarnings("rawtypes") List par1List, int par2, int par3, FontRenderer font) {
|
||||
public void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) {
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
super.drawHoveringText(par1List, par2 + 24, par3, font);
|
||||
GL11.glPopAttrib();
|
||||
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.interfaces.IComparatorOutput;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.EntityUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
@@ -47,7 +46,7 @@ import crazypants.enderio.power.IPowerStorage;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class TileCapBank extends TileEntityEio
|
||||
implements IInternalPowerReceiver, IInventory, IIoConfigurable, IPowerStorage, IComparatorOutput {
|
||||
implements IInternalPowerReceiver, IInventory, IIoConfigurable, IPowerStorage {
|
||||
|
||||
private Map<ForgeDirection, IoMode> faceModes;
|
||||
private Map<ForgeDirection, InfoDisplayType> faceDisplayTypes;
|
||||
@@ -693,10 +692,9 @@ public class TileCapBank extends TileEntityEio
|
||||
return getIoMode(from) != IoMode.DISABLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorOutput() {
|
||||
int stored = getEnergyStored();
|
||||
return stored == 0 ? 0 : 1 + (stored * 14) / getMaxEnergyStored();
|
||||
double stored = getEnergyStored();
|
||||
return stored == 0 ? 0 : (int) (1 + stored / getMaxEnergyStored() * 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -747,7 +745,7 @@ public class TileCapBank extends TileEntityEio
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return EnderIO.blockCapBank.getUnlocalizedName() + ".name";
|
||||
return EnderIO.blockCapacitorBank.getUnlocalizedName() + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ public class NetworkUtil {
|
||||
|
||||
private static AtomicInteger nextID = new AtomicInteger(0);
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static void ensureValidNetwork(TileCapBank cap) {
|
||||
World world = cap.getWorldObj();
|
||||
Collection<TileCapBank> neighbours = getNeigbours(cap);
|
||||
|
||||
Loaded 100 of 271 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user