mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
No files matched your search
@@ -28,3 +28,4 @@ whitelist.json
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
.DS_Store
|
||||
+18
-16
@@ -1,24 +1,25 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.10:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.48-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.25:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.5: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.13.28-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.14.27-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.6:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-619-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.312:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.15-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.30:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.2-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.4-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.15-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: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
|
||||
@@ -26,5 +27,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-beta43:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta66a:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.58:dev")
|
||||
}
|
||||
+41
-6
@@ -39,9 +39,33 @@ 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 = true
|
||||
# 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.
|
||||
@@ -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.13-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.
|
||||
@@ -114,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.
|
||||
@@ -172,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" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
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.38'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -190,7 +190,6 @@ import crazypants.util.EE3Util;
|
||||
after:Waila@[1.5.8,);\
|
||||
after:Thaumcraft;\
|
||||
after:appliedenergistics2@[rv2-beta-8,);\
|
||||
after:chisel;\
|
||||
after:Railcraft@[9.16.7,)\
|
||||
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
@@ -214,6 +213,8 @@ public class EnderIO {
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
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;
|
||||
@@ -487,7 +488,9 @@ public class EnderIO {
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
if (!hasGT5) {
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
}
|
||||
|
||||
registerFluids();
|
||||
|
||||
@@ -727,7 +730,9 @@ public class EnderIO {
|
||||
SkeletonHandler.registerSkeleton(this);
|
||||
}
|
||||
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
if (!hasGT5) {
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
}
|
||||
|
||||
EnderfaceRecipes.addRecipes();
|
||||
MaterialRecipes.addRecipes();
|
||||
@@ -890,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
|
||||
@@ -917,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
@@ -93,9 +92,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 +156,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
BlockConduitBundle result = new BlockConduitBundle();
|
||||
result.init();
|
||||
MinecraftForge.EVENT_BUS.register(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -292,41 +287,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 +294,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 +434,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() {
|
||||
@@ -1274,4 +1217,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);
|
||||
|
||||
@@ -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;
|
||||
@@ -41,8 +40,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 +60,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 +103,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 +144,6 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
private boolean transferItems() {
|
||||
|
||||
if (recheckInv) {
|
||||
updateInventory();
|
||||
}
|
||||
|
||||
int[] slotIndices = getInventory().getAccessibleSlotsFromSide(inventorySide);
|
||||
if (slotIndices == null) {
|
||||
return false;
|
||||
@@ -257,9 +252,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 +273,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;
|
||||
}
|
||||
@@ -410,7 +425,7 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public ISidedInventory getInventoryRecheck() {
|
||||
if (recheckInv) {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
}
|
||||
return inv;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,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 +157,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();
|
||||
|
||||
@@ -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;
|
||||
@@ -134,6 +136,18 @@ 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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
@@ -202,14 +201,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);
|
||||
@@ -231,6 +222,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,4 +322,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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ItemEndSteelPickaxe extends ItemDarkSteelPickaxe implements IEndSte
|
||||
public static ItemEndSteelPickaxe create() {
|
||||
ItemEndSteelPickaxe res = new ItemEndSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -35,7 +34,6 @@ public class ItemEndSteelSword extends ItemDarkSteelSword implements IEndSteelIt
|
||||
public static ItemEndSteelSword create() {
|
||||
ItemEndSteelSword res = new ItemEndSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ItemStellarAxe extends ItemDarkSteelAxe implements IStellarItem {
|
||||
public static ItemStellarAxe create() {
|
||||
ItemStellarAxe res = new ItemStellarAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ItemStellarPickaxe extends ItemDarkSteelPickaxe implements IStellar
|
||||
public static ItemStellarPickaxe create() {
|
||||
ItemStellarPickaxe res = new ItemStellarPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -35,7 +34,6 @@ public class ItemStellarSword extends ItemDarkSteelSword implements IStellarItem
|
||||
public static ItemStellarSword create() {
|
||||
ItemStellarSword res = new ItemStellarSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
|
||||
vanillaFurnaceTooltip = new GuiToolTip(
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 62, BUTTON_SIZE, BUTTON_SIZE),
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 43, BUTTON_SIZE, BUTTON_SIZE),
|
||||
(String[]) null);
|
||||
|
||||
addProgressTooltip(55, 35, 14, 14);
|
||||
|
||||
@@ -93,11 +93,6 @@ public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketBufferIO(getTileEntity(), lastInput, lastOutput));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean renderPowerBar() {
|
||||
return getTileEntity().hasPower();
|
||||
|
||||
@@ -89,7 +89,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity<TileCapBank> {
|
||||
}
|
||||
|
||||
if (hasBaublesSlots()) {
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
// for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
// Capped since the sprite only has 4 slots
|
||||
for (int i = 0; i < Math.min(baubles.getSizeInventory(), 4); i++) {
|
||||
addSlotToContainer(new Slot(baubles, i, -15 + armorOffset, 84 + i * 18) {
|
||||
|
||||
@Override
|
||||
@@ -122,7 +124,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity<TileCapBank> {
|
||||
int startHotBarSlot = endPlayerSlot + 1;
|
||||
int endHotBarSlot = startHotBarSlot + 9;
|
||||
int startBaublesSlot = endHotBarSlot + 1;
|
||||
int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory();
|
||||
// int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory();
|
||||
// Capped since the sprite only has 4 slots
|
||||
int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + Math.min(baubles.getSizeInventory(), 4);
|
||||
|
||||
ItemStack copystack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.enderio.core.common.util.RoundRobinIterator;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
@@ -212,7 +212,7 @@ public class CapBankNetwork implements ICapBankNetwork {
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if (curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickListener);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.addListener(tickListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,11 +67,6 @@ public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getXSize() {
|
||||
return 219;
|
||||
|
||||
@@ -7,34 +7,23 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
|
||||
public class GuiEnchanter extends GuiContainerBaseEIO {
|
||||
|
||||
private TileEnchanter te;
|
||||
private ContainerEnchanter container;
|
||||
private IconButton recipeButton;
|
||||
|
||||
public GuiEnchanter(EntityPlayer player, InventoryPlayer inventory, TileEnchanter te) {
|
||||
super(new ContainerEnchanter(player, inventory, te), "enchanter");
|
||||
container = (ContainerEnchanter) inventorySlots;
|
||||
this.te = te;
|
||||
|
||||
recipeButton = new IconButton(this, 100, 154, 8, IconEIO.RECIPE);
|
||||
recipeButton.visible = false;
|
||||
recipeButton.setIconMargin(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
recipeButton.onGuiInit();
|
||||
recipeButton.visible = EnderIO.proxy.isNeiInstalled();
|
||||
((ContainerEnchanter) inventorySlots).createGhostSlots(getGhostSlots());
|
||||
container.createGhostSlots(getGhostSlots());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,10 +34,6 @@ public class GuiEnchanter extends GuiContainerBaseEIO {
|
||||
int sy = (height - ySize) / 2;
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (EnderIO.proxy.isNeiInstalled()) {
|
||||
IconEIO.map.render(IconEIO.RECIPE, sx + 155, sy + 8, 16, 16, 0, true);
|
||||
}
|
||||
|
||||
int curCost = te.getCurrentEnchantmentCost();
|
||||
if (curCost > 0) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@@ -138,11 +138,6 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
super.actionPerformed(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPowerOutputLabel() {
|
||||
return EnderIO.lang.localize("farm.gui.baseUse");
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package crazypants.enderio.machine.farm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
@@ -31,7 +33,6 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
|
||||
import crazypants.enderio.machine.ContinuousTask;
|
||||
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
|
||||
import crazypants.enderio.machine.IPoweredTask;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.farm.farmers.FarmersCommune;
|
||||
@@ -48,6 +49,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
private static final int TICKS_PER_WORK = 20;
|
||||
private boolean showingRange;
|
||||
|
||||
private final List<ItemStack> harvestBuffer = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
@@ -424,6 +427,38 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
wasActive = isActive();
|
||||
worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
|
||||
}
|
||||
tryMoveFromBuffer();
|
||||
}
|
||||
|
||||
private void tryMoveFromBuffer() {
|
||||
if (harvestBuffer.isEmpty() || worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemStack> toRemove = new ArrayList<>();
|
||||
for (ItemStack stack : harvestBuffer) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
toRemove.add(stack);
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack remaining = tryInsertToInputSlots(stack);
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining = tryInsertToOutputSlots(remaining);
|
||||
}
|
||||
|
||||
if (remaining == null || remaining.stackSize == 0) {
|
||||
toRemove.add(stack);
|
||||
} else {
|
||||
stack.stackSize = remaining.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
harvestBuffer.removeAll(toRemove);
|
||||
|
||||
if (!toRemove.isEmpty()) {
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -445,9 +480,18 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
setNotification("noPower");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isBufferNotEmpty() || isOutputFull()) {
|
||||
setNotification("outputFull");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isBufferNotEmpty() {
|
||||
return !harvestBuffer.isEmpty();
|
||||
}
|
||||
|
||||
protected void doTick() {
|
||||
|
||||
if (sendNotification && shouldDoWorkThisTick(TICKS_PER_WORK)) {
|
||||
@@ -488,7 +532,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
}
|
||||
|
||||
if (isOutputFull()) {
|
||||
if (isOutputFull() || isBufferNotEmpty()) {
|
||||
setNotification("outputFull");
|
||||
return;
|
||||
}
|
||||
@@ -507,10 +551,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, Config.farmParticlesMaxRange));
|
||||
for (EntityItem ei : harvest.getDrops()) {
|
||||
if (ei != null) {
|
||||
insertHarvestDrop(ei, bc);
|
||||
if (!ei.isDead) {
|
||||
worldObj.spawnEntityInWorld(ei);
|
||||
}
|
||||
addToBuffer(ei.getEntityItem().copy());
|
||||
ei.setDead();
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -552,6 +594,99 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
}
|
||||
}
|
||||
|
||||
private void addToBuffer(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ItemStack bufStack : harvestBuffer) {
|
||||
if (bufStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(bufStack, stack)) {
|
||||
int canAdd = bufStack.stackSize;
|
||||
if (canAdd > 0) {
|
||||
int addAmount = Math.min(canAdd, stack.stackSize);
|
||||
bufStack.stackSize += addAmount;
|
||||
stack.stackSize -= addAmount;
|
||||
|
||||
if (stack.stackSize <= 0) {
|
||||
markDirty();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
harvestBuffer.add(stack.copy());
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private ItemStack tryInsertToInputSlots(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = minSupSlot; i <= maxSupSlot; i++) {
|
||||
if (stack.stackSize <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
ItemStack slotStack = inventory[i];
|
||||
int stackLimit = getInventoryStackLimit(i);
|
||||
|
||||
if (isItemValidForSlot(i, stack)) {
|
||||
if (slotStack == null) {
|
||||
if (!isSlotLocked(i)) {
|
||||
int amount = Math.min(stack.stackSize, stackLimit);
|
||||
inventory[i] = stack.copy();
|
||||
inventory[i].stackSize = amount;
|
||||
stack.stackSize -= amount;
|
||||
markDirty();
|
||||
}
|
||||
} else if (slotStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(slotStack, stack)) {
|
||||
int canAdd = Math.min(stackLimit - slotStack.stackSize, stack.stackSize);
|
||||
if (canAdd > 0) {
|
||||
slotStack.stackSize += canAdd;
|
||||
stack.stackSize -= canAdd;
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack.stackSize > 0 ? stack : null;
|
||||
}
|
||||
|
||||
private ItemStack tryInsertToOutputSlots(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = slotDefinition.minOutputSlot; i <= slotDefinition.maxOutputSlot; i++) {
|
||||
if (stack.stackSize <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
ItemStack slotStack = inventory[i];
|
||||
int stackLimit = 64;
|
||||
|
||||
if (slotStack == null) {
|
||||
int amount = Math.min(stack.stackSize, stackLimit);
|
||||
inventory[i] = stack.copy();
|
||||
inventory[i].stackSize = amount;
|
||||
stack.stackSize -= amount;
|
||||
markDirty();
|
||||
} else if (slotStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(slotStack, stack)) {
|
||||
int canAdd = Math.min(stackLimit - slotStack.stackSize, stack.stackSize);
|
||||
if (canAdd > 0) {
|
||||
slotStack.stackSize += canAdd;
|
||||
stack.stackSize -= canAdd;
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack.stackSize > 0 ? stack : null;
|
||||
}
|
||||
|
||||
private int bonemealCooldown = 5; // no need to persist this
|
||||
|
||||
private boolean hasBonemeal() {
|
||||
@@ -652,68 +787,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
return minSupSlot + 3;
|
||||
}
|
||||
|
||||
private void insertHarvestDrop(Entity entity, BlockCoord bc) {
|
||||
if (!worldObj.isRemote) {
|
||||
if (entity instanceof EntityItem && !entity.isDead) {
|
||||
EntityItem item = (EntityItem) entity;
|
||||
ItemStack stack = item.getEntityItem().copy();
|
||||
int numInserted = insertResult(stack, bc);
|
||||
stack.stackSize -= numInserted;
|
||||
item.setEntityItemStack(stack);
|
||||
if (stack.stackSize == 0) {
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int insertResult(ItemStack stack, BlockCoord bc) {
|
||||
|
||||
int slot = bc != null ? getSupplySlotForCoord(bc) : minSupSlot;
|
||||
int[] slots = new int[NUM_SUPPLY_SLOTS];
|
||||
int k = 0;
|
||||
for (int j = slot; j <= maxSupSlot; j++) {
|
||||
slots[k++] = j;
|
||||
}
|
||||
for (int j = minSupSlot; j < slot; j++) {
|
||||
slots[k++] = j;
|
||||
}
|
||||
|
||||
int origSize = stack.stackSize;
|
||||
stack = stack.copy();
|
||||
|
||||
int inserted = 0;
|
||||
for (int j = 0; j < slots.length && inserted < stack.stackSize; j++) {
|
||||
int i = slots[j];
|
||||
ItemStack curStack = inventory[i];
|
||||
int inventoryStackLimit = getInventoryStackLimit(i);
|
||||
if (isItemValidForSlot(i, stack) && (curStack == null || curStack.stackSize < inventoryStackLimit)) {
|
||||
if (curStack == null) {
|
||||
if (stack.stackSize < inventoryStackLimit) {
|
||||
inventory[i] = stack.copy();
|
||||
inserted = stack.stackSize;
|
||||
} else {
|
||||
inventory[i] = stack.copy();
|
||||
inserted = inventoryStackLimit;
|
||||
inventory[i].stackSize = inserted;
|
||||
}
|
||||
} else if (curStack.isItemEqual(stack)) {
|
||||
inserted = Math.min(inventoryStackLimit - curStack.stackSize, stack.stackSize);
|
||||
inventory[i].stackSize += inserted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack.stackSize -= inserted;
|
||||
if (inserted >= origSize) {
|
||||
return origSize;
|
||||
}
|
||||
|
||||
ResultStack[] in = new ResultStack[] { new ResultStack(stack) };
|
||||
mergeResults(in);
|
||||
return origSize - (in[0].item == null ? 0 : in[0].item.stackSize);
|
||||
}
|
||||
|
||||
private @Nonnull BlockCoord getNextCoord() {
|
||||
|
||||
int size = getFarmSize();
|
||||
@@ -752,11 +825,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
return EnderIO.blockFarmStation.getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockFarmStation.unlocalisedName;
|
||||
@@ -811,6 +879,17 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
} else if (slotLayoutVersion == 2) {
|
||||
inventory = (new ArrayMappingTool<ItemStack>("TTTSSSSOOOOOOC", "TTTBBSSSSOOOOOOC")).map(inventory);
|
||||
}
|
||||
|
||||
if (nbtRoot.hasKey("HarvestBuffer")) {
|
||||
NBTTagList bufferList = nbtRoot.getTagList("HarvestBuffer", 10);
|
||||
for (int i = 0; i < bufferList.tagCount(); i++) {
|
||||
NBTTagCompound itemTag = bufferList.getCompoundTagAt(i);
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(itemTag);
|
||||
if (stack != null && stack.stackSize > 0) {
|
||||
harvestBuffer.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IPoweredTask createTask() {
|
||||
@@ -834,6 +913,18 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
nbtRoot.setIntArray("lockedSlots", locked);
|
||||
}
|
||||
nbtRoot.setInteger("slotLayoutVersion", 3);
|
||||
|
||||
if (!harvestBuffer.isEmpty()) {
|
||||
NBTTagList bufferList = new NBTTagList();
|
||||
for (ItemStack stack : harvestBuffer) {
|
||||
if (stack != null && stack.stackSize > 0) {
|
||||
NBTTagCompound itemTag = new NBTTagCompound();
|
||||
stack.writeToNBT(itemTag);
|
||||
bufferList.appendTag(itemTag);
|
||||
}
|
||||
}
|
||||
nbtRoot.setTag("HarvestBuffer", bufferList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,9 @@ import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.mitchej123.hodgepodge.mixins.interfaces.INetherSeed;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.farm.TileFarmStation;
|
||||
|
||||
public class PlantableFarmer implements IFarmerJoe {
|
||||
@@ -109,7 +111,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
|
||||
protected boolean plant(TileFarmStation farm, World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
int meta = plantable.getPlantMetadata(null, 0, 0, 0);
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, target, meta, 1 | 2);
|
||||
farm.actionPerformed(false);
|
||||
@@ -117,7 +125,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
protected boolean canPlant(World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
Block ground = worldObj.getBlock(bc.x, bc.y - 1, bc.z);
|
||||
if (target != null && target.canPlaceBlockAt(worldObj, bc.x, bc.y, bc.z)
|
||||
&& target.canBlockStay(worldObj, bc.x, bc.y, bc.z)
|
||||
@@ -182,10 +196,14 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
private boolean isPlantableForBlock(ItemStack stack, Block block) {
|
||||
if (!(stack.getItem() instanceof IPlantable)) {
|
||||
return false;
|
||||
if (stack.getItem() instanceof IPlantable plantable) {
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
return netherSeed.hodgepodge$getPlant(null, 0, 0, 0) == block;
|
||||
} else {
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
}
|
||||
}
|
||||
IPlantable plantable = (IPlantable) stack.getItem();
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
-5
@@ -52,11 +52,6 @@ public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustion
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -58,11 +58,6 @@ public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirli
|
||||
return fmt.format(args, new StringBuffer(), null).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String formatProgressTooltip(int scaledProgress, float remaining) {
|
||||
int totalBurnTime = getTileEntity().totalBurnTime;
|
||||
|
||||
@@ -159,10 +159,13 @@ public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerat
|
||||
|
||||
@Override
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof TileZombieGenerator) {
|
||||
if (EnderIO.hasWailaPlugins) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (world.getTileEntity(x, y, z) instanceof TileZombieGenerator generator) {
|
||||
tooltip.add(
|
||||
((TileZombieGenerator) te).getFluidStored(ForgeDirection.UNKNOWN) + " "
|
||||
generator.getFluidStored(ForgeDirection.UNKNOWN) + " "
|
||||
+ EnderIO.lang.localize("fluid.millibucket.abr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,6 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.inventory.Slot;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
@@ -22,7 +21,6 @@ import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.IoConfigRenderer.SelectedFace;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
@@ -46,8 +44,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
|
||||
protected final GuiButtonIoConfig configB;
|
||||
|
||||
protected IconButton recipeButton;
|
||||
|
||||
protected List<GuiToolTip> progressTooltips;
|
||||
protected int lastProgressTooltipValue = -1;
|
||||
|
||||
@@ -66,11 +62,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
|
||||
y += 19;
|
||||
configB = new GuiButtonIoConfig(this, CONFIG_ID, x, y, machine, configOverlay);
|
||||
|
||||
y += 19;
|
||||
recipeButton = new IconButton(this, RECIPE_ID, x, y, IconEIO.RECIPE);
|
||||
recipeButton.visible = false;
|
||||
recipeButton.setIconMargin(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,11 +69,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
super.initGui();
|
||||
redstoneButton.onGuiInit();
|
||||
configB.onGuiInit();
|
||||
recipeButton.onGuiInit();
|
||||
}
|
||||
|
||||
protected boolean showRecipeButton() {
|
||||
return EnderIO.proxy.isNeiInstalled();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,10 +82,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
guibutton.drawButton(mc, 0, 0);
|
||||
}
|
||||
|
||||
if (showRecipeButton()) {
|
||||
recipeButton.visible = true;
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
|
||||
renderSlotHighlights();
|
||||
|
||||
@@ -536,11 +536,6 @@ public class GuiInventoryPanel extends GuiMachineBase<TileInventoryPanel> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return 280;
|
||||
|
||||
@@ -28,9 +28,7 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
.registerMessage(PacketSwing.class, PacketSwing.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketGivePlayerXP.register();
|
||||
PacketExperianceContainer.register();
|
||||
|
||||
BlockKillerJoe res = new BlockKillerJoe();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -40,19 +38,18 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
setStepSound(Block.soundTypeGlass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX,
|
||||
double explosionY, double explosionZ) {
|
||||
return 2000;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void getKillDisplayName(PlayerEvent.NameFormat nameEvt) {
|
||||
if (nameEvt.username != null && nameEvt.username.startsWith(USERNAME)) {
|
||||
nameEvt.displayname = getLocalizedName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerKillerJoe(player.inventory, (TileKillerJoe) world.getTileEntity(x, y, z));
|
||||
@@ -101,4 +98,14 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void getKillDisplayName(PlayerEvent.NameFormat nameEvt) {
|
||||
if (nameEvt.username != null && nameEvt.username.startsWith(USERNAME)) {
|
||||
nameEvt.displayname = getLocalizedName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,11 +102,6 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -76,8 +76,4 @@ public class GuiAttractor extends GuiPoweredMachineBase<TileAttractor> {
|
||||
ColorUtil.getRGB(Color.white));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -75,8 +75,4 @@ public class GuiAversionObelisk extends GuiPoweredMachineBase<TileAversionObelis
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+18
-10
@@ -25,7 +25,6 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
public static BlockInhibitorObelisk create() {
|
||||
BlockInhibitorObelisk res = new BlockInhibitorObelisk();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return instance = res;
|
||||
}
|
||||
|
||||
@@ -33,6 +32,12 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
super(ModObject.blockInhibitorObelisk, TileInhibitorObelisk.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return ID == getGuiId()
|
||||
@@ -58,15 +63,18 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
|
||||
public Map<BlockCoord, Float> activeInhibitors = Maps.newHashMap();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTeleport(TeleportEntityEvent event) {
|
||||
for (Entry<BlockCoord, Float> e : activeInhibitors.entrySet()) {
|
||||
BlockCoord bc = e.getKey();
|
||||
int dist = bc.getDist(new BlockCoord(event.targetX, event.targetY, event.targetZ));
|
||||
if (dist < e.getValue()) {
|
||||
TileEntity te = bc.getTileEntity(event.entity.worldObj);
|
||||
if (te instanceof TileInhibitorObelisk && ((TileInhibitorObelisk) te).isActive()) {
|
||||
event.setCanceled(true);
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTeleport(TeleportEntityEvent event) {
|
||||
for (Entry<BlockCoord, Float> e : activeInhibitors.entrySet()) {
|
||||
BlockCoord bc = e.getKey();
|
||||
int dist = bc.getDist(new BlockCoord(event.targetX, event.targetY, event.targetZ));
|
||||
if (dist < e.getValue()) {
|
||||
TileEntity te = bc.getTileEntity(event.entity.worldObj);
|
||||
if (te instanceof TileInhibitorObelisk && ((TileInhibitorObelisk) te).isActive()) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,6 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
return WeatherTask.fromFluid(fs.getFluid());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
bindGuiTexture();
|
||||
|
||||
@@ -157,8 +157,4 @@ public class GuiExperienceObelisk extends GuiMachineBase<TileExperienceObelisk>
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:conduitConnector");
|
||||
blockIcon = IIconRegister.registerIcon("glowstone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,10 +231,12 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack drop) {
|
||||
TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
|
||||
if (tef != null) {
|
||||
if (te instanceof TileEntityPaintedBlock tef) {
|
||||
ItemStack itemStack = createItemStackForSourceBlock(tef.getSourceBlock(), tef.getSourceBlockMetadata());
|
||||
drop.stackTagCompound = (NBTTagCompound) itemStack.stackTagCompound.copy();
|
||||
NBTTagCompound tag = itemStack.stackTagCompound;
|
||||
if (tag != null) {
|
||||
drop.stackTagCompound = (NBTTagCompound) tag.copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@ public class GuiPainter extends GuiPoweredMachineBase<TileEntityPainter> {
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderSlotHighlight(int slot, Vector4f col) {
|
||||
if (getTileEntity().getSlotDefinition().isOutputSlot(slot)) {
|
||||
|
||||
@@ -63,7 +63,8 @@ public final class PainterUtil {
|
||||
sourceName = is.getDisplayName();
|
||||
}
|
||||
}
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " " + sourceName;
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " "
|
||||
+ (sourceName.isEmpty() ? EnderIO.lang.localize("blockPainter.paintedWith.none") : sourceName);
|
||||
}
|
||||
|
||||
public static void setSourceBlock(ItemStack item, Block source, int meta) {
|
||||
|
||||
@@ -89,8 +89,6 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
PoweredSpawnerConfig.getInstance();
|
||||
|
||||
BlockPoweredSpawner res = new BlockPoweredSpawner();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
FMLCommonHandler.instance().bus().register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -115,144 +113,16 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
EventHandler handler = new EventHandler();
|
||||
MinecraftForge.EVENT_BUS.register(handler);
|
||||
FMLCommonHandler.instance().bus().register(handler);
|
||||
}
|
||||
|
||||
private final Map<BlockCoord, ItemStack> dropCache = new HashMap<BlockCoord, ItemStack>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakEvent(BlockEvent.BreakEvent evt) {
|
||||
if (evt.block instanceof BlockMobSpawner) {
|
||||
if (evt.getPlayer() != null && !evt.getPlayer().capabilities.isCreativeMode
|
||||
&& !evt.getPlayer().worldObj.isRemote
|
||||
&& !evt.isCanceled()) {
|
||||
TileEntity tile = evt.getPlayer().worldObj.getTileEntity(evt.x, evt.y, evt.z);
|
||||
if (tile instanceof TileEntityMobSpawner) {
|
||||
|
||||
if (Math.random() > Config.brokenSpawnerDropChance) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack equipped = evt.getPlayer().getCurrentEquippedItem();
|
||||
if (equipped != null) {
|
||||
for (UniqueIdentifier uid : toolBlackList) {
|
||||
Item blackListItem = GameRegistry.findItem(uid.modId, uid.name);
|
||||
if (blackListItem == equipped.getItem()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tile;
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
ItemStack drop = ItemBrokenSpawner.createStackForMobType(name);
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), drop);
|
||||
|
||||
for (int i = (int) (Math.random() * 7); i > 0; i--) {
|
||||
logic.spawnDelay = 0;
|
||||
logic.updateSpawner();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHarvestDropsEvent(BlockEvent.HarvestDropsEvent evt) {
|
||||
if (!evt.isCanceled() && evt.block instanceof BlockMobSpawner) {
|
||||
BlockCoord bc = new BlockCoord(evt.x, evt.y, evt.z);
|
||||
if (dropCache.containsKey(bc)) {
|
||||
ItemStack stack = dropCache.get(bc);
|
||||
if (stack != null) {
|
||||
evt.drops.add(stack);
|
||||
}
|
||||
} else {
|
||||
// A spawner was broken---but not by a player. The TE has been
|
||||
// invalidated already, but we might be able to recover it.
|
||||
try {
|
||||
for (Object object : evt.world.loadedTileEntityList) {
|
||||
if (object instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) object;
|
||||
if (spawner.getWorldObj() == evt.world && spawner.xCoord == evt.x
|
||||
&& spawner.yCoord == evt.y
|
||||
&& spawner.zCoord == evt.z) {
|
||||
// Bingo!
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
evt.drops.add(ItemBrokenSpawner.createStackForMobType(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Risky recovery failed. Happens.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
dropCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleAnvilEvent(AnvilUpdateEvent evt) {
|
||||
if (evt.left == null || evt.left.stackSize != 1
|
||||
|| evt.left.getItem() != Item.getItemFromBlock(EnderIO.blockPoweredSpawner)
|
||||
|| evt.right == null
|
||||
|| ItemBrokenSpawner.getMobTypeFromStack(evt.right) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String spawnerType = ItemBrokenSpawner.getMobTypeFromStack(evt.right);
|
||||
if (isBlackListed(spawnerType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
evt.cost = Config.powerSpawnerAddSpawnerCost;
|
||||
evt.output = evt.left.copy();
|
||||
if (evt.output.stackTagCompound == null) {
|
||||
evt.output.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
evt.output.stackTagCompound.setBoolean("eio.abstractMachine", true);
|
||||
writeMobTypeToNBT(evt.output.stackTagCompound, spawnerType);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingUpdate(LivingUpdateEvent livingUpdate) {
|
||||
|
||||
Entity ent = livingUpdate.entityLiving;
|
||||
if (!ent.getEntityData().hasKey(KEY_SPAWNED_BY_POWERED_SPAWNER)) {
|
||||
return;
|
||||
}
|
||||
if (fieldpersistenceRequired == null) {
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
return;
|
||||
}
|
||||
|
||||
long spawnTime = ent.getEntityData().getLong(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
long livedFor = livingUpdate.entity.worldObj.getTotalWorldTime() - spawnTime;
|
||||
if (livedFor > Config.poweredSpawnerDespawnTimeSeconds * 20) {
|
||||
try {
|
||||
fieldpersistenceRequired.setBoolean(livingUpdate.entityLiving, false);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
} catch (Exception e) {
|
||||
Log.warn("BlockPoweredSpawner.onLivingUpdate: Error occured allowing entity to despawn: " + e);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBlackListed(String entityId) {
|
||||
return PoweredSpawnerConfig.getInstance().isBlackListed(entityId);
|
||||
}
|
||||
@@ -362,4 +232,144 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
Util.dropItems(evt.getPlayer().worldObj, drop, evt.x, evt.y, evt.z, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakEvent(BlockEvent.BreakEvent evt) {
|
||||
if (evt.block instanceof BlockMobSpawner) {
|
||||
if (evt.getPlayer() != null && !evt.getPlayer().capabilities.isCreativeMode
|
||||
&& !evt.getPlayer().worldObj.isRemote
|
||||
&& !evt.isCanceled()) {
|
||||
TileEntity tile = evt.getPlayer().worldObj.getTileEntity(evt.x, evt.y, evt.z);
|
||||
if (tile instanceof TileEntityMobSpawner) {
|
||||
|
||||
if (Math.random() > Config.brokenSpawnerDropChance) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack equipped = evt.getPlayer().getCurrentEquippedItem();
|
||||
if (equipped != null) {
|
||||
for (UniqueIdentifier uid : toolBlackList) {
|
||||
Item blackListItem = GameRegistry.findItem(uid.modId, uid.name);
|
||||
if (blackListItem == equipped.getItem()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tile;
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
ItemStack drop = ItemBrokenSpawner.createStackForMobType(name);
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), drop);
|
||||
|
||||
for (int i = (int) (Math.random() * 7); i > 0; i--) {
|
||||
logic.spawnDelay = 0;
|
||||
logic.updateSpawner();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHarvestDropsEvent(BlockEvent.HarvestDropsEvent evt) {
|
||||
if (!evt.isCanceled() && evt.block instanceof BlockMobSpawner) {
|
||||
BlockCoord bc = new BlockCoord(evt.x, evt.y, evt.z);
|
||||
if (dropCache.containsKey(bc)) {
|
||||
ItemStack stack = dropCache.get(bc);
|
||||
if (stack != null) {
|
||||
evt.drops.add(stack);
|
||||
}
|
||||
} else {
|
||||
// A spawner was broken---but not by a player. The TE has been
|
||||
// invalidated already, but we might be able to recover it.
|
||||
try {
|
||||
for (Object object : evt.world.loadedTileEntityList) {
|
||||
if (object instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) object;
|
||||
if (spawner.getWorldObj() == evt.world && spawner.xCoord == evt.x
|
||||
&& spawner.yCoord == evt.y
|
||||
&& spawner.zCoord == evt.z) {
|
||||
// Bingo!
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
evt.drops.add(ItemBrokenSpawner.createStackForMobType(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Risky recovery failed. Happens.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
dropCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleAnvilEvent(AnvilUpdateEvent evt) {
|
||||
if (evt.left == null || evt.left.stackSize != 1
|
||||
|| evt.left.getItem() != Item.getItemFromBlock(EnderIO.blockPoweredSpawner)
|
||||
|| evt.right == null
|
||||
|| ItemBrokenSpawner.getMobTypeFromStack(evt.right) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String spawnerType = ItemBrokenSpawner.getMobTypeFromStack(evt.right);
|
||||
if (isBlackListed(spawnerType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
evt.cost = Config.powerSpawnerAddSpawnerCost;
|
||||
evt.output = evt.left.copy();
|
||||
if (evt.output.stackTagCompound == null) {
|
||||
evt.output.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
evt.output.stackTagCompound.setBoolean("eio.abstractMachine", true);
|
||||
writeMobTypeToNBT(evt.output.stackTagCompound, spawnerType);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingUpdate(LivingUpdateEvent livingUpdate) {
|
||||
|
||||
Entity ent = livingUpdate.entityLiving;
|
||||
if (!ent.getEntityData().hasKey(KEY_SPAWNED_BY_POWERED_SPAWNER)) {
|
||||
return;
|
||||
}
|
||||
if (fieldpersistenceRequired == null) {
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
return;
|
||||
}
|
||||
|
||||
long spawnTime = ent.getEntityData().getLong(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
long livedFor = livingUpdate.entity.worldObj.getTotalWorldTime() - spawnTime;
|
||||
if (livedFor > Config.poweredSpawnerDespawnTimeSeconds * 20) {
|
||||
try {
|
||||
fieldpersistenceRequired.setBoolean(livingUpdate.entityLiving, false);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
} catch (Exception e) {
|
||||
Log.warn("BlockPoweredSpawner.onLivingUpdate: Error occured allowing entity to despawn: " + e);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -132,8 +132,4 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase<TilePoweredSpawner>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -187,6 +187,10 @@ public class BlockTank extends AbstractMachineBlock<TileTank> implements IAdvanc
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (EnderIO.hasWailaPlugins) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemstack.stackTagCompound != null && itemstack.stackTagCompound.hasKey("tankContents")) {
|
||||
FluidStack fl = FluidStack
|
||||
.loadFluidStackFromNBT((NBTTagCompound) itemstack.stackTagCompound.getTag("tankContents"));
|
||||
@@ -219,9 +223,11 @@ public class BlockTank extends AbstractMachineBlock<TileTank> implements IAdvanc
|
||||
|
||||
@Override
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileTank) {
|
||||
TileTank tank = (TileTank) te;
|
||||
if (EnderIO.hasWailaPlugins) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (world.getTileEntity(x, y, z) instanceof TileTank tank) {
|
||||
FluidStack stored = tank.tank.getFluid();
|
||||
String fluid = stored == null ? EnderIO.lang.localize("tooltip.none")
|
||||
: stored.getFluid().getLocalizedName(stored);
|
||||
|
||||
@@ -112,11 +112,6 @@ public class GuiTank extends GuiMachineBase<TileTank> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@@ -51,11 +51,6 @@ public class GuiTransceiver extends GuiPoweredMachineBase<TileTransceiver> {
|
||||
generalTab.updatePowerBarTooltip(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return ContainerTransceiver.GUI_WIDTH;
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
@@ -28,7 +29,12 @@ public class TileWirelessCharger extends TileEntityEio implements IInternalPower
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
WirelessChargerController.instance.deregisterCharger(this);
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnderIO.proxy.wirelessChargerController.deregisterCharger(this);
|
||||
registered = false;
|
||||
}
|
||||
|
||||
@@ -40,7 +46,7 @@ public class TileWirelessCharger extends TileEntityEio implements IInternalPower
|
||||
}
|
||||
|
||||
if (!registered) {
|
||||
WirelessChargerController.instance.registerCharger(this);
|
||||
EnderIO.proxy.wirelessChargerController.registerCharger(this);
|
||||
registered = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package crazypants.enderio.machine.wireless;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -10,6 +8,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public class WirelessChargedLocation {
|
||||
|
||||
private final TileEntity te;
|
||||
@@ -18,34 +18,30 @@ public class WirelessChargedLocation {
|
||||
|
||||
public WirelessChargedLocation(TileEntity te) {
|
||||
this.te = te;
|
||||
this.chargers = new ArrayList<IWirelessCharger>();
|
||||
this.chargers = new ArrayList<>();
|
||||
/*
|
||||
* Set lastChangeCount to one less than the current change count so that the charger list is updated on first
|
||||
* use (unless ~4B changes happen in between). Do this instead directly updating so that WirelessChargedLocation
|
||||
* can be used while the TileEntity is still in construction (or loading).
|
||||
*/
|
||||
this.lastChangeCount = WirelessChargerController.instance.getChangeCount() - 1;
|
||||
this.lastChangeCount = EnderIO.proxy.wirelessChargerController.getChangeCount() - 1;
|
||||
}
|
||||
|
||||
private void updateChargers() {
|
||||
WirelessChargerController wcc = WirelessChargerController.instance;
|
||||
WirelessChargerController wcc = EnderIO.proxy.wirelessChargerController;
|
||||
chargers.clear();
|
||||
lastChangeCount = wcc.getChangeCount();
|
||||
final BlockCoord bc = new BlockCoord(te);
|
||||
wcc.getChargers(te.getWorldObj(), bc, chargers);
|
||||
Collections.sort(chargers, new Comparator<IWirelessCharger>() {
|
||||
|
||||
@Override
|
||||
public int compare(IWirelessCharger o1, IWirelessCharger o2) {
|
||||
int dist1 = o1.getLocation().getDistSq(bc);
|
||||
int dist2 = o2.getLocation().getDistSq(bc);
|
||||
return dist1 - dist2;
|
||||
}
|
||||
chargers.sort((o1, o2) -> {
|
||||
int dist1 = o1.getLocation().getDistSq(bc);
|
||||
int dist2 = o2.getLocation().getDistSq(bc);
|
||||
return dist1 - dist2;
|
||||
});
|
||||
}
|
||||
|
||||
private void checkChangeCount() {
|
||||
if (lastChangeCount != WirelessChargerController.instance.getChangeCount()) {
|
||||
if (lastChangeCount != EnderIO.proxy.wirelessChargerController.getChangeCount()) {
|
||||
updateChargers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -21,20 +19,17 @@ import crazypants.util.BaublesUtil;
|
||||
|
||||
public class WirelessChargerController {
|
||||
|
||||
public static WirelessChargerController instance = new WirelessChargerController();
|
||||
|
||||
public static final int RANGE = Config.wirelessChargerRange;
|
||||
public static final int RANGE_SQ = RANGE * RANGE;
|
||||
|
||||
static {
|
||||
FMLCommonHandler.instance().bus().register(WirelessChargerController.instance);
|
||||
MinecraftForge.EVENT_BUS.register(WirelessChargerController.instance);
|
||||
}
|
||||
|
||||
private static final int RANGE = Config.wirelessChargerRange;
|
||||
private static final int RANGE_SQ = RANGE * RANGE;
|
||||
private final Map<Integer, Map<BlockCoord, IWirelessCharger>> perWorldChargers = new HashMap<Integer, Map<BlockCoord, IWirelessCharger>>();
|
||||
private int changeCount;
|
||||
|
||||
private WirelessChargerController() {}
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.side != Side.CLIENT && event.phase == TickEvent.Phase.END) {
|
||||
chargePlayersItems(event.player);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerCharger(IWirelessCharger charger) {
|
||||
if (charger == null) {
|
||||
@@ -54,28 +49,7 @@ public class WirelessChargerController {
|
||||
changeCount++;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.side == Side.CLIENT || event.phase != TickEvent.Phase.END) {
|
||||
return;
|
||||
}
|
||||
chargePlayersItems(event.player);
|
||||
}
|
||||
|
||||
public int getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void getChargers(World world, BlockCoord bc, Collection<IWirelessCharger> res) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(world);
|
||||
for (IWirelessCharger wc : chargers.values()) {
|
||||
if (wc.getLocation().getDistSq(bc) <= RANGE_SQ) {
|
||||
res.add(wc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void chargePlayersItems(EntityPlayer player) {
|
||||
private void chargePlayersItems(EntityPlayer player) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(player.worldObj);
|
||||
if (chargers.isEmpty()) {
|
||||
return;
|
||||
@@ -108,13 +82,21 @@ public class WirelessChargerController {
|
||||
return res;
|
||||
}
|
||||
|
||||
private Map<BlockCoord, IWirelessCharger> getChargersForWorld(World world) {
|
||||
Map<BlockCoord, IWirelessCharger> res = perWorldChargers.get(world.provider.dimensionId);
|
||||
if (res == null) {
|
||||
res = new HashMap<BlockCoord, IWirelessCharger>();
|
||||
perWorldChargers.put(world.provider.dimensionId, res);
|
||||
public int getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void getChargers(World world, BlockCoord bc, Collection<IWirelessCharger> res) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(world);
|
||||
for (IWirelessCharger wc : chargers.values()) {
|
||||
if (wc.getLocation().getDistSq(bc) <= RANGE_SQ) {
|
||||
res.add(wc);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private Map<BlockCoord, IWirelessCharger> getChargersForWorld(World world) {
|
||||
return perWorldChargers.computeIfAbsent(world.provider.dimensionId, k -> new HashMap<>());
|
||||
}
|
||||
|
||||
public Collection<IWirelessCharger> getChargers(World world) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import static net.minecraft.util.EnumChatFormatting.RESET;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -9,6 +12,7 @@ import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@@ -20,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
@@ -28,6 +33,7 @@ import crazypants.enderio.power.ICapacitorItem;
|
||||
public class ItemCapacitor extends Item implements ICapacitorItem {
|
||||
|
||||
private static final BasicCapacitor CAP = new BasicCapacitor();
|
||||
private static final String SPACE = " ";
|
||||
|
||||
public static ItemCapacitor create() {
|
||||
ItemCapacitor result = new ItemCapacitor();
|
||||
@@ -104,12 +110,43 @@ public class ItemCapacitor extends Item implements ICapacitorItem {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (par1ItemStack != null && par1ItemStack.getItemDamage() > 0 && par1ItemStack.getItemDamage() != 7) {
|
||||
par3List.add(EnderIO.lang.localize("machine.tooltip.upgrade"));
|
||||
ICapacitor capacitor = getCapacitor(par1ItemStack);
|
||||
par3List.add(EnumChatFormatting.GREEN + EnderIO.lang.localize("machine.tooltip.upgrade.name"));
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(par3List, "enderio.machine.tooltip.upgrade");
|
||||
addUpgrades(par3List, capacitor);
|
||||
addRangeUpgrade(par3List, capacitor);
|
||||
} else {
|
||||
SpecialTooltipHandler.addShowDetailsTooltip(par3List);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpgrades(List<String> list, ICapacitor capacitor) {
|
||||
DecimalFormat formatter = new DecimalFormat("#,###");
|
||||
String tierString = EnumChatFormatting.AQUA + EnderIO.lang.localize("machine.tooltip.upgrade.tier");
|
||||
String maxEnergyStorageString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energystorage");
|
||||
String maxEnergyReceivedString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energyreceived");
|
||||
String maxEnergyExtractedString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energyextracted");
|
||||
String upgrades = EnumChatFormatting.GOLD + EnderIO.lang.localize("machine.tooltip.upgrade");
|
||||
String maxEnergyStorage = formatter.format(capacitor.getMaxEnergyStored());
|
||||
int tier = capacitor.getTier();
|
||||
String maxEnergyReceived = formatter.format(capacitor.getMaxEnergyReceived());
|
||||
String maxEnergyExtracted = formatter.format(capacitor.getMaxEnergyExtracted());
|
||||
list.add(upgrades);
|
||||
list.add(SPACE + tierString + RESET + tier);
|
||||
list.add(SPACE + maxEnergyReceivedString + RESET + maxEnergyReceived);
|
||||
list.add(SPACE + maxEnergyExtractedString + RESET + maxEnergyExtracted);
|
||||
list.add(SPACE + maxEnergyStorageString + RESET + maxEnergyStorage);
|
||||
}
|
||||
|
||||
public void addRangeUpgrade(List<String> list, ICapacitor capacitor) {
|
||||
String farmStation = EnumChatFormatting.AQUA + EnderIO.lang.localize("machine.tooltip.upgrade.farmstation");
|
||||
String rangeUpgrade = EnumChatFormatting.GOLD + EnderIO.lang.localize("machine.tooltip.upgrade.range");
|
||||
int range = Config.farmBonusSize * capacitor.getTier() - 1 + 2;
|
||||
list.add(rangeUpgrade);
|
||||
list.add(SPACE + farmStation + RESET + range);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
@@ -58,10 +59,13 @@ public class MaterialRecipes {
|
||||
|
||||
public static void registerOresInDictionary() {
|
||||
// Ore Dictionary Registration
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary
|
||||
.registerOre(powder.oreDictName, new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
if (!hasGT5) {
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary.registerOre(
|
||||
powder.oreDictName,
|
||||
new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,17 +435,19 @@ public class MaterialRecipes {
|
||||
RecipeUtil.addShaped(vibCry, "nnn", "ngn", "nnn", 'n', vibrantNugget, 'g', "gemEmerald");
|
||||
|
||||
// Smelting
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
}
|
||||
|
||||
// Dark Iron Bars
|
||||
ItemStack diBars = new ItemStack(EnderIO.blockDarkIronBars, 16, 0);
|
||||
@@ -564,24 +570,29 @@ public class MaterialRecipes {
|
||||
ItemStack darkRod = new ItemStack(EnderIO.itemMaterial, 1, Material.DARK_STEEL_ROD.ordinal());
|
||||
RecipeUtil.addShaped(darkRod, " ns", "nsn", "sn ", 's', darkSteel, 'n', endSteelNugget);
|
||||
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
if (!hasGT5) {
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
RecipeUtil.addShapeless(enderios, Items.bowl, Items.milk_bucket, "cropWheat", "dustEnderPearl");
|
||||
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
if (!hasGT5) {
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance
|
||||
.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,14 +11,12 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.alloy.AlloyRecipeManager;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
@@ -51,7 +49,7 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(72, 19, 22, 19),
|
||||
"EnderIOAlloySmelter",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -117,10 +115,6 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
AlloySmelterRecipe recipe = (AlloySmelterRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 52, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -15,13 +15,10 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipe;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipeManager;
|
||||
import crazypants.enderio.machine.enchanter.GuiEnchanter;
|
||||
@@ -54,7 +51,7 @@ public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, -3, 16, 16),
|
||||
new Rectangle(97, 24, 22, 17),
|
||||
"EIOEnchanter",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -131,9 +128,6 @@ public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
GuiDraw.drawStringC(s, 83, 46, 0x80FF20);
|
||||
}
|
||||
|
||||
int x = 149, y = -3;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -7,9 +7,13 @@ import codechicken.nei.api.IConfigureNEI;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
import crazypants.enderio.machine.invpanel.GuiInventoryPanel;
|
||||
import crazypants.enderio.machine.invpanel.client.InventoryPanelNEIOverlayHandler;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.slicensplice.GuiSliceAndSplice;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
|
||||
public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
@@ -17,9 +21,11 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
public void loadConfig() {
|
||||
API.registerRecipeHandler(new AlloySmelterRecipeHandler());
|
||||
API.registerUsageHandler(new AlloySmelterRecipeHandler());
|
||||
API.setGuiOffset(GuiAlloySmelter.class, 4, 6);
|
||||
|
||||
API.registerRecipeHandler(new SagMillRecipeHandler());
|
||||
API.registerUsageHandler(new SagMillRecipeHandler());
|
||||
API.setGuiOffset(GuiCrusher.class, 6, 11);
|
||||
|
||||
API.registerRecipeHandler(new VatRecipeHandler());
|
||||
API.registerUsageHandler(new VatRecipeHandler());
|
||||
@@ -29,9 +35,11 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
API.registerRecipeHandler(new SliceAndSpliceRecipeHandler());
|
||||
API.registerUsageHandler(new SliceAndSpliceRecipeHandler());
|
||||
API.setGuiOffset(GuiSliceAndSplice.class, 13, 11);
|
||||
|
||||
API.registerRecipeHandler(new SoulBinderRecipeHandler());
|
||||
API.registerUsageHandler(new SoulBinderRecipeHandler());
|
||||
API.setGuiOffset(GuiSoulBinder.class, 11, 11);
|
||||
|
||||
API.registerGuiOverlayHandler(GuiInventoryPanel.class, new InventoryPanelNEIOverlayHandler(), "crafting");
|
||||
|
||||
|
||||
@@ -14,13 +14,10 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
import crazypants.enderio.machine.crusher.GrindingBall;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
@@ -61,7 +58,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(74, 21, 17, 22),
|
||||
"EnderIOSagMill",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -127,10 +124,6 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
MillRecipe recipe = (MillRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 96, 33, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,13 +12,10 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.slicensplice.ContainerSliceAndSplice;
|
||||
@@ -52,7 +49,7 @@ public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(91, 37, 22, 17),
|
||||
"EnderIOSliceAndSplice",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -113,10 +110,6 @@ public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
SliceAndSpliceRecipe recipe = (SliceAndSpliceRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 57, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -13,15 +13,12 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
@@ -54,7 +51,7 @@ public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(70, 23, 22, 17),
|
||||
"EnderIOSoulBinder",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -142,10 +139,6 @@ public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
String s = I18n.format("container.repair.cost", new Object[] { Integer.valueOf(cost) });
|
||||
GuiDraw.drawStringC(s, 83, 55, 0x80FF20);
|
||||
}
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
private static final ArrayList<PositionedStack> EMPTY_VIAL_OUTPUT = new ArrayList<PositionedStack>();
|
||||
|
||||
@@ -3,28 +3,32 @@ package crazypants.enderio.nei;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemStackMap;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.vat.GuiVat;
|
||||
@@ -66,7 +70,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(70, 8, 28, 43),
|
||||
"EnderIOVat",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -157,8 +161,8 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
if (rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.inFluid,
|
||||
rec.inFluid.amount,
|
||||
rec.inFluid.amount,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getInputFluidAmount(),
|
||||
inTankBounds.x,
|
||||
inTankBounds.y,
|
||||
0,
|
||||
@@ -169,8 +173,8 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
if (rec.result != null && rec.result.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.result,
|
||||
rec.result.amount,
|
||||
rec.result.amount,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getResultFluidAmount(),
|
||||
outTankBounds.x,
|
||||
outTankBounds.y,
|
||||
0,
|
||||
@@ -190,9 +194,6 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
GuiDraw.drawStringC(str, ps.relx + 8, ps.rely + 19, 0x808080, false);
|
||||
}
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,24 +203,19 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int recipeIndex) {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point offset = gui.getRecipePosition(recipeIndex);
|
||||
Point relMouse = new Point(
|
||||
pos.x - ((gui.width - 176) / 2) - offset.x,
|
||||
pos.y - ((gui.height - 166) / 2) - offset.y);
|
||||
final InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
final Point pos = GuiDraw.getMousePosition();
|
||||
final Point offset = gui.getRecipePosition(recipeIndex);
|
||||
final Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse) || outTankBounds.contains(relMouse)) {
|
||||
if (inTankBounds.contains(relMouse)) {
|
||||
if (rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
currenttip.add(rec.inFluid.getFluid().getLocalizedName(rec.inFluid));
|
||||
}
|
||||
} else {
|
||||
if (rec.result != null && rec.result.getFluid() != null) {
|
||||
currenttip.add(rec.result.getFluid().getLocalizedName(rec.result));
|
||||
}
|
||||
}
|
||||
if (inTankBounds.contains(relMouse) && rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
currenttip.add(rec.inFluid.getFluid().getLocalizedName(rec.inFluid));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getInputFluidAmount() + " " + Fluids.MB());
|
||||
} else if (outTankBounds.contains(relMouse) && rec.result != null && rec.result.getFluid() != null) {
|
||||
currenttip.add(rec.result.getFluid().getLocalizedName(rec.result));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getResultFluidAmount() + " " + Fluids.MB());
|
||||
}
|
||||
|
||||
return super.handleTooltip(gui, currenttip, recipeIndex);
|
||||
}
|
||||
|
||||
@@ -241,9 +237,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point offset = gui.getRecipePosition(recipeIndex);
|
||||
Point relMouse = new Point(
|
||||
pos.x - ((gui.width - 176) / 2) - offset.x,
|
||||
pos.y - ((gui.height - 166) / 2) - offset.y);
|
||||
Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse)) {
|
||||
transferFluidTank(rec.inFluid, usage);
|
||||
@@ -283,7 +277,10 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public class InnerVatRecipe extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
private ArrayList<PositionedStack> inputs;
|
||||
private List<PositionedStack> inputs = new ArrayList<>();
|
||||
private ItemStackMap<Float> firstItemMultiplier = new ItemStackMap();
|
||||
private ItemStackMap<Float> secondItemMultiplier = new ItemStackMap();
|
||||
private Map<FluidStack, Float> fluidMultiplier = new HashMap<>();
|
||||
private int energy;
|
||||
private FluidStack result;
|
||||
private FluidStack inFluid;
|
||||
@@ -294,7 +291,31 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 30, inputs);
|
||||
return getCycledIngredients(cycleticks / 30, this.inputs);
|
||||
}
|
||||
|
||||
public int getInputFluidAmount() {
|
||||
return (int) Math
|
||||
.round(FluidContainerRegistry.BUCKET_VOLUME * getFirstItemMultiplier() * getSecondItemMultiplier());
|
||||
}
|
||||
|
||||
public int getResultFluidAmount() {
|
||||
return (int) Math.round(
|
||||
FluidContainerRegistry.BUCKET_VOLUME * getFirstItemMultiplier()
|
||||
* getSecondItemMultiplier()
|
||||
* getFluidMultiplier());
|
||||
}
|
||||
|
||||
public float getFirstItemMultiplier() {
|
||||
return this.inputs.isEmpty() ? 1f : this.firstItemMultiplier.getOrDefault(this.inputs.get(0).item, 1f);
|
||||
}
|
||||
|
||||
public float getSecondItemMultiplier() {
|
||||
return this.inputs.size() < 2 ? 1f : this.secondItemMultiplier.getOrDefault(this.inputs.get(1).item, 1f);
|
||||
}
|
||||
|
||||
public float getFluidMultiplier() {
|
||||
return this.fluidMultiplier.getOrDefault(this.inFluid, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,28 +324,41 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
public InnerVatRecipe(int energy, RecipeInput[] ingredients, FluidStack result) {
|
||||
ArrayList<ItemStack> inputsOne = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> inputsTwo = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> inputsOne = new ArrayList<>();
|
||||
final List<ItemStack> inputsTwo = new ArrayList<>();
|
||||
|
||||
for (RecipeInput input : ingredients) {
|
||||
float multi = input.getMulitplier();
|
||||
|
||||
if (input.getInput() != null) {
|
||||
List<ItemStack> equivs = getInputs(input);
|
||||
final List<ItemStack> equivs = getInputs(input);
|
||||
|
||||
if (input.getSlotNumber() == 0) {
|
||||
inputsOne.addAll(equivs);
|
||||
|
||||
for (ItemStack stack : equivs) {
|
||||
this.firstItemMultiplier.put(stack, multi);
|
||||
}
|
||||
} else if (input.getSlotNumber() == 1) {
|
||||
inputsTwo.addAll(equivs);
|
||||
}
|
||||
} else if (input.getFluidInput() != null) {
|
||||
inFluid = input.getFluidInput();
|
||||
}
|
||||
}
|
||||
|
||||
inputs = new ArrayList<PositionedStack>();
|
||||
for (ItemStack stack : equivs) {
|
||||
this.secondItemMultiplier.put(stack, multi);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (input.getFluidInput() != null) {
|
||||
this.inFluid = input.getFluidInput();
|
||||
this.fluidMultiplier.put(this.inFluid, multi);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!inputsOne.isEmpty()) {
|
||||
inputs.add(new PositionedStack(inputsOne, 51, 1));
|
||||
this.inputs.add(new PositionedStack(inputsOne, 51, 1));
|
||||
}
|
||||
if (!inputsTwo.isEmpty()) {
|
||||
inputs.add(new PositionedStack(inputsTwo, 100, 1));
|
||||
this.inputs.add(new PositionedStack(inputsTwo, 100, 1));
|
||||
}
|
||||
|
||||
this.energy = energy;
|
||||
|
||||
@@ -20,7 +20,6 @@ import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
@@ -153,19 +152,6 @@ public class ThaumcraftCompat {
|
||||
ThaumcraftApi.registerObjectTag(
|
||||
new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.ENLIGHTENED_GLASS.ordinal()),
|
||||
new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.LIGHT, 8).add(Aspect.SENSES, 2));
|
||||
|
||||
// This is a horrible hack due to the fact that I am assembling my aspects after TC does recipe parsing
|
||||
// Therefore I redo all EIO items
|
||||
for (Object o : Item.itemRegistry.getKeys()) {
|
||||
if (o instanceof String) {
|
||||
String ownermod = ((String) o).substring(0, ((String) o).indexOf(':'));
|
||||
if (EnderIO.MODID.equals(ownermod)) {
|
||||
for (int idx = 0; idx < 16; idx++) {
|
||||
addAspectsFromRecipes((Item) Item.itemRegistry.getObject((String) o), idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static AspectList getAspects(Block block) {
|
||||
@@ -185,10 +171,6 @@ public class ThaumcraftCompat {
|
||||
return new AspectList(item);
|
||||
}
|
||||
|
||||
private static void addAspectsFromRecipes(Item item, int meta) {
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(item, 1, meta), ThaumcraftApiHelper.generateTags(item, meta));
|
||||
}
|
||||
|
||||
public static void loadUpgrades(List<IDarkSteelUpgrade> upgrades) {
|
||||
upgrades.add(GogglesOfRevealingUpgrade.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
PowerDisplayUtil.abrevation()));
|
||||
}
|
||||
|
||||
} else if (itemStack.getItem() == EnderIO.itemLiquidConduit) {
|
||||
} else if (itemStack.getItem() == EnderIO.itemLiquidConduit && !EnderIO.hasWailaPlugins) {
|
||||
NBTTagCompound nbtRoot = accessor.getNBTData();
|
||||
if (nbtRoot.hasKey("fluidLocked") && nbtRoot.hasKey("FluidName")) {
|
||||
boolean fluidTypeLocked = nbtRoot.getBoolean("fluidLocked");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.util;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Material.BINDER_COMPOSITE;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
@@ -9,6 +10,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -20,6 +22,7 @@ import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.ItemEnderFood.EnderFood;
|
||||
@@ -93,47 +96,59 @@ public class EE3Util {
|
||||
*/
|
||||
public static void registerMiscRecipes() {
|
||||
if (IS_EE3_LOADED) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
if (!hasGT5) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
ItemStack bowl = new ItemStack(Items.bowl, 1);
|
||||
ItemStack wheat = new ItemStack(Items.wheat, 1);
|
||||
ItemStack milkb = new ItemStack(Items.milk_bucket, 1);
|
||||
FluidStack milk = FluidContainerRegistry.getFluidForFilledItem(milkb);
|
||||
ItemStack dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack dustEnderPearl;
|
||||
if (hasGT5) {
|
||||
dustEnderPearl = GameRegistry.findItemStack("gregtech", "gt.metaitem.01", 1);
|
||||
Items.feather.setDamage(Objects.requireNonNull(dustEnderPearl), 2532);
|
||||
} else {
|
||||
dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
}
|
||||
if (milk != null) {
|
||||
registerRecipe(enderios, bowl, milk, wheat, dustEnderPearl);
|
||||
} else {
|
||||
registerRecipe(enderios, bowl, milkb, wheat, dustEnderPearl);
|
||||
}
|
||||
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
|
||||
ItemStack dustObsidian4 = new ItemStack(EnderIO.itemPowderIngot, 4, PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
ItemStack dustObsidian4 = new ItemStack(
|
||||
EnderIO.itemPowderIngot,
|
||||
4,
|
||||
PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
}
|
||||
|
||||
ItemStack cbc8 = BINDER_COMPOSITE.getStack(8);
|
||||
ItemStack sand2 = new ItemStack(Blocks.sand, 2);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Access Transformer configuration file
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f #xSize
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147000_g #ySize
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiTop
|
||||
@@ -373,9 +373,14 @@ enderio.endergeticCapacitor.name=Endergetic Capacitor
|
||||
enderio.endergisedCapacitor.name=Endergised Capacitor
|
||||
enderio.totemicCapacitor.name=Totemic Capacitor
|
||||
|
||||
enderio.machine.tooltip.upgrade=Machine Upgrade
|
||||
enderio.machine.tooltip.upgrade.tooltip.detailed.line1=Increases energy storage and
|
||||
enderio.machine.tooltip.upgrade.tooltip.detailed.line2=speed / range of machines
|
||||
enderio.machine.tooltip.upgrade.name=Machine Upgrade
|
||||
enderio.machine.tooltip.upgrade=Upgrades:
|
||||
enderio.machine.tooltip.upgrade.tier=Tier:
|
||||
enderio.machine.tooltip.upgrade.energyreceived=Max Energy Received:
|
||||
enderio.machine.tooltip.upgrade.energyextracted=Max Energy Extracted:
|
||||
enderio.machine.tooltip.upgrade.farmstation=Farming station radius:
|
||||
enderio.machine.tooltip.upgrade.energystorage=Max energy storage:
|
||||
enderio.machine.tooltip.upgrade.range=Range upgrade:
|
||||
enderio.machine.tooltip.clearConfig=This will clear all stored info!
|
||||
|
||||
#Machines
|
||||
@@ -777,6 +782,7 @@ enderio.itemCoordSelector.chat.setDimension=Set Dimension: %s%s
|
||||
#Painter
|
||||
tile.blockPainter.name=Painting Machine
|
||||
enderio.blockPainter.paintedWith=Painted with:
|
||||
enderio.blockPainter.paintedWith.none=§onothing§r
|
||||
tile.blockPaintedFence.name=Painted Fence
|
||||
tile.blockPaintedFenceGate.name=Painted Gate
|
||||
tile.blockPaintedWall.name=Painted Wall
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.9 KiB |
Reference in new issue
Block a user