mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 01:25:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5a2693d7c | ||
|
|
372c317077 | ||
|
|
44ee860a39 | ||
|
|
181d48ac60 | ||
|
|
267adc0a31 | ||
|
|
503a6e7a76 | ||
|
|
ff0e85142d | ||
|
|
94bd521739 | ||
|
|
e66c50bc24 | ||
|
|
d9df657f35 | ||
|
|
08553f8af2 | ||
|
|
0fe564d007 | ||
|
|
53ba0383fb | ||
|
|
2c5664ce08 | ||
|
|
da70f52b0d | ||
|
|
46644bc889 | ||
|
|
f615df5010 | ||
|
|
73891d20ff | ||
|
|
e21793245f | ||
|
|
ffe4296ef6 | ||
|
|
5083fb2a60 | ||
|
|
05ee12955d | ||
|
|
a7acc7e224 | ||
|
|
a59bb21e59 | ||
|
|
5b6c13ff0a | ||
|
|
6f8b6e2a9c | ||
|
|
479c8328b4 | ||
|
|
0c23f4937d | ||
|
|
cde2e4fa60 | ||
|
|
abbb6dc151 | ||
|
|
b3def82cde | ||
|
|
8b4e7f7ec3 | ||
|
|
d69d77ecae | ||
|
|
a233f6ba30 | ||
|
|
581150178f | ||
|
|
313a243bf5 | ||
|
|
d5f1008b08 | ||
|
|
e1e1f06dc6 | ||
|
|
aad9c092b1 | ||
|
|
f8c56939cd | ||
|
|
e2e22d6103 | ||
|
|
a798d2146d | ||
|
|
e829c4168b | ||
|
|
b1f8d99da9 | ||
|
|
304fdef5ec | ||
|
|
1f05312ded | ||
|
|
eb88b1cfe0 | ||
|
|
d4256bda6e | ||
|
|
bda8902709 | ||
|
|
63971381cc | ||
|
|
09238b09ef | ||
|
|
32556e078e | ||
|
|
ace514f628 | ||
|
|
0102b89c33 | ||
|
|
b65afde754 | ||
|
|
4a0a427186 | ||
|
|
e04e2e3411 | ||
|
|
316db4bd77 |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -28,3 +28,4 @@ whitelist.json
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
.DS_Store
|
||||
+19
-14
@@ -1,22 +1,26 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.2:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.29-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.10:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.7:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.4:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.60-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.10:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55: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.14.27-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.2:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-544-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.134:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.3:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.0-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.2-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.8-GTNH:api') {transitive = false}
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.22:dev') {transitive = false}
|
||||
runtimeOnlyNonPublishable('com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.4:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-812-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.261:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.37-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.17:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.9-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.14-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.16-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
|
||||
@@ -24,5 +28,6 @@ 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-beta33:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta66a:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.58:dev")
|
||||
}
|
||||
+43
-8
@@ -14,7 +14,7 @@ modId = EnderIO
|
||||
modGroup = crazypants.enderio
|
||||
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
@@ -39,13 +39,37 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
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 = false
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# 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 = false
|
||||
enableGenericInjection = true
|
||||
|
||||
# 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,7 +104,7 @@ 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 =
|
||||
accessTransformersFile = enderio_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
@@ -96,7 +120,9 @@ usesMixinDebug = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -151,7 +177,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: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
# Note: UniMixins 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.
|
||||
@@ -172,6 +198,12 @@ curseForgeRelations =
|
||||
# projects. New projects should not use this parameter.
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
@@ -201,3 +233,6 @@ curseForgeRelations =
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainVersion=25
|
||||
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.11.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -86,8 +86,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
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -115,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -173,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -206,15 +203,14 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_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.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.32'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,6 @@ 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.reservoir.ReservoirRenderer;
|
||||
@@ -321,13 +318,6 @@ 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);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -9,20 +7,27 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.transceiver.ServerChannelRegister;
|
||||
import crazypants.enderio.machine.wireless.WirelessChargerController;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("########0.000");
|
||||
|
||||
protected long serverTickCount = 0;
|
||||
protected long clientTickCount = 0;
|
||||
protected final TickTimer tickTimer = new TickTimer();
|
||||
public ConduitNetworkTickHandler conduitNetworkTickHandler = null;
|
||||
public WirelessChargerController wirelessChargerController = null;
|
||||
|
||||
public CommonProxy() {}
|
||||
|
||||
@@ -44,7 +49,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void loadIcons() {
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public void load() {
|
||||
@@ -76,6 +81,26 @@ public class CommonProxy {
|
||||
return new ResourceLocation(EnderIO.DOMAIN + TEXTURE_PATH + name + TEXTURE_EXT);
|
||||
}
|
||||
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
conduitNetworkTickHandler = new ConduitNetworkTickHandler();
|
||||
FMLCommonHandler.instance().bus().register(conduitNetworkTickHandler);
|
||||
wirelessChargerController = new WirelessChargerController();
|
||||
FMLCommonHandler.instance().bus().register(wirelessChargerController);
|
||||
}
|
||||
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
FMLCommonHandler.instance().bus().unregister(conduitNetworkTickHandler);
|
||||
conduitNetworkTickHandler = null;
|
||||
FMLCommonHandler.instance().bus().unregister(wirelessChargerController);
|
||||
wirelessChargerController = null;
|
||||
}
|
||||
|
||||
public final class TickTimer {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -38,6 +38,7 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -111,7 +112,6 @@ import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockEnd
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.PacketNutrientTank;
|
||||
import crazypants.enderio.machine.hypercube.BlockHyperCube;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.invpanel.BlockInventoryPanel;
|
||||
import crazypants.enderio.machine.killera.BlockKillerJoe;
|
||||
import crazypants.enderio.machine.light.BlockElectricLight;
|
||||
@@ -132,7 +132,6 @@ 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;
|
||||
@@ -182,12 +181,17 @@ 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.0.3B3,);required-after:endercore;after:MineFactoryReloaded;after:Forestry;after:Waila@[1.5.8,);after:Thaumcraft;after:appliedenergistics2@[rv2-beta-8,);after:chisel;required-after:gtnhlib@[0.2.10,)",
|
||||
guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
@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")
|
||||
public class EnderIO {
|
||||
|
||||
public static final String MODID = "EnderIO";
|
||||
@@ -208,7 +212,9 @@ 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_post");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static final boolean hasHP = Loader.isModLoaded("hodgepodge");
|
||||
public static final boolean hasWailaPlugins = Loader.isModLoaded("wailaplugins");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -280,7 +286,6 @@ 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;
|
||||
@@ -390,7 +395,6 @@ public class EnderIO {
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
blockAlloySmelter = BlockAlloySmelter.create();
|
||||
blockCapacitorBank = BlockCapacitorBank.create();
|
||||
blockCapBank = BlockCapBank.create();
|
||||
|
||||
blockPainter = BlockPainter.create();
|
||||
@@ -484,7 +488,9 @@ public class EnderIO {
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
if (!hasGT5) {
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
}
|
||||
|
||||
registerFluids();
|
||||
|
||||
@@ -724,7 +730,9 @@ public class EnderIO {
|
||||
SkeletonHandler.registerSkeleton(this);
|
||||
}
|
||||
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
if (!hasGT5) {
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
}
|
||||
|
||||
EnderfaceRecipes.addRecipes();
|
||||
MaterialRecipes.addRecipes();
|
||||
@@ -810,7 +818,6 @@ public class EnderIO {
|
||||
return Config.xpJuiceName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addModIntegration() {
|
||||
|
||||
if (Loader.isModLoaded("TConstruct")) {
|
||||
@@ -821,6 +828,7 @@ 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");
|
||||
@@ -887,22 +895,18 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
proxy.onServerAboutToStart(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
proxy.onServerStarted(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
proxy.onServerStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -914,4 +918,12 @@ public class EnderIO {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,6 @@ public enum ModObject {
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
blockCapacitorBank,
|
||||
blockCapBank,
|
||||
blockSagMill,
|
||||
blockHyperCube,
|
||||
|
||||
@@ -148,10 +148,9 @@ 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 items) {
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List<ItemStack> items) {
|
||||
items.add(new ItemStack(this, 1, 0));
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ 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);
|
||||
|
||||
@@ -47,6 +47,7 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduitNetwork;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
@@ -118,7 +119,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
return false;
|
||||
}
|
||||
if (dataRoot.hasKey("connectionMode")) {
|
||||
ConnectionMode mode = ConnectionMode.values()[dataRoot.getShort("connectionMode")];
|
||||
ConnectionMode mode = ConnectionMode.VALUES[dataRoot.getShort("connectionMode")];
|
||||
setConnectionMode(dir, mode);
|
||||
}
|
||||
readTypeSettings(dir, dataRoot);
|
||||
@@ -382,13 +383,13 @@ public abstract class AbstractConduit implements IConduit {
|
||||
conduitConnections.clear();
|
||||
int[] dirs = nbtRoot.getIntArray("connections");
|
||||
for (int i = 0; i < dirs.length; i++) {
|
||||
conduitConnections.add(ForgeDirection.values()[dirs[i]]);
|
||||
conduitConnections.add(ForgeDirections.DIRECTIONS[dirs[i]]);
|
||||
}
|
||||
|
||||
externalConnections.clear();
|
||||
dirs = nbtRoot.getIntArray("externalConnections");
|
||||
for (int i = 0; i < dirs.length; i++) {
|
||||
externalConnections.add(ForgeDirection.values()[dirs[i]]);
|
||||
externalConnections.add(ForgeDirections.DIRECTIONS[dirs[i]]);
|
||||
}
|
||||
active = nbtRoot.getBoolean("signalActive");
|
||||
|
||||
@@ -397,7 +398,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
if (modes != null && modes.length == 6) {
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
conectionModes.put(dir, ConnectionMode.values()[modes[i]]);
|
||||
conectionModes.put(dir, ConnectionMode.VALUES[modes[i]]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import java.util.List;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
// I=base type, I is the base class of the implementations accepted by the network
|
||||
public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
|
||||
@@ -64,7 +66,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
public void addConduit(I con) {
|
||||
if (!conduits.contains(con)) {
|
||||
if (conduits.isEmpty()) {
|
||||
ConduitNetworkTickHandler.instance.registerNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.registerNetwork(this);
|
||||
}
|
||||
conduits.add(con);
|
||||
}
|
||||
@@ -75,7 +77,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
con.setNetwork(null);
|
||||
}
|
||||
conduits.clear();
|
||||
ConduitNetworkTickHandler.instance.unregisterNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.unregisterNetwork(this);
|
||||
}
|
||||
|
||||
public List<I> getConduits() {
|
||||
|
||||
@@ -24,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
@@ -84,7 +85,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
ForgeDirection dir = ForgeDirection.values()[side];
|
||||
ForgeDirection dir = ForgeDirections.DIRECTIONS[side];
|
||||
int placeX = x + dir.offsetX;
|
||||
int placeY = y + dir.offsetY;
|
||||
int placeZ = z + dir.offsetZ;
|
||||
@@ -190,9 +191,8 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < subtypes.length; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -72,6 +71,7 @@ import crazypants.enderio.item.ItemConduitProbe;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import crazypants.util.IFacade;
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
@@ -93,9 +93,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
public static BlockConduitBundle create() {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(ConduitNetworkTickHandler.instance);
|
||||
FMLCommonHandler.instance().bus().register(ConduitNetworkTickHandler.instance);
|
||||
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketFluidLevel.class, PacketFluidLevel.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
@@ -160,7 +157,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
BlockConduitBundle result = new BlockConduitBundle();
|
||||
result.init();
|
||||
MinecraftForge.EVENT_BUS.register(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -292,41 +288,6 @@ 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();
|
||||
@@ -334,6 +295,7 @@ 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
|
||||
@@ -473,24 +435,6 @@ 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() {
|
||||
@@ -876,7 +820,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
return new ExternalConnectionContainer(
|
||||
player.inventory,
|
||||
(IConduitBundle) te,
|
||||
ForgeDirection.values()[id - GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE]);
|
||||
ForgeDirections.DIRECTIONS[id - GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -891,7 +835,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
return new GuiExternalConnection(
|
||||
player.inventory,
|
||||
(IConduitBundle) te,
|
||||
ForgeDirection.values()[id - GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE]);
|
||||
ForgeDirections.DIRECTIONS[id - GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -923,7 +867,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb,
|
||||
@SuppressWarnings("rawtypes") List arraylist, Entity par7Entity) {
|
||||
List<AxisAlignedBB> arraylist, Entity par7Entity) {
|
||||
|
||||
if (MicroblocksUtil.supportMicroblocks()) {
|
||||
IM__addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, par7Entity);
|
||||
@@ -1261,9 +1205,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return IMultipartSystem.instance.hook_collisionRayTrace(cur, world, x, y, z, src, dst);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
|
||||
Entity entity) {
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask,
|
||||
List<AxisAlignedBB> list, Entity entity) {
|
||||
IMultipartSystem.instance.hook_addCollisionBoxesToList(world, x, y, z, mask, list, entity);
|
||||
}
|
||||
|
||||
@@ -1275,4 +1218,61 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,18 +10,15 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public class ConduitNetworkTickHandler {
|
||||
|
||||
public static final ConduitNetworkTickHandler instance = new ConduitNetworkTickHandler();
|
||||
public interface TickListener {
|
||||
|
||||
public static interface TickListener {
|
||||
void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
}
|
||||
|
||||
private final List<TickListener> listeners = new ArrayList<TickListener>();
|
||||
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
private final List<TickListener> listeners = new ArrayList<>();
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<>();
|
||||
|
||||
public void addListener(TickListener listener) {
|
||||
listeners.add(listener);
|
||||
|
||||
@@ -688,7 +688,7 @@ public class ConduitRecipes {
|
||||
String fluix = "crystalFluix";
|
||||
String pureFluix = "crystalPureFluix";
|
||||
|
||||
ItemStack quartzFiber = AEApi.instance().parts().partQuartzFiber.stack(1).copy();
|
||||
ItemStack quartzFiber = AEApi.instance().definitions().parts().quartzFiber().maybeStack(1).get().copy();
|
||||
ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
|
||||
ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ConduitUtil {
|
||||
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void ensureValidNetwork(IConduit conduit) {
|
||||
TileEntity te = conduit.getBundle().getEntity();
|
||||
World world = te.getWorldObj();
|
||||
@@ -54,13 +54,15 @@ public class ConduitUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork res = conduit.createNetworkForType();
|
||||
res.init(conduit.getBundle(), connections, world);
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings("unchecked")
|
||||
private static boolean reuseNetwork(IConduit con, Collection<? extends IConduit> connections, World world) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork network = null;
|
||||
for (IConduit conduit : connections) {
|
||||
if (network == null) {
|
||||
|
||||
@@ -10,6 +10,10 @@ public enum ConnectionMode {
|
||||
DISABLED("gui.conduit.ioMode.disabled"),
|
||||
NOT_SET("gui.conduit.ioMode.notSet");
|
||||
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
public static final ConnectionMode[] VALUES = values();
|
||||
private final String unlocalisedName;
|
||||
|
||||
ConnectionMode(String unlocalisedName) {
|
||||
@@ -22,19 +26,19 @@ public enum ConnectionMode {
|
||||
|
||||
public static ConnectionMode getNext(ConnectionMode mode) {
|
||||
int ord = mode.ordinal() + 1;
|
||||
if (ord >= ConnectionMode.values().length) {
|
||||
if (ord >= ConnectionMode.VALUES.length) {
|
||||
ord = 0;
|
||||
}
|
||||
return ConnectionMode.values()[ord];
|
||||
return ConnectionMode.VALUES[ord];
|
||||
}
|
||||
|
||||
public static ConnectionMode getPrevious(ConnectionMode mode) {
|
||||
|
||||
int ord = mode.ordinal() - 1;
|
||||
if (ord < 0) {
|
||||
ord = ConnectionMode.values().length - 1;
|
||||
ord = ConnectionMode.VALUES.length - 1;
|
||||
}
|
||||
return ConnectionMode.values()[ord];
|
||||
return ConnectionMode.VALUES[ord];
|
||||
}
|
||||
|
||||
public boolean acceptsInput() {
|
||||
|
||||
@@ -51,6 +51,7 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
@@ -412,7 +413,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
// If you're wondering why I am not using conduit.writeToNBT, it is because there is some data that should not
|
||||
// persist, some of which causes crashes with energy conduits.
|
||||
NBTTagCompound[] originalData = new NBTTagCompound[ForgeDirection.values().length];
|
||||
NBTTagCompound[] originalData = new NBTTagCompound[ForgeDirections.DIRECTIONS.length];
|
||||
for (ForgeDirection conduitConnection : original.getExternalConnections()) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
original.writeConnectionSettingsToNBT(conduitConnection, tag);
|
||||
@@ -423,7 +424,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
for (int i = 0; i < originalData.length; i++) {
|
||||
NBTTagCompound nbt = originalData[i];
|
||||
if (nbt != null) {
|
||||
replacement.readConduitSettingsFromNBT(ForgeDirection.values()[i], nbt);
|
||||
replacement.readConduitSettingsFromNBT(ForgeDirections.DIRECTIONS[i], nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -542,6 +543,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addConnectors(List<CollidableComponent> result) {
|
||||
|
||||
if (conduits.isEmpty()) {
|
||||
@@ -965,7 +967,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
return (IGridNode) node;
|
||||
}
|
||||
|
||||
@SuppressWarnings("cast")
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void setGridNode(Object node) {
|
||||
|
||||
@@ -109,7 +109,6 @@ public class BlockConduitFacade extends BlockEio implements IPaintedBlock, Clone
|
||||
}
|
||||
|
||||
Block block = cb.getFacadeId();
|
||||
int meta = cb.getFacadeMetadata();
|
||||
if (block == null || block == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,10 +32,11 @@ import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.util.ForgeDirections;
|
||||
|
||||
public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider, IResourceTooltipProvider {
|
||||
|
||||
public static enum FacadeType {
|
||||
public enum FacadeType {
|
||||
|
||||
BASIC,
|
||||
HARDENED;
|
||||
@@ -65,10 +66,9 @@ 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 list) {
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List<ItemStack> list) {
|
||||
for (FacadeType t : FacadeType.values()) {
|
||||
list.add(new ItemStack(item, 1, t.ordinal()));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return true;
|
||||
}
|
||||
|
||||
ForgeDirection dir = ForgeDirection.values()[side];
|
||||
ForgeDirection dir = ForgeDirections.DIRECTIONS[side];
|
||||
int placeX = x + dir.offsetX;
|
||||
int placeY = y + dir.offsetY;
|
||||
int placeZ = z + dir.offsetZ;
|
||||
@@ -171,10 +171,9 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
super.addInformation(item, par2EntityPlayer, list, par4);
|
||||
}
|
||||
|
||||
@@ -183,15 +182,13 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (PainterUtil.getSourceBlock(itemstack) == null) {
|
||||
list.add(EnderIO.lang.localize("item.itemConduitFacade.tooltip.notpainted"));
|
||||
} else {
|
||||
@@ -199,10 +196,9 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
if (itemstack.getItemDamage() == FacadeType.HARDENED.ordinal()) {
|
||||
list.add("");
|
||||
|
||||
@@ -193,8 +193,8 @@ public abstract class AbstractGasConduit extends AbstractConduit implements IGas
|
||||
key = "extSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
extractionColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
extractionColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ 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;
|
||||
@@ -88,7 +87,6 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -103,7 +101,6 @@ 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 list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
String gpt = " " + EnderIO.lang.localize("gas.gasTick");
|
||||
int extractRate = Config.gasConduitExtractRate;
|
||||
int maxIo = Config.gasConduitMaxIoRate;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GasSettings extends BaseSettingsPanel {
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id == ID_COLOR_BUTTON) {
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.values()[colorB.getColorIndex()]);
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.VALUES[colorB.getColorIndex()]);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit, gui.getDir()));
|
||||
}
|
||||
}
|
||||
@@ -103,8 +103,6 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.ForgeDirections;
|
||||
|
||||
public class GuiExternalConnectionSelector extends GuiScreen {
|
||||
|
||||
@@ -51,7 +52,7 @@ public class GuiExternalConnectionSelector extends GuiScreen {
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
ForgeDirection dir = ForgeDirection.values()[b.id];
|
||||
ForgeDirection dir = ForgeDirections.DIRECTIONS[b.id];
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
BlockCoord loc = cb.getLocation();
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketOpenConduitUI(cb.getEntity(), dir));
|
||||
|
||||
@@ -172,7 +172,7 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id == ID_COLOR_BUTTON) {
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.values()[colorB.getColorIndex()]);
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.VALUES[colorB.getColorIndex()]);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit, gui.getDir()));
|
||||
} else if (guiButton.id == ID_INSERT_WHITELIST || guiButton.id == ID_EXTRACT_WHITELIST) {
|
||||
toggleBlacklist(guiButton.id == ID_EXTRACT_WHITELIST);
|
||||
@@ -180,7 +180,7 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
ColorButton btn = (ColorButton) guiButton;
|
||||
if (isEnder) {
|
||||
|
||||
DyeColor col = DyeColor.values()[btn.getColorIndex()];
|
||||
DyeColor col = DyeColor.VALUES[btn.getColorIndex()];
|
||||
boolean isInput = guiButton.id == ID_EXTRACT_CHANNEL;
|
||||
|
||||
if (isInput) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class OCSettings extends BaseSettingsPanel {
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id == ID_COLOR_BUTTON && cb != null) {
|
||||
occon.setSignalColor(gui.getDir(), DyeColor.values()[cb.getColorIndex()]);
|
||||
occon.setSignalColor(gui.getDir(), DyeColor.VALUES[cb.getColorIndex()]);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketOCConduitSignalColor(occon, gui.getDir()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
@@ -42,9 +43,9 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
isInput = buf.readBoolean();
|
||||
channel = DyeColor.values()[buf.readShort()];
|
||||
channel = DyeColor.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import crazypants.enderio.conduit.liquid.FluidFilter;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
@@ -44,7 +45,7 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
isInput = buf.readBoolean();
|
||||
NBTTagCompound tag = ByteBufUtils.readTag(buf);
|
||||
filter = new FluidFilter();
|
||||
|
||||
@@ -11,6 +11,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketOpenConduitUI extends MessageTileEntity<TileEntity>
|
||||
@@ -34,7 +35,7 @@ public class PacketOpenConduitUI extends MessageTileEntity<TileEntity>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
}
|
||||
|
||||
public IMessage onMessage(PacketOpenConduitUI message, MessageContext ctx) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PowerSettings extends BaseSettingsPanel {
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id == ID_COLOR_BUTTON) {
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.values()[colorB.getColorIndex()]);
|
||||
conduit.setExtractionSignalColor(gui.getDir(), DyeColor.VALUES[colorB.getColorIndex()]);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit, gui.getDir()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class RedstoneSettings extends BaseSettingsPanel {
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id == ID_COLOR_BUTTON && cb != null) {
|
||||
insCon.setSignalColor(gui.getDir(), DyeColor.values()[cb.getColorIndex()]);
|
||||
insCon.setSignalColor(gui.getDir(), DyeColor.VALUES[cb.getColorIndex()]);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketRedstoneConduitSignalColor(insCon, gui.getDir()));
|
||||
} else if (guiButton.id == ID_STRONG_BUTTON && strongCB != null) {
|
||||
insCon.setOutputStrength(gui.getDir(), strongCB.isSelected());
|
||||
|
||||
@@ -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() {
|
||||
|
||||
+12
-4
@@ -14,17 +14,25 @@ import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
import crazypants.enderio.conduit.item.filter.ExistingItemFilter;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IItemConduit>
|
||||
implements IMessageHandler<PacketExistingItemFilterSnapshot, IMessage> {
|
||||
|
||||
public static enum Opcode {
|
||||
public enum Opcode {
|
||||
|
||||
CLEAR,
|
||||
SET,
|
||||
MERGE,
|
||||
SET_BLACK,
|
||||
UNSET_BLACK
|
||||
UNSET_BLACK;
|
||||
|
||||
private static final Opcode[] VALUES = values();
|
||||
|
||||
public static Opcode fromOrdinal(int ordinal) {
|
||||
return VALUES[ordinal];
|
||||
}
|
||||
}
|
||||
|
||||
private ForgeDirection dir;
|
||||
@@ -43,9 +51,9 @@ public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IIte
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
isInput = buf.readBoolean();
|
||||
opcode = Opcode.values()[buf.readByte() & 255];
|
||||
opcode = Opcode.fromOrdinal(buf.readByte() & 255);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.ModItemFilter;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketModItemFilter extends AbstractConduitPacket<IItemConduit>
|
||||
@@ -33,7 +34,7 @@ public class PacketModItemFilter extends AbstractConduitPacket<IItemConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
isInput = buf.readBoolean();
|
||||
index = buf.readInt();
|
||||
boolean isNull = buf.readBoolean();
|
||||
|
||||
@@ -164,10 +164,10 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
setInputColor(dir, DyeColor.values()[dataRoot.getShort("inputColor")]);
|
||||
setOutputColor(dir, DyeColor.values()[dataRoot.getShort("outputColor")]);
|
||||
setInputColor(dir, DyeColor.VALUES[dataRoot.getShort("inputColor")]);
|
||||
setOutputColor(dir, DyeColor.VALUES[dataRoot.getShort("outputColor")]);
|
||||
setSelfFeedEnabled(dir, dataRoot.getBoolean("selfFeed"));
|
||||
setRoundRobinEnabled(dir, dataRoot.getBoolean("roundRobin"));
|
||||
setOutputPriority(dir, dataRoot.getInteger("outputPriority"));
|
||||
@@ -857,8 +857,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
key = "extSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
extractionColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
extractionColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
key = "selfFeed." + dir.name();
|
||||
@@ -882,16 +882,16 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
key = "inSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
inputColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
inputColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
outputColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
outputColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,9 +64,8 @@ public class ItemExtractSpeedUpgrade extends Item implements IResourceTooltipPro
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -64,9 +64,8 @@ public class ItemFunctionUpgrade extends Item implements IResourceTooltipProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -25,6 +24,7 @@ import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilterLimited;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.invpanel.TileInventoryPanel;
|
||||
import crazypants.util.ForgeDirections;
|
||||
|
||||
public class NetworkedInventory {
|
||||
|
||||
@@ -41,8 +41,8 @@ public class NetworkedInventory {
|
||||
|
||||
int tickDeficit;
|
||||
|
||||
// work around for a vanilla chest changing into a double chest without doing unneeded checks all the time
|
||||
boolean recheckInv = false;
|
||||
private TileEntity connectedTileEntity;
|
||||
|
||||
// Hack for TiC crafting station not working correctly when setting output slot to null
|
||||
boolean ticHack = false;
|
||||
|
||||
@@ -61,19 +61,13 @@ public class NetworkedInventory {
|
||||
this.location = location;
|
||||
world = con.getBundle().getWorld();
|
||||
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (te.getClass().getName().equals("tconstruct.tools.logic.CraftingStationLogic")) {
|
||||
ticHack = true;
|
||||
} else if (te.getClass().getName().contains("cpw.mods.ironchest")) {
|
||||
recheckInv = true;
|
||||
} else if (te instanceof TileEntityChest) {
|
||||
recheckInv = true;
|
||||
} else if (te instanceof TileInventoryPanel) {
|
||||
inventoryPanel = true;
|
||||
}
|
||||
updateInventory();
|
||||
}
|
||||
|
||||
public boolean isInvalid() {
|
||||
return connectedTileEntity == null || connectedTileEntity.isInvalid();
|
||||
}
|
||||
|
||||
public boolean hasTarget(IItemConduit conduit, ForgeDirection dir) {
|
||||
for (Target t : sendPriority) {
|
||||
if (t.inv.con == conduit && t.inv.conDir == dir) {
|
||||
@@ -110,6 +104,13 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
if (isInvalid()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (tickDeficit > 0 || !canExtract() || !con.isExtractionRedstoneConditionMet(conDir)) {
|
||||
// do nothing
|
||||
} else {
|
||||
@@ -144,11 +145,6 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
private boolean transferItems() {
|
||||
|
||||
if (recheckInv) {
|
||||
updateInventory();
|
||||
}
|
||||
|
||||
int[] slotIndices = getInventory().getAccessibleSlotsFromSide(inventorySide);
|
||||
if (slotIndices == null) {
|
||||
return false;
|
||||
@@ -257,9 +253,6 @@ public class NetworkedInventory {
|
||||
matchedStickyInput = of != null && of.isValid() && of.doesItemPassFilter(this, toExtract);
|
||||
}
|
||||
if (target.stickyInput || !matchedStickyInput) {
|
||||
if (target.inv.recheckInv) {
|
||||
target.inv.updateInventory();
|
||||
}
|
||||
int inserted = target.inv.insertItem(toExtract);
|
||||
if (inserted > 0) {
|
||||
toExtract.stackSize -= inserted;
|
||||
@@ -281,15 +274,38 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public final void updateInventory() {
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (te instanceof ISidedInventory) {
|
||||
inv = (ISidedInventory) te;
|
||||
} else if (te instanceof IInventory) {
|
||||
inv = new InventoryWrapper((IInventory) te);
|
||||
TileEntity newTe = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (newTe != connectedTileEntity) {
|
||||
connectedTileEntity = newTe;
|
||||
ticHack = false;
|
||||
inventoryPanel = false;
|
||||
if (connectedTileEntity != null) {
|
||||
if (connectedTileEntity.getClass().getName().equals("tconstruct.tools.logic.CraftingStationLogic")) {
|
||||
ticHack = true;
|
||||
} else if (connectedTileEntity instanceof TileInventoryPanel) {
|
||||
inventoryPanel = true;
|
||||
}
|
||||
}
|
||||
network.routesChanged();
|
||||
}
|
||||
|
||||
if (connectedTileEntity instanceof ISidedInventory) {
|
||||
inv = (ISidedInventory) connectedTileEntity;
|
||||
} else if (connectedTileEntity instanceof IInventory) {
|
||||
inv = new InventoryWrapper((IInventory) connectedTileEntity);
|
||||
} else {
|
||||
inv = null;
|
||||
}
|
||||
}
|
||||
|
||||
private int insertItem(ItemStack item) {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
if (isInvalid()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!canInsert() || item == null) {
|
||||
return 0;
|
||||
}
|
||||
@@ -312,7 +328,7 @@ public class NetworkedInventory {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return ItemUtil.doInsertItem(getInventory(), item, ForgeDirection.values()[inventorySide]);
|
||||
return ItemUtil.doInsertItem(getInventory(), item, ForgeDirections.DIRECTIONS[inventorySide]);
|
||||
}
|
||||
|
||||
void updateInsertOrder() {
|
||||
@@ -410,7 +426,7 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public ISidedInventory getInventoryRecheck() {
|
||||
if (recheckInv) {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
}
|
||||
return inv;
|
||||
|
||||
@@ -82,9 +82,8 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
@@ -92,7 +91,8 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (!SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnderIO.lang.localize("itemConduitFilterUpgrade"));
|
||||
|
||||
@@ -89,7 +89,8 @@ public class ItemExistingItemFilter extends Item implements IItemFilterUpgrade,
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -91,11 +91,10 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return doesItemPassFilter(item);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SimplifiableConditionalExpression")
|
||||
public boolean doesItemPassFilter(ItemStack item) {
|
||||
boolean allow = isValid() && itemMatched(item);
|
||||
|
||||
return isBlacklist ? !allow : allow;
|
||||
return isBlacklist ^ allow;
|
||||
}
|
||||
|
||||
protected boolean itemMatched(ItemStack item) {
|
||||
|
||||
@@ -60,7 +60,8 @@ public class ItemLimitedItemFilter extends Item implements IItemFilterUpgrade, I
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -60,7 +60,8 @@ public class ItemModItemFilter extends Item implements IItemFilterUpgrade, IReso
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.IntSupplier;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -89,20 +89,20 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
|
||||
STELLAR(() -> Config.stellarEnderFluidConduitExtractRate, () -> Config.stellarEnderFluidConduitMaxIoRate);
|
||||
|
||||
private final Supplier<Integer> getMaxExtractPerTick;
|
||||
private final Supplier<Integer> getMaxIoPerTick;
|
||||
private final IntSupplier getMaxExtractPerTick;
|
||||
private final IntSupplier getMaxIoPerTick;
|
||||
|
||||
Type(Supplier<Integer> getMaxExtractPerTick, Supplier<Integer> getMaxIoPerTick) {
|
||||
Type(IntSupplier getMaxExtractPerTick, IntSupplier getMaxIoPerTick) {
|
||||
this.getMaxExtractPerTick = getMaxExtractPerTick;
|
||||
this.getMaxIoPerTick = getMaxIoPerTick;
|
||||
}
|
||||
|
||||
public int getMaxExtractPerTick() {
|
||||
return getMaxExtractPerTick.get();
|
||||
return getMaxExtractPerTick.getAsInt();
|
||||
}
|
||||
|
||||
public int getMaxIoPerTick() {
|
||||
return getMaxIoPerTick.get();
|
||||
return getMaxIoPerTick.getAsInt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,6 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
}
|
||||
@@ -425,10 +424,10 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
super.readTypeSettings(dir, dataRoot);
|
||||
|
||||
if (dataRoot.hasKey("inputColor")) {
|
||||
setInputColor(dir, DyeColor.values()[dataRoot.getShort("inputColor")]);
|
||||
setInputColor(dir, DyeColor.VALUES[dataRoot.getShort("inputColor")]);
|
||||
}
|
||||
if (dataRoot.hasKey("outputColor")) {
|
||||
setOutputColor(dir, DyeColor.values()[dataRoot.getShort("outputColor")]);
|
||||
setOutputColor(dir, DyeColor.VALUES[dataRoot.getShort("outputColor")]);
|
||||
}
|
||||
|
||||
if (dataRoot.hasKey("roundRobin")) {
|
||||
@@ -543,16 +542,16 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
key = "inSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
inputColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
inputColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
outputColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
outputColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@@ -248,8 +248,8 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
key = "extSC." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
extractionColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
extractionColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ 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;
|
||||
@@ -92,7 +91,6 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
// Extraction can happen on extract mode or in/out mode
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
@@ -108,7 +106,6 @@ 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.getFluidID(), used);
|
||||
FluidStack drained = new FluidStack(fluid.getFluid(), used);
|
||||
|
||||
if (fluid.amount < 0) {
|
||||
fluid.amount = 0;
|
||||
|
||||
@@ -85,11 +85,13 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tank.externalTank.getTankInfo(conDir.getOpposite()) != null) {
|
||||
for (FluidTankInfo tankInfo : tank.externalTank.getTankInfo(conDir.getOpposite())) {
|
||||
FluidTankInfo[] tankInfos = tank.externalTank.getTankInfo(conDir.getOpposite());
|
||||
if (tankInfos != null) {
|
||||
for (FluidTankInfo tankInfo : tankInfos) {
|
||||
if (tankInfo == null || tankInfo.fluid == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FluidStack tryDrain = tankInfo.fluid.copy();
|
||||
tryDrain.amount = type.getMaxExtractPerTick();
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, false);
|
||||
@@ -98,10 +100,12 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
|| !tryDrain.isFluidEqual(drained)) {
|
||||
continue;
|
||||
}
|
||||
int amountAccepted = fillFrom(tank, drained.copy(), true);
|
||||
|
||||
int amountAccepted = fillFrom(tank, drained, true);
|
||||
if (amountAccepted <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tryDrain.amount = amountAccepted;
|
||||
drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, true);
|
||||
if (drained == null || drained.amount <= 0) {
|
||||
@@ -115,7 +119,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
if (drained == null || drained.amount <= 0 || !matchedFilter(drained, con, conDir, true)) {
|
||||
return false;
|
||||
}
|
||||
int amountAccepted = fillFrom(tank, drained.copy(), true);
|
||||
int amountAccepted = fillFrom(tank, drained, true);
|
||||
if (amountAccepted <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -147,7 +151,6 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
resource = resource.copy();
|
||||
resource.amount = Math.min(resource.amount, type.getMaxIoPerTick());
|
||||
int filled = 0;
|
||||
int remaining = resource.amount;
|
||||
// TODO: Only change starting pos of iterator is doFill is true so a false then true returns the same
|
||||
|
||||
TankIterator iterator;
|
||||
@@ -158,13 +161,13 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
&& target.acceptsOuput
|
||||
&& target.isValid()
|
||||
&& matchedFilter(resource, target.con, target.conDir, false)) {
|
||||
int vol = target.externalTank.fill(target.tankDir, resource.copy(), doFill);
|
||||
remaining -= vol;
|
||||
// Use reused FluidStack instead of copying each iteration
|
||||
int vol = target.externalTank.fill(target.tankDir, resource, doFill);
|
||||
resource.amount -= vol;
|
||||
filled += vol;
|
||||
if (remaining <= 0) {
|
||||
if (resource.amount <= 0) {
|
||||
break;
|
||||
}
|
||||
resource.amount = remaining;
|
||||
}
|
||||
}
|
||||
if (!tank.con.isRoundRobin(tank.conDir)) iterator.rewind();
|
||||
|
||||
@@ -77,15 +77,15 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
int extractRate;
|
||||
int maxIo;
|
||||
|
||||
|
||||
@@ -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,13 +279,11 @@ 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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setSignalColor(dir, DyeColor.values()[dataRoot.getShort("signalColor")]);
|
||||
setSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("signalColor")]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,7 +148,7 @@ public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (cols[i] >= 0) {
|
||||
signalColors.put(dir, DyeColor.values()[cols[i]]);
|
||||
signalColors.put(dir, DyeColor.VALUES[cols[i]]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
BlockCoord bc = getLocation();
|
||||
if (network != null) {
|
||||
boolean noconnections = true;
|
||||
for (DyeColor color : DyeColor.values()) {
|
||||
for (DyeColor color : DyeColor.VALUES) {
|
||||
if (node(color).neighbors().iterator().hasNext()) {
|
||||
noconnections = false;
|
||||
ChatComponentText coltxt = new ChatComponentText(color.getLocalisedName());
|
||||
@@ -350,7 +350,7 @@ public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
if (loc != null && network != null) {
|
||||
World world = getBundle().getWorld();
|
||||
EnumSet<ForgeDirection> conns = getConnections();
|
||||
for (DyeColor color : DyeColor.values()) {
|
||||
for (DyeColor color : DyeColor.VALUES) {
|
||||
Set<Node> should = new HashSet<Node>();
|
||||
for (ForgeDirection direction : conns) {
|
||||
if (getSignalColor(direction) == color) {
|
||||
|
||||
@@ -16,11 +16,11 @@ import li.cil.oc.api.network.Visibility;
|
||||
@Interface(iface = "li.cil.oc.api.network.ManagedEnvironment", modid = "OpenComputersAPI|Network")
|
||||
public class OCConduitNetwork extends AbstractConduitNetwork<IOCConduit, IOCConduit> implements ManagedEnvironment {
|
||||
|
||||
private Node[] node = new Node[DyeColor.values().length];
|
||||
private final Node[] node = new Node[DyeColor.VALUES.length];
|
||||
|
||||
public OCConduitNetwork() {
|
||||
super(IOCConduit.class, IOCConduit.class);
|
||||
for (DyeColor dyeColor : DyeColor.values()) {
|
||||
for (DyeColor dyeColor : DyeColor.VALUES) {
|
||||
node[dyeColor.ordinal()] = Network.newNode(this, Visibility.Network).create();
|
||||
Network.joinNewNetwork(node[dyeColor.ordinal()]);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class OCConduitNetwork extends AbstractConduitNetwork<IOCConduit, IOCCond
|
||||
|
||||
@Override
|
||||
public void destroyNetwork() {
|
||||
for (DyeColor dyeColor : DyeColor.values()) {
|
||||
for (DyeColor dyeColor : DyeColor.VALUES) {
|
||||
node[dyeColor.ordinal()].remove();
|
||||
}
|
||||
super.destroyNetwork();
|
||||
|
||||
@@ -8,6 +8,7 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConnectionMode extends AbstractConduitPacket<IConduit>
|
||||
@@ -34,8 +35,8 @@ public class PacketConnectionMode extends AbstractConduitPacket<IConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
mode = ConnectionMode.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
mode = ConnectionMode.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketExtractMode extends AbstractConduitPacket<IExtractor>
|
||||
@@ -38,9 +39,9 @@ public class PacketExtractMode extends AbstractConduitPacket<IExtractor>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
mode = RedstoneControlMode.values()[buf.readShort()];
|
||||
color = DyeColor.values()[buf.readShort()];
|
||||
color = DyeColor.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.item.FilterRegister;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketItemConduitFilter extends AbstractConduitPacket<IItemConduit>
|
||||
@@ -56,12 +57,12 @@ public class PacketItemConduitFilter extends AbstractConduitPacket<IItemConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
loopMode = buf.readBoolean();
|
||||
roundRobin = buf.readBoolean();
|
||||
priority = buf.readInt();
|
||||
colIn = DyeColor.values()[buf.readShort()];
|
||||
colOut = DyeColor.values()[buf.readShort()];
|
||||
colIn = DyeColor.VALUES[buf.readShort()];
|
||||
colOut = DyeColor.VALUES[buf.readShort()];
|
||||
inputFilter = FilterRegister.readFilter(buf);
|
||||
outputFilter = FilterRegister.readFilter(buf);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.oc.IOCConduit;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketOCConduitSignalColor extends AbstractConduitPacket<IOCConduit>
|
||||
@@ -34,8 +35,8 @@ public class PacketOCConduitSignalColor extends AbstractConduitPacket<IOCConduit
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
col = DyeColor.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
col = DyeColor.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketRedstoneConduitOutputStrength extends AbstractConduitPacket<IInsulatedRedstoneConduit>
|
||||
@@ -32,7 +33,7 @@ public class PacketRedstoneConduitOutputStrength extends AbstractConduitPacket<I
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
isStrong = buf.readBoolean();
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketRedstoneConduitSignalColor extends AbstractConduitPacket<IInsulatedRedstoneConduit>
|
||||
@@ -34,8 +35,8 @@ public class PacketRedstoneConduitSignalColor extends AbstractConduitPacket<IIns
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
col = DyeColor.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
col = DyeColor.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.util.ForgeDirections;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
@@ -33,7 +34,7 @@ public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readShort()];
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
roundRobin = buf.readBoolean();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -266,7 +266,6 @@ 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
|
||||
@@ -276,7 +275,6 @@ 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) {
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
PacketConduitProbe.sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if (col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
@@ -210,7 +210,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@@ -262,8 +262,8 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
key = "pRsCol." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
rsColors.put(dir, DyeColor.values()[ord]);
|
||||
if (ord >= 0 && ord < DyeColor.VALUES.length) {
|
||||
rsColors.put(dir, DyeColor.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,6 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if (mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
@@ -298,10 +297,12 @@ 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 = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ 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 list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -242,7 +242,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setSignalColor(dir, DyeColor.values()[dataRoot.getShort("signalColor")]);
|
||||
setSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("signalColor")]);
|
||||
setOutputStrength(dir, dataRoot.getBoolean("signalStrong"));
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (modes[i] >= 0) {
|
||||
forcedConnections.put(dir, ConnectionMode.values()[modes[i]]);
|
||||
forcedConnections.put(dir, ConnectionMode.VALUES[modes[i]]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -595,7 +595,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (cols[i] >= 0) {
|
||||
signalColors.put(dir, DyeColor.values()[cols[i]]);
|
||||
signalColors.put(dir, DyeColor.VALUES[cols[i]]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -72,10 +72,9 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
|
||||
protected boolean neighbourDirty = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public RedstoneConduit() {
|
||||
for (ForgeDirection ignored : ForgeDirection.VALID_DIRECTIONS) {
|
||||
externalSignals.add(new HashSet<Signal>());
|
||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||
externalSignals.add(new HashSet<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class SignalSource {
|
||||
for (int i = 0; i < enc.length; i += 5) {
|
||||
// Signal sig = new Signal(enc[i], enc[i + 1], enc[i + 2], enc[i + 3], ForgeDirection.UNKNOWN,14,
|
||||
// SignalColor.values()[enc[i + 4]]);
|
||||
// result.add(new SignalSource(sig, ForgeDirection.values()[enc[i + 4]]));
|
||||
// result.add(new SignalSource(sig, ForgeDirections.DIRECTIONS[enc[i + 4]]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ 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");
|
||||
@@ -285,6 +284,8 @@ public final class Config {
|
||||
|
||||
public static int darkSteelApiaristArmorCost = 10;
|
||||
|
||||
public static int darkSteelTrackmanGogglesCost = 10;
|
||||
|
||||
public static int darkSteelSwimCost = 10;
|
||||
|
||||
public static int darkSteelNightVisionCost = 10;
|
||||
@@ -542,10 +543,6 @@ 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;
|
||||
@@ -598,6 +595,8 @@ 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);
|
||||
@@ -1609,6 +1608,14 @@ 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",
|
||||
@@ -2736,22 +2743,6 @@ 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",
|
||||
@@ -2980,6 +2971,13 @@ 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,6 +1,9 @@
|
||||
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 {
|
||||
|
||||
@@ -28,9 +31,8 @@ public class ContainerWrapper extends net.minecraft.inventory.Container {
|
||||
return wrapped.getSlot(arg0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public java.util.List getInventory() {
|
||||
public List<ItemStack> 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 || block == EnderIO.blockCapacitorBank) {
|
||||
if (block == EnderIO.blockHyperCube) {
|
||||
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,34 +538,13 @@ 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 += 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;
|
||||
left += 2;
|
||||
top += 2;
|
||||
w -= 4;
|
||||
h -= 4;
|
||||
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.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.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.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerFluid implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ 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,9 +133,8 @@ public class ItemEnderFood extends ItemFood implements IResourceTooltipProvider
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> 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.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.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 par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> 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 list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
super.addInformation(itemStack, par2EntityPlayer, list, par4);
|
||||
String str = PowerDisplayUtil.formatPower(getEnergyStored(itemStack)) + "/"
|
||||
+ PowerDisplayUtil.formatPower(getMaxEnergyStored(itemStack))
|
||||
|
||||
@@ -310,7 +310,7 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
|
||||
if (colorIdx < 0 || colorIdx > 15) {
|
||||
return null;
|
||||
}
|
||||
return DyeColor.values()[15 - colorIdx];
|
||||
return DyeColor.VALUES[15 - colorIdx];
|
||||
}
|
||||
|
||||
private float getHealthFromStack(ItemStack item) {
|
||||
@@ -367,7 +367,8 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (par1ItemStack != null) {
|
||||
String mobName = getMobTypeFromStack(par1ItemStack);
|
||||
if (mobName != null) {
|
||||
|
||||
@@ -190,18 +190,14 @@ public class ItemYetaWrench extends Item
|
||||
}
|
||||
|
||||
/* IAdvancedTooltipProvider */
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
ArrayList<String> tmp = new ArrayList<String>();
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(tmp, getUnlocalizedName());
|
||||
String keyName = Keyboard.getKeyName(KeyTracker.instance.getYetaWrenchMode().getKeyCode());
|
||||
|
||||
@@ -11,12 +11,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.enderio.core.common.util.ChatUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.MouseInputEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
@@ -25,16 +27,19 @@ 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 {
|
||||
|
||||
@@ -54,6 +59,8 @@ public class KeyTracker {
|
||||
|
||||
private final KeyBinding gogglesKey;
|
||||
|
||||
private final KeyBinding trackmansGogglesKey;
|
||||
|
||||
private final KeyBinding yetaWrenchMode;
|
||||
|
||||
private final KeyBinding magnetKey;
|
||||
@@ -84,6 +91,12 @@ 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,
|
||||
@@ -123,11 +136,24 @@ public class KeyTracker {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(KeyInputEvent event) {
|
||||
handleInput();
|
||||
}
|
||||
|
||||
// mouse button presses arrive on a separate event
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(MouseInputEvent event) {
|
||||
if (Mouse.getEventButton() >= 0) {
|
||||
handleInput();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleInput() {
|
||||
handleGlide();
|
||||
handleSoundDetector();
|
||||
handleNightVision();
|
||||
handleYetaWrench();
|
||||
handleGoggles();
|
||||
handleTrackmanGoggles();
|
||||
handleStepAssist();
|
||||
handleSpeed();
|
||||
handleJump();
|
||||
@@ -232,6 +258,22 @@ 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,6 +120,7 @@ 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,6 +33,7 @@ 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;
|
||||
@@ -75,6 +76,9 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(ApiaristArmorUpgrade.LEGS);
|
||||
upgrades.add(ApiaristArmorUpgrade.BOOTS);
|
||||
}
|
||||
if (Loader.isModLoaded("Railcraft")) {
|
||||
upgrades.add(TrackmanGogglesUpgrade.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -140,8 +144,8 @@ public class DarkSteelRecipeManager {
|
||||
public static int getEnchantmentRepairCost(ItemStack itemStack) {
|
||||
// derived from ContainerRepair
|
||||
int res = 0;
|
||||
Map map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator iter = map1.keySet().iterator();
|
||||
Map<Integer, Integer> map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator<Integer> iter = map1.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
int i1 = ((Integer) iter.next()).intValue();
|
||||
Enchantment enchantment = Enchantment.enchantmentsList[i1];
|
||||
@@ -182,7 +186,8 @@ public class DarkSteelRecipeManager {
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addCommonEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -190,7 +195,8 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addBasicEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -198,7 +204,8 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
|
||||
List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>();
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
|
||||
@@ -10,6 +10,7 @@ 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;
|
||||
@@ -34,9 +35,13 @@ 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;
|
||||
@@ -45,11 +50,12 @@ 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 {
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist, IToolGoggles {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("darkSteel", 35, new int[] { 2, 6, 5, 2 }, 15);
|
||||
@@ -125,10 +131,9 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -163,17 +168,17 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -322,9 +327,45 @@ 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,7 +67,6 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
public static ItemDarkSteelAxe create() {
|
||||
ItemDarkSteelAxe res = new ItemDarkSteelAxe();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -96,7 +95,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -188,18 +187,6 @@ 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) {
|
||||
@@ -258,6 +245,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -287,17 +275,17 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -328,7 +316,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, d1);
|
||||
return compare(d1, d2);
|
||||
}
|
||||
|
||||
// NB: Copy of Integer.compare, which i sonly in Java 1.7+
|
||||
@@ -336,4 +324,19 @@ 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,7 +16,6 @@ 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;
|
||||
@@ -34,7 +33,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.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
@@ -61,7 +60,6 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
public static ItemDarkSteelPickaxe create() {
|
||||
ItemDarkSteelPickaxe res = new ItemDarkSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -83,7 +81,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -274,17 +272,17 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
|
||||
@@ -62,13 +62,12 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
public static ItemDarkSteelShears create() {
|
||||
ItemDarkSteelShears res = new ItemDarkSteelShears();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
protected final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
protected final EntityComparator entityComparator = new EntityComparator();
|
||||
private final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
private final EntityComparator entityComparator = new EntityComparator();
|
||||
protected String name;
|
||||
|
||||
protected ItemDarkSteelShears(String name) {
|
||||
@@ -92,7 +91,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -123,12 +122,13 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
BlockCoord bc = new BlockCoord(x, y, z);
|
||||
HarvestResult res = new HarvestResult(null, bc);
|
||||
|
||||
for (int dx = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dx
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dx++) {
|
||||
for (int dy = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dy
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dy++) {
|
||||
for (int dz = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dz
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dz++) {
|
||||
int range = Config.darkSteelShearsBlockAreaBoostWhenPowered;
|
||||
for (int dx = -range; dx <= range; dx++) {
|
||||
for (int dy = -range; dy <= range; dy++) {
|
||||
for (int dz = -range; dz <= range; dz++) {
|
||||
// Skip center block, already added via HarvestResult constructor
|
||||
if (dx == 0 && dy == 0 && dz == 0) continue;
|
||||
|
||||
Block block2 = player.worldObj.getBlock(x + dx, y + dy, z + dz);
|
||||
if (block2 instanceof IShearable && ((IShearable) block2)
|
||||
.isShearable(itemstack, player.worldObj, x + dx, y + dy, z + dz)) {
|
||||
@@ -145,9 +145,12 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
int maxBlocks = Math.min(sortedTargets.size(), powerStored / Config.darkSteelShearsPowerUsePerDamagePoint);
|
||||
for (int i = 0; i < maxBlocks; i++) {
|
||||
BlockCoord bc2 = sortedTargets.get(i);
|
||||
super.onBlockStartBreak(itemstack, bc2.x, bc2.y, bc2.z, player);
|
||||
if (bc2 != bc) {
|
||||
player.worldObj.setBlockToAir(bc2.x, bc2.y, bc2.z);
|
||||
Block target = player.worldObj.getBlock(bc2.x, bc2.y, bc2.z);
|
||||
if (target instanceof IShearable
|
||||
&& ((IShearable) target).isShearable(itemstack, player.worldObj, bc2.x, bc2.y, bc2.z)) {
|
||||
if (!super.onBlockStartBreak(itemstack, bc2.x, bc2.y, bc2.z, player)) {
|
||||
player.worldObj.setBlockToAir(bc2.x, bc2.y, bc2.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,6 +166,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
|
||||
if (entity.worldObj.isRemote) {
|
||||
@@ -182,15 +186,15 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
entity.posX + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posY + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posZ + Config.darkSteelShearsEntityAreaBoostWhenPowered);
|
||||
List<Entity> sortedTargets = new ArrayList<Entity>(
|
||||
List<IShearable> sortedTargets = new ArrayList<>(
|
||||
entity.worldObj.selectEntitiesWithinAABB(IShearable.class, bb, selectShearable));
|
||||
entityComparator.refPoint = entity;
|
||||
Collections.sort(sortedTargets, entityComparator);
|
||||
Collections.sort((List<Entity>) (Object) sortedTargets, entityComparator);
|
||||
|
||||
boolean result = false;
|
||||
int maxSheep = Math.min(sortedTargets.size(), powerStored / Config.darkSteelShearsPowerUsePerDamagePoint);
|
||||
for (int i = 0; i < maxSheep; i++) {
|
||||
Entity entity2 = sortedTargets.get(i);
|
||||
Entity entity2 = (Entity) sortedTargets.get(i);
|
||||
if (entity2 instanceof EntityLivingBase
|
||||
&& super.itemInteractionForEntity(itemstack, player, (EntityLivingBase) entity2)) {
|
||||
result = true;
|
||||
@@ -201,14 +205,6 @@ 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);
|
||||
@@ -230,6 +226,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -264,17 +261,17 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -329,4 +326,15 @@ 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,7 +72,6 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
public static ItemDarkSteelSword create() {
|
||||
ItemDarkSteelSword res = new ItemDarkSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -96,7 +95,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -117,71 +116,6 @@ 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)) {
|
||||
@@ -292,6 +226,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,17 +289,17 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -437,4 +372,73 @@ 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,13 +8,17 @@ 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;
|
||||
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem {
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem, IHazardProtector {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("endSteel", 50, new int[] { 4, 7, 10, 5 }, 25);
|
||||
@@ -56,10 +60,9 @@ public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelIt
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -77,4 +80,11 @@ 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,7 +6,6 @@ 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;
|
||||
@@ -30,7 +29,6 @@ public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
public static ItemEndSteelAxe create() {
|
||||
ItemEndSteelAxe res = new ItemEndSteelAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -40,7 +38,7 @@ public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
|
||||
Loaded 100 of 1057 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user