Mod Compat is now in its own repo, found at https://github.com/TechReborn/TechReborn-ModCompatibility
This commit is contained in:
parent
b65e963f12
commit
712136914a
94 changed files with 0 additions and 8145 deletions
15
ModCompatibility/.gitignore
vendored
15
ModCompatibility/.gitignore
vendored
|
@ -1,15 +0,0 @@
|
|||
/bin
|
||||
/out
|
||||
/run/*
|
||||
/build
|
||||
/eclipse
|
||||
/.gradle
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
/.metadata
|
||||
/.settings
|
||||
/classpath
|
||||
.idea/*
|
||||
/logs/
|
||||
/classes/
|
|
@ -1,153 +0,0 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Modmuss50"
|
||||
url = "http://maven.modmuss50.me/"
|
||||
}
|
||||
maven {
|
||||
// JEI, TiC
|
||||
name "TiC"
|
||||
url "http://dvs1.progwml6.com/files/maven"
|
||||
}
|
||||
maven {
|
||||
name = "Amadornes"
|
||||
url "http://maven.amadornes.com/"
|
||||
}
|
||||
maven {
|
||||
// CraftTweaker2
|
||||
name "Jared"
|
||||
url "http://maven.blamejared.com/"
|
||||
}
|
||||
maven {
|
||||
// TheOneProbe
|
||||
url "http://maven.tterrag.com/"
|
||||
}
|
||||
maven {
|
||||
// IC2
|
||||
name = "ic2"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
}
|
||||
maven {
|
||||
// HWYLA
|
||||
name "TehNut"
|
||||
url "http://tehnut.info/maven/"
|
||||
}
|
||||
maven {
|
||||
name 'CB Repo'
|
||||
url "http://chickenbones.net/maven/"
|
||||
}
|
||||
maven {
|
||||
// CoFH
|
||||
name 'Covers'
|
||||
url "http://maven.covers1624.net/"
|
||||
}
|
||||
ivy {
|
||||
name "BuildCraft"
|
||||
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision].[ext]"
|
||||
}
|
||||
maven {
|
||||
name "OpenComputer"
|
||||
url "http://maven.cil.li/"
|
||||
}
|
||||
}
|
||||
|
||||
version = "2.16.0"
|
||||
|
||||
def ENV = System.getenv()
|
||||
if (ENV.BUILD_NUMBER) {
|
||||
version = version + "." + "${System.getenv().BUILD_NUMBER}"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.4.2705"
|
||||
mappings = "snapshot_20171003"
|
||||
replace "@MODVERSION@", project.version
|
||||
useDepAts = true
|
||||
runDir = "run"
|
||||
}
|
||||
|
||||
group = 'TechRebornModCompatibility'
|
||||
|
||||
dependencies {
|
||||
//Some dep we use wants the older jei, so this ingores it. We grab the latest anyway, so it shoudnt cause any issues.
|
||||
def withoutOldJEI = { exclude module: 'jei_1.12.2' }
|
||||
|
||||
deobfCompile('RebornCore:RebornCore-1.12.2:+:universal') {
|
||||
transitive = false
|
||||
}
|
||||
compile "mcp.mobius.waila:Hwyla:+"
|
||||
compile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.0.12.323"
|
||||
compile name: 'buildcraft', version: '7.99.17', ext: 'jar'
|
||||
|
||||
deobfCompile "mezz.jei:jei_1.12.2:+"
|
||||
deobfCompile "mcjty.theoneprobe:TheOneProbe-1.12:1.12-1.4.19-11"
|
||||
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+'
|
||||
deobfCompile 'cofh:ThermalDynamics:1.12.2-2.5+:universal'
|
||||
deobfCompile 'cofh:ThermalExpansion:1.12.2-5.5+:universal'
|
||||
deobfCompile 'MCMultiPart2:MCMultiPart:2.4.1'
|
||||
deobfCompile "li.cil.oc:OpenComputers:MC1.12.2-1.7.2+"
|
||||
deobfCompile "blusunrize:ImmersiveEngineering:0.12-+:deobf"
|
||||
}
|
||||
|
||||
|
||||
task deobfJar(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
exclude "**/*.psd"
|
||||
classifier = 'dev'
|
||||
}
|
||||
|
||||
|
||||
jar {
|
||||
exclude "**/*.psd"
|
||||
classifier = 'universal'
|
||||
}
|
||||
|
||||
build.dependsOn deobfJar
|
||||
|
||||
task signJar(type: SignJar, dependsOn: reobfJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('keyStore')
|
||||
}
|
||||
|
||||
if (project.hasProperty('keyStore')) {
|
||||
keyStore = project.keyStore
|
||||
alias = project.keyStoreAlias
|
||||
storePass = project.keyStorePass
|
||||
keyPass = project.keyStoreKeyPass
|
||||
inputFile = jar.archivePath
|
||||
outputFile = jar.archivePath
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
build.dependsOn signJar
|
||||
|
||||
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
|
BIN
ModCompatibility/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
ModCompatibility/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
|
@ -1,6 +0,0 @@
|
|||
#Mon Feb 19 13:23:28 GMT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
172
ModCompatibility/gradlew
vendored
172
ModCompatibility/gradlew
vendored
|
@ -1,172 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
84
ModCompatibility/gradlew.bat
vendored
84
ModCompatibility/gradlew.bat
vendored
|
@ -1,84 +0,0 @@
|
|||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
: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 %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
|
@ -1 +0,0 @@
|
|||
rootProject.name = "TechRebornModCompatibility-1.12.2"
|
|
@ -1,44 +0,0 @@
|
|||
package techreborn.compat;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.compat.CompatManager;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
@Mod(modid = "techrebornmodcompatibility")
|
||||
public class TRModCompat {
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preinit(FMLPreInitializationEvent event){
|
||||
CompatManager.isIC2Loaded = Loader.isModLoaded("ic2");
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.preInit(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event){
|
||||
// Compat
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.init(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postinit(FMLPostInitializationEvent event){
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.postInit(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event){
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.serverStarting(event);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat;
|
||||
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class CompatConfigs {
|
||||
@ConfigRegistry(config = "compat", category = "buildcraft", key = "ExpensiveQuarryRecipe", comment = "Buildcraft's quarry will require an advanced circuit and diamond drill if enabled")
|
||||
public static boolean expensiveQuarry = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "buildcraft", key = "EnableBuildcraftFuels", comment = "Allow Buildcraft fuels to be used in fuel generators")
|
||||
public static boolean allowBCFuels = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "theoneprobe", key = "EnableTOPSupport", comment = "Display machine info in The One Probe's HUD")
|
||||
public static boolean enableTOP = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "jei", key = "ShowScrabpox", comment = "Show Scrapbox loot in JEI")
|
||||
public static boolean showScrapbox = false;
|
||||
|
||||
}
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistryFactory;
|
||||
import techreborn.compat.compat.buildcraft.BuildcraftBuildersCompat;
|
||||
import techreborn.compat.compat.buildcraft.BuildcraftCompat;
|
||||
import techreborn.compat.compat.crafttweaker.CraftTweakerCompat;
|
||||
import techreborn.compat.compat.ic2.RecipesIC2;
|
||||
import techreborn.compat.compat.immersiveengineering.RecipeImmersiveEngineering;
|
||||
import techreborn.compat.compat.opencomputers.CompatOpenComputers;
|
||||
import techreborn.compat.compat.theoneprobe.TheOneProbeCompat;
|
||||
import techreborn.compat.compat.thermalexpansion.RecipeThermalExpansion;
|
||||
import techreborn.compat.compat.tinkers.CompatModuleTinkers;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CompatManager {
|
||||
|
||||
public static CompatManager INSTANCE = new CompatManager();
|
||||
public static boolean isIC2Loaded = false;
|
||||
public static boolean isQuantumStorageLoaded = false;
|
||||
public ArrayList<ICompatModule> compatModules = new ArrayList<>();
|
||||
|
||||
public CompatManager() {
|
||||
isIC2Loaded = Loader.isModLoaded("ic2");
|
||||
isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage");
|
||||
register(CraftTweakerCompat.class, "crafttweaker");
|
||||
register(CompatModuleTinkers.class, "tconstruct");
|
||||
register(TheOneProbeCompat.class, "theoneprobe");
|
||||
//register(CompatModulePsi.class, "Psi");
|
||||
register(RecipesIC2.class, "ic2");
|
||||
register(BuildcraftBuildersCompat.class, "buildcraftbuilders");
|
||||
register(BuildcraftCompat.class, "buildcraftcore");
|
||||
register(RecipeThermalExpansion.class, "thermalexpansion");
|
||||
register(CompatOpenComputers.class, "opencomputers");
|
||||
register(RecipeImmersiveEngineering.class, "immersiveengineering");
|
||||
}
|
||||
|
||||
public void register(Class<? extends ICompatModule> moduleClass, Object... objs) {
|
||||
registerCompact(moduleClass, true, objs);
|
||||
}
|
||||
|
||||
public void registerCompact(Class<? extends ICompatModule> moduleClass, boolean config, Object... objs) {
|
||||
if(config){
|
||||
if(!shouldLoad(moduleClass.getSimpleName())){
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (Object obj : objs) {
|
||||
if (obj instanceof String) {
|
||||
String modid = (String) obj;
|
||||
if (modid.startsWith("@")) {
|
||||
if (modid.equals("@client")) {
|
||||
if (FMLCommonHandler.instance().getSide() != Side.CLIENT) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (modid.startsWith("!")) {
|
||||
if (Loader.isModLoaded(modid.replaceAll("!", ""))) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Loader.isModLoaded(modid)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (obj instanceof Boolean) {
|
||||
Boolean boo = (Boolean) obj;
|
||||
if (!boo) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
compatModules.add(moduleClass.newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//This is a hack, and is bad. Dont do this.
|
||||
public boolean shouldLoad(String name){
|
||||
ConfigRegistry configRegistry = new ConfigRegistry(){
|
||||
@Override
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String category() {
|
||||
return "modules";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String comment() {
|
||||
return "Should the compat module '" + name + "' be loaded";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String config() {
|
||||
return "compat";
|
||||
}
|
||||
};
|
||||
|
||||
RebornRegistry rebornRegistry = new RebornRegistry(){
|
||||
|
||||
@Override
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modID() {
|
||||
return ModInfo.MOD_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int priority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean earlyReg() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
Configuration configuration = ConfigRegistryFactory.getOrCreateConfig(configRegistry, rebornRegistry);
|
||||
Property property = ConfigRegistryFactory.get(configRegistry.category(), configRegistry.key(), true, configRegistry.comment(), boolean.class, configuration);
|
||||
configuration.save();
|
||||
return property.getBoolean();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
|
||||
public interface ICompatModule {
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event);
|
||||
|
||||
public void init(FMLInitializationEvent event);
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event);
|
||||
|
||||
public void serverStarting(FMLServerStartingEvent event);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.buildcraft;
|
||||
|
||||
import buildcraft.builders.BCBuildersBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import reborncore.common.util.RecipeRemover;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.compat.CompatConfigs;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
public class BuildcraftBuildersCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CompatConfigs.expensiveQuarry) {
|
||||
RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry));
|
||||
RebornCraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry),
|
||||
"IAI", "GIG", "DED",
|
||||
'I', "gearIron",
|
||||
'G', "gearGold",
|
||||
'D', "gearDiamond",
|
||||
'A', "circuitAdvanced",
|
||||
'E', new ItemStack(ModItems.DIAMOND_DRILL));
|
||||
}
|
||||
//The recipebook still knows about the old recipe so crashes, this should update it to have it replaced by the new recipe
|
||||
Core.proxy.rebuildRecipeBook();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.buildcraft;
|
||||
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import buildcraft.lib.fluid.FuelRegistry;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.compat.CompatConfigs;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
public class BuildcraftCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CompatConfigs.allowBCFuels) {
|
||||
for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) {
|
||||
// getPowerPerCycle returns micro mj values
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, fuel.getFluid().getFluid(), (int) (fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100);
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100).setUseOreDict(false);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.alloySmelter")
|
||||
public class CTAlloySmelter extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick)")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.ALLOY_SMELTER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.assemblingMachine")
|
||||
public class CTAssemblingMachine extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.ASSEMBLING_MACHINE_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.blastFurnace")
|
||||
public class CTBlastFurnace extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick, neededHeat);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.BLAST_FURNACE_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.centrifuge")
|
||||
public class CTCentrifuge extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.CENTRIFUGE_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.chemicalReactorRecipe")
|
||||
public class CTChemicalReactor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.CHEMICAL_REACTOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
|
||||
/*
|
||||
* mods.techreborn.compressor.addRecipe(<minecraft:clay>,<minecraft:clay_ball>, 40,100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.compressor")
|
||||
public class CTCompressor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.COMPRESSOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@ZenClass("mods.techreborn.distillationTower")
|
||||
public class CTDistillationTower extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
DistillationTowerRecipe r = new DistillationTowerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.DISTILLATION_TOWER_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.extractor.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
|
||||
*/
|
||||
@ZenClass("mods.techreborn.extractor")
|
||||
public class CTExtractor extends CTGeneric {
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
ExtractorRecipe r = new ExtractorRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.EXTRACTOR_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
|
||||
@ZenClass("mods.techreborn.fluidGen")
|
||||
public class CTFluidGen {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addThermalFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.THERMAL, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addGasFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.GAS, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addSemiFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.SEMIFLUID, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addDieselFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.DIESEL, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addPlasmaFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.PLASMA, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeThermalFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.THERMAL, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeGasFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.GAS, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeSemiFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.SEMIFLUID, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeDieselFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.DIESEL, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removePlasmaFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.PLASMA, fluid);
|
||||
}
|
||||
|
||||
private static void addFluid(EFluidGenerator type, ILiquidStack fluid, int energyPerMb) {
|
||||
GeneratorRecipeHelper.registerFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid(), energyPerMb);
|
||||
}
|
||||
|
||||
private static void removeFluid(EFluidGenerator type, ILiquidStack fluid) {
|
||||
GeneratorRecipeHelper.removeFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid());
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@ZenClass("mods.techreborn.fluidReplicator")
|
||||
public class CTFluidReplicator {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("int input, ILiquidStack output, int ticks, int euPerTick")
|
||||
public static void addRecipe(int input, ILiquidStack output, int ticks, int euPerTick) {
|
||||
if (input > 0 || ticks > 0 || euPerTick > 0) {
|
||||
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(input,
|
||||
CraftTweakerCompat.toFluidStack(output).getFluid(), ticks, euPerTick));
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeRecipe(ILiquidStack output) {
|
||||
Optional<FluidReplicatorRecipe> recipe = FluidReplicatorRecipeList
|
||||
.getRecipeForFluid(CraftTweakerCompat.toFluidStack(output).getFluid());
|
||||
if (recipe.isPresent()) {
|
||||
FluidReplicatorRecipeList.removeRecipe(recipe.get());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,181 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ZenClass("mods.techreborn.fusionReactor")
|
||||
public class CTFusionReactor {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime")
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
|
||||
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) CraftTweakerCompat.toObject(topInput), (ItemStack) CraftTweakerCompat.toObject(bottomInput), CraftTweakerCompat.toStack(output), startEU, euTick, tickTime);
|
||||
CraftTweakerAPI.apply(new Add(reactorRecipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeTopInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeBottomInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveBottomInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
private static class Add implements IAction {
|
||||
private final FusionReactorRecipe recipe;
|
||||
|
||||
public Add(FusionReactorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IAction {
|
||||
private final ItemStack output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(), output, true, false)) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class RemoveTopInput implements IAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveTopInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getTopInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveBottomInput implements IAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveBottomInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getBottomInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveAll implements IAction {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.reactorRecipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Fusion Reactor recipes";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.recipe.IBaseRecipeType;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CTGeneric {
|
||||
|
||||
public static void addRecipe(BaseRecipe recipe) {
|
||||
CraftTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
private static class Add implements IAction {
|
||||
private final BaseRecipe recipe;
|
||||
|
||||
public Add(BaseRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Remove implements IAction {
|
||||
private final ItemStack output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public Remove(ItemStack output, String machineName) {
|
||||
this.output = output;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
public static class RemoveInput implements IAction {
|
||||
private final IIngredient ingredient;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveInput(IIngredient ingredient, String machineName) {
|
||||
this.ingredient = ingredient;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (Object recipeInput : recipeType.getInputs()) {
|
||||
ItemStack ingredientStack = CraftTweakerMC.getItemStack(ingredient);
|
||||
if (!ingredientStack.isEmpty()) {
|
||||
if (ItemUtils.isInputEqual(recipeInput, ingredientStack, true, false, true)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
//Old method of checking, just in case
|
||||
} else if(recipeInput instanceof ItemStack && ingredient.matches(CraftTweakerMC.getIItemStack((ItemStack) recipeInput))){
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class RemoveAll implements IAction {
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveAll(String machineName) {
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all recipes from " + name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.grinder.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.grinder")
|
||||
public class CTGrinder extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
GrinderRecipe r = new GrinderRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.GRINDER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.implosionCompressor")
|
||||
public class CTImplosionCompressor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.IMPLOSION_COMPRESSOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialElectrolyzer")
|
||||
public class CTIndustrialElectrolyzer extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(cells);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_ELECTROLYZER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
|
||||
/**
|
||||
* Craftweaker class to change Industrial Grinder recipes.
|
||||
*/
|
||||
@ZenClass("mods.techreborn.industrialGrinder")
|
||||
public class CTIndustrialGrinder extends CTGeneric {
|
||||
|
||||
/**
|
||||
* Add recipe for Industrial Grinder
|
||||
* @param output1 ItemStack First recipe output
|
||||
* @param output2 ItemStack Second recipe output
|
||||
* @param output3 ItemStack Third recipe output
|
||||
* @param output4 ItemStack Fourth recipe output
|
||||
* @param input1 First recipe input
|
||||
* @param input2 Second recipe input. Not used )
|
||||
* @param ticktime Amount of ticks to complete crafting
|
||||
* @param euTick Amount of EU per tick consumed during crafting
|
||||
* @return RecipeSettings RecipeSettings for this recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add recipe for Industrial Grinder
|
||||
* @param output1 ItemStack First recipe output
|
||||
* @param output2 ItemStack Second recipe output
|
||||
* @param output3 ItemStack Third recipe output
|
||||
* @param output4 ItemStack Fourth recipe output
|
||||
* @param input1 First recipe input
|
||||
* @param input2 Second recipe input. Not used )
|
||||
* @param fluid LiquidStack Liquid used for grinding
|
||||
* @param ticktime Amount of ticks to complete crafting
|
||||
* @param euTick Amount of EU per tick consumed during crafting
|
||||
* @return RecipeSettings RecipeSettings for this recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
// There is only one input slot in Industrial Grinder
|
||||
//ItemStack oInput2 = (ItemStack) CraftTweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove recipe for Industrial Grinder based on input ingredient
|
||||
* @param iIngredient Recipe input for which we should remove recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) { CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName())); }
|
||||
|
||||
/**
|
||||
* Remove recipe for Industrial Grinder based on output
|
||||
* @param output Recipe output for which we should remove recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get reference machine name
|
||||
* @return String Reference name for Industrial Grinder
|
||||
*/
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_GRINDER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialSawmill")
|
||||
public class CTIndustrialSawmill extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) {
|
||||
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_SAWMILL_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import gnu.trove.set.TCharSet;
|
||||
import gnu.trove.set.hash.TCharHashSet;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ZenClass("mods.techreborn.rollingMachine")
|
||||
public class CTRollingMachine {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient[][] ingredients")
|
||||
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
TechRebornAPI.addRollingOreMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toShapedObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient[] ingredients")
|
||||
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
|
||||
TechRebornAPI.addShapelessOreRollingMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
List<ResourceLocation> toRemove = new ArrayList<>();
|
||||
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
|
||||
if (ItemUtils.isItemEqual(recipe.getValue().getRecipeOutput(), CraftTweakerCompat.toStack(output), true, false)) {
|
||||
toRemove.add(recipe.getKey());
|
||||
}
|
||||
}
|
||||
for (ResourceLocation resourceLocation : toRemove) {
|
||||
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
private static class RemoveAll implements IAction{
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RollingMachineRecipe.instance.getRecipeList().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Rolling Machine recipes";
|
||||
}
|
||||
}
|
||||
|
||||
//Stolen from https://github.com/jaredlll08/MTLib/blob/1.12/src/main/java/com/blamejared/mtlib/helpers/InputHelper.java#L170-L213
|
||||
//License as seen here: https://github.com/jaredlll08/MTLib/blob/1.12/LICENSE.md (MIT at time of writing)
|
||||
public static Object[] toShapedObjects(IIngredient[][] ingredients) {
|
||||
if (ingredients == null)
|
||||
return null;
|
||||
else {
|
||||
ArrayList<Object> prep = new ArrayList<>();
|
||||
TCharSet usedCharSet = new TCharHashSet();
|
||||
|
||||
prep.add("abc");
|
||||
prep.add("def");
|
||||
prep.add("ghi");
|
||||
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
|
||||
for (int x = 0; x < ingredients.length; x++) {
|
||||
if (ingredients[x] != null) {
|
||||
for (int y = 0; y < ingredients[x].length; y++) {
|
||||
if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
|
||||
prep.add(map[x][y]);
|
||||
usedCharSet.add(map[x][y]);
|
||||
prep.add(CraftTweakerCompat.toObject(ingredients[x][y]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (prep.get(i) instanceof String) {
|
||||
String s = (String) prep.get(i);
|
||||
for (int j = 0; j < 3; j++) {
|
||||
char c = s.charAt(j);
|
||||
if (usedCharSet.contains(c)) {
|
||||
sb.append(c);
|
||||
} else {
|
||||
sb.append(" ");
|
||||
}
|
||||
}
|
||||
prep.set(i, sb.toString());
|
||||
}
|
||||
}
|
||||
return prep.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object[] toObjects(IIngredient[] ingredient) {
|
||||
if (ingredient == null)
|
||||
return null;
|
||||
else {
|
||||
Object[] output = new Object[ingredient.length];
|
||||
for (int i = 0; i < ingredient.length; i++) {
|
||||
if (ingredient[i] != null) {
|
||||
output[i] = CraftTweakerCompat.toObject(ingredient[i]);
|
||||
} else
|
||||
output[i] = "";
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ScrapboxRecipe;
|
||||
import techreborn.compat.compat.crafttweaker.CTGeneric.Remove;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
@ZenClass("mods.techreborn.scrapbox")
|
||||
public class CTScrapbox {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient input")
|
||||
public static void addScrapboxDrop(IIngredient input) {
|
||||
RecipeHandler.addRecipe(new ScrapboxRecipe(CraftTweakerMC.getItemStack(input), 20, 2));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.SCRAPBOX_RECIPE;
|
||||
}
|
||||
|
||||
public static class RemoveAll implements IAction {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.recipeList.removeAll(RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Scrapbox recipies";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.vacuumFreezer")
|
||||
public class CTVacuumFreezer extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input);
|
||||
|
||||
VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.VACUUM_FREEZER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.item.IngredientStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import crafttweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
import static crafttweaker.api.minecraft.CraftTweakerMC.getItemStack;
|
||||
import static crafttweaker.api.minecraft.CraftTweakerMC.getLiquidStack;
|
||||
|
||||
public class CraftTweakerCompat implements ICompatModule {
|
||||
public static ItemStack toStack(IItemStack iStack) {
|
||||
if (iStack == null){
|
||||
return null;
|
||||
}
|
||||
return getItemStack(iStack);
|
||||
}
|
||||
|
||||
public static Object toObject(IIngredient iStack) {
|
||||
if (iStack == null)
|
||||
return null;
|
||||
else {
|
||||
if (iStack instanceof IOreDictEntry)
|
||||
return ((IOreDictEntry) iStack).getName();
|
||||
else if (iStack instanceof IItemStack)
|
||||
return getItemStack((IItemStack) iStack);
|
||||
else if (iStack instanceof IngredientStack) {
|
||||
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
|
||||
return toObject(ingr);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static FluidStack toFluidStack(ILiquidStack iStack) {
|
||||
return getLiquidStack(iStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
CraftTweakerAPI.registerClass(CTAlloySmelter.class);
|
||||
CraftTweakerAPI.registerClass(CTAssemblingMachine.class);
|
||||
CraftTweakerAPI.registerClass(CTBlastFurnace.class);
|
||||
CraftTweakerAPI.registerClass(CTCentrifuge.class);
|
||||
CraftTweakerAPI.registerClass(CTChemicalReactor.class);
|
||||
CraftTweakerAPI.registerClass(CTCompressor.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialGrinder.class);
|
||||
CraftTweakerAPI.registerClass(CTImplosionCompressor.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialElectrolyzer.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialSawmill.class);
|
||||
CraftTweakerAPI.registerClass(CTFusionReactor.class);
|
||||
CraftTweakerAPI.registerClass(CTVacuumFreezer.class);
|
||||
CraftTweakerAPI.registerClass(CTFluidGen.class);
|
||||
CraftTweakerAPI.registerClass(CTRollingMachine.class);
|
||||
CraftTweakerAPI.registerClass(CTScrapbox.class);
|
||||
CraftTweakerAPI.registerClass(CTDistillationTower.class);
|
||||
CraftTweakerAPI.registerClass(CTGrinder.class);
|
||||
CraftTweakerAPI.registerClass(CTExtractor.class);
|
||||
CraftTweakerAPI.registerClass(CTFluidReplicator.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.RecipeSettings")
|
||||
public class RecipeSettings {
|
||||
|
||||
private BaseRecipe baseRecipe;
|
||||
|
||||
public RecipeSettings(BaseRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("boolean useOreDict")
|
||||
public void setUseOreDict(boolean useOreDict){
|
||||
baseRecipe.setOreDict(useOreDict);
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.crafttweaker;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This is used to give better detail for a method's parameters when generating the crafttweaker documentation.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface ZenDocumentation {
|
||||
|
||||
String value();
|
||||
|
||||
}
|
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.ic2;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.ref.ItemName;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.init.recipes.RecipeMethods;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Mark on 06/06/2016.
|
||||
*/
|
||||
public class RecipesIC2 implements ICompatModule {
|
||||
|
||||
List<RecipeDuplicate> recipeDuplicateList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// LOW is used as we want it to load as late as possible, but before crafttweaker
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),
|
||||
IC2Items.getItem("resource", "machine")));
|
||||
|
||||
for (RecipeDuplicate duplicate : recipeDuplicateList) {
|
||||
duplicate.add();
|
||||
}
|
||||
|
||||
RebornCraftingHelper.addShapelessRecipe(ItemParts.getPartByName("rubber"),
|
||||
IC2Items.getItem("crafting", "rubber"));
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("crafting", "rubber"),
|
||||
ItemParts.getPartByName("rubber"));
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("electric_wrench"), new ItemStack(ModItems.WRENCH),
|
||||
IC2Items.getItem("crafting", "small_power_unit"));
|
||||
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "carbon_mesh"),
|
||||
IC2Items.getItem("crafting", "carbon_plate"), 300, 4));
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "coal_ball"),
|
||||
IC2Items.getItem("crafting", "coal_block"), 300, 4));
|
||||
|
||||
RecipeHandler.addRecipe(new GrinderRecipe(ItemName.crafting.getItemStack("tin_can"),
|
||||
RecipeMethods.getOre("dustTin", 2), 300, 16));
|
||||
|
||||
RecipeHandler.addRecipe(new ExtractorRecipe(ItemName.filled_tin_can.getItemStack(),
|
||||
ItemName.crafting.getItemStack("tin_can"), 300, 16));
|
||||
}
|
||||
|
||||
public class RecipeDuplicate {
|
||||
ItemStack stack1;
|
||||
ItemStack stack2;
|
||||
|
||||
public RecipeDuplicate(ItemStack stack1, ItemStack stack2) {
|
||||
this.stack1 = stack1;
|
||||
this.stack2 = stack2;
|
||||
}
|
||||
|
||||
public void add() {
|
||||
RebornCraftingHelper.addShapelessRecipe(stack2, stack1);
|
||||
RebornCraftingHelper.addShapelessRecipe(stack1, stack2);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.immersiveengineering;
|
||||
|
||||
|
||||
import blusunrize.immersiveengineering.common.IEContent;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
public class RecipeImmersiveEngineering implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, IEContent.fluidCreosote, 40);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> implements IRecipeWrapper {
|
||||
protected final T baseRecipe;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> inputs;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> outputs;
|
||||
|
||||
public BaseRecipeWrapper(T baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
|
||||
inputs = new ArrayList<>();
|
||||
outputs = new ArrayList<>();
|
||||
for (Object input : baseRecipe.getInputs()) {
|
||||
if (input instanceof ItemStack) {
|
||||
ItemStack stack = (ItemStack) input;
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(stack);
|
||||
inputs.add(oreDictInputs);
|
||||
} else {
|
||||
inputs.add(Collections.singletonList(stack));
|
||||
}
|
||||
} else if (input instanceof String) {
|
||||
inputs.add(OreDictionary.getOres((String) input));
|
||||
}
|
||||
}
|
||||
for (ItemStack input : baseRecipe.getOutputs()) {
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(input);
|
||||
outputs.add(oreDictInputs);
|
||||
} else {
|
||||
outputs.add(Collections.singletonList(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ItemStack> expandOreDict(ItemStack itemStack) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(itemStack);
|
||||
if (oreIds.length == 0) {
|
||||
return Collections.singletonList(itemStack);
|
||||
}
|
||||
|
||||
Set<ItemStack> itemStackSet = new HashSet<>();
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||
for (ItemStack ore : ores) {
|
||||
if (ore.getCount() != itemStack.getCount()) {
|
||||
ItemStack oreCopy = ore.copy();
|
||||
oreCopy.setCount(itemStack.getCount());
|
||||
itemStackSet.add(oreCopy);
|
||||
} else {
|
||||
itemStackSet.add(ore);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(itemStackSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
ingredients.setOutputs(ItemStack.class, baseRecipe.getOutputs());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs() {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (List<ItemStack> stackList : outputs) {
|
||||
stacks.addAll(stackList);
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei;
|
||||
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
|
||||
|
||||
private final String containerName, recipeCategory;
|
||||
|
||||
private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount;
|
||||
|
||||
public BuiltContainerTransferInfo(final String containerName, final String recipeCategory,
|
||||
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
|
||||
final int inventorySlotCount) {
|
||||
this.containerName = containerName;
|
||||
this.recipeCategory = recipeCategory;
|
||||
|
||||
this.recipeSlotStart = recipeSlotStart;
|
||||
this.recipeSlotCount = recipeSlotCount;
|
||||
|
||||
this.inventorySlotStart = inventorySlotStart;
|
||||
this.inventorySlotCount = inventorySlotCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<BuiltContainer> getContainerClass() {
|
||||
return BuiltContainer.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return this.recipeCategory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(final BuiltContainer container) {
|
||||
return container.getName().equals(this.containerName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> getRecipeSlots(final BuiltContainer container) {
|
||||
final List<Slot> slots = new ArrayList<>();
|
||||
for (int i = this.recipeSlotStart; i < this.recipeSlotStart + this.recipeSlotCount; i++)
|
||||
slots.add(container.getSlot(i));
|
||||
return slots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> getInventorySlots(final BuiltContainer container) {
|
||||
final List<Slot> slots = new ArrayList<>();
|
||||
for (int i = this.inventorySlotStart; i < this.inventorySlotStart + this.inventorySlotCount; i++)
|
||||
slots.add(container.getSlot(i));
|
||||
return slots;
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei;
|
||||
|
||||
public class RecipeCategoryUids {
|
||||
public static final String ALLOY_SMELTER = "TechReborn.AlloySmelter";
|
||||
public static final String ASSEMBLING_MACHINE = "TechReborn.AssemblingMachine";
|
||||
public static final String BLAST_FURNACE = "TechReborn.BlastFurnace";
|
||||
public static final String CENTRIFUGE = "TechReborn.Centrifuge";
|
||||
public static final String CHEMICAL_REACTOR = "TechReborn.ChemicalReactor";
|
||||
public static final String FUSION_REACTOR = "TechReborn.FusionReactor";
|
||||
public static final String INDUSTRIAL_GRINDER = "TechReborn.IndustrialGrinder";
|
||||
public static final String IMPLOSION_COMPRESSOR = "TechReborn.ImplosionCompressor";
|
||||
public static final String INDUSTRIAL_ELECTROLYZER = "TechReborn.IndustrialElectrolyzer";
|
||||
public static final String ROLLING_MACHINE = "TechReborn.RollingMachine";
|
||||
public static final String VACUUM_FREEZER = "TechReborn.VacuumFreezer";
|
||||
public static final String GRINDER = "TechReborn.Grinder";
|
||||
public static final String EXTRACTOR = "TechReborn.Extractor";
|
||||
public static final String COMPRESSOR = "TechReborn.Compressor";
|
||||
public static final String SCRAPBOX = "TechReborn.Scrapbox";
|
||||
public static final String INDUSTRIAL_SAWMILL = "TechReborn.IndustrialSawmill";
|
||||
public static final String DISTILLATION_TOWER = "TechReborn.DistillationTower";
|
||||
public static final String FLUID_REPLICATOR = "TechReborn.FluidReplicator";
|
||||
|
||||
private RecipeCategoryUids() {
|
||||
}
|
||||
}
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei;
|
||||
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.StringUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RecipeUtil {
|
||||
private static final int color = Color.darkGray.getRGB();
|
||||
|
||||
private RecipeUtil() {
|
||||
}
|
||||
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double startCost,
|
||||
final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
int lineSpacing = fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
String startCostEU = PowerSystem.getLocaliszedPower(startCost);
|
||||
//String startCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
String startCostString = StringUtils.t("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
fontRenderer.drawString(startCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
drawInfo(minecraft, x, y, euPerTick, tickTime);
|
||||
}
|
||||
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
int lineSpacing = fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
String runningCostString = StringUtils.t("techreborn.jei.recipe.running.cost", PowerSystem.getDisplayPower().abbreviation.toUpperCase(), PowerSystem.getLocaliszedPowerFormattedNoSuffix(euPerTick));
|
||||
//String runningCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.running.cost",PowerSystem.getDisplayPower().abbreviation.toUpperCase(), PowerSystem.getLocaliszedPowerFormattedNoSuffix(euPerTick));
|
||||
fontRenderer.drawString(runningCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
// String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
String processingTimeString1 = StringUtils.t("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
fontRenderer.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
//String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
String processingTimeString2 = StringUtils.t("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
fontRenderer.drawString(processingTimeString2, x + 10, y, color);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BaseRecipeWrapper<?> recipe,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = recipe.getInputs();
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null) {
|
||||
List<ItemStack> outputs = recipe.getOutputs();
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null) {
|
||||
List<FluidStack> fluidInputs = recipe.getFluidInputs();
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 1.11
|
||||
// if (fluidOutputSlots != null) {
|
||||
// List<FluidStack> fluidOutputs = recipe.getFluidOutputs();
|
||||
// for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
// int outputTank = fluidOutputSlots[i];
|
||||
// guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IIngredients ingredients,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null) {
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null) {
|
||||
List<List<FluidStack>> fluidInputs = ingredients.getInputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidOutputSlots != null) {
|
||||
List<List<FluidStack>> fluidOutputs = ingredients.getOutputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
int outputTank = fluidOutputSlots[i];
|
||||
guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,506 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei;
|
||||
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.gui.IAdvancedGuiHandler;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
|
||||
import mezz.jei.collect.ListMultiMap;
|
||||
import mezz.jei.config.Config;
|
||||
import mezz.jei.gui.TooltipRenderer;
|
||||
import mezz.jei.gui.recipes.RecipeClickableArea;
|
||||
import mezz.jei.util.ErrorUtil;
|
||||
import mezz.jei.util.Translator;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.machines.*;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.client.gui.slot.GuiSlotConfiguration;
|
||||
import techreborn.compat.compat.CompatConfigs;
|
||||
import techreborn.compat.compat.CompatManager;
|
||||
import techreborn.compat.compat.jei.alloySmelter.AlloySmelterRecipeCategory;
|
||||
import techreborn.compat.compat.jei.alloySmelter.AlloySmelterRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.assemblingMachine.AssemblingMachineRecipeCategory;
|
||||
import techreborn.compat.compat.jei.assemblingMachine.AssemblingMachineRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.blastFurnace.BlastFurnaceRecipeCategory;
|
||||
import techreborn.compat.compat.jei.blastFurnace.BlastFurnaceRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.centrifuge.CentrifugeRecipeCategory;
|
||||
import techreborn.compat.compat.jei.centrifuge.CentrifugeRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.chemicalReactor.ChemicalReactorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.chemicalReactor.ChemicalReactorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.compressor.CompressorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.compressor.CompressorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.distillationTower.DistillationTowerRecipeCategory;
|
||||
import techreborn.compat.compat.jei.distillationTower.DistillationTowerRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.extractor.ExtractorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.extractor.ExtractorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.fluidReplicator.FluidReplicatorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.fluidReplicator.FluidReplicatorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.fusionReactor.FusionReactorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.generators.fluid.FluidGeneratorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.generators.fluid.FluidGeneratorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.grinder.GrinderRecipeCategory;
|
||||
import techreborn.compat.compat.jei.grinder.GrinderRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.implosionCompressor.ImplosionCompressorRecipeCategory;
|
||||
import techreborn.compat.compat.jei.implosionCompressor.ImplosionCompressorRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeCategory;
|
||||
import techreborn.compat.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.industrialGrinder.IndustrialGrinderRecipeCategory;
|
||||
import techreborn.compat.compat.jei.industrialGrinder.IndustrialGrinderRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.industrialSawmill.IndustrialSawmillRecipeCategory;
|
||||
import techreborn.compat.compat.jei.industrialSawmill.IndustrialSawmillRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.rollingMachine.RollingMachineRecipeCategory;
|
||||
import techreborn.compat.compat.jei.rollingMachine.RollingMachineRecipeMaker;
|
||||
import techreborn.compat.compat.jei.rollingMachine.RollingMachineRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.scrapbox.ScrapboxRecipeCategory;
|
||||
import techreborn.compat.compat.jei.scrapbox.ScrapboxRecipeWrapper;
|
||||
import techreborn.compat.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
|
||||
import techreborn.compat.compat.jei.vacuumFreezer.VacuumFreezerRecipeWrapper;
|
||||
import techreborn.dispenser.BehaviorDispenseScrapbox;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin implements IModPlugin {
|
||||
|
||||
public static final ListMultiMap<Class<? extends GuiContainer>, RecipeClickableArea> recipeClickableAreas = new ListMultiMap<>();
|
||||
|
||||
static IRecipesGui recipesGui;
|
||||
|
||||
static {
|
||||
MinecraftForge.EVENT_BUS.register(TechRebornJeiPlugin.class);
|
||||
}
|
||||
|
||||
private static void addDebugRecipes(IModRegistry registry) {
|
||||
ItemStack diamondBlock = new ItemStack(Blocks.DIAMOND_BLOCK);
|
||||
ItemStack dirtBlock = new ItemStack(Blocks.DIRT);
|
||||
List<Object> debugRecipes = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock,
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(assemblingMachineRecipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
debugRecipes.clear();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock,
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(recipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes, RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCategories(IRecipeCategoryRegistration registry) {
|
||||
final IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
final IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new AssemblingMachineRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new BlastFurnaceRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new CentrifugeRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ChemicalReactorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new DistillationTowerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new FusionReactorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new GrinderRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ImplosionCompressorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialGrinderRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialElectrolyzerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialSawmillRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new RollingMachineRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new VacuumFreezerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new FluidReplicatorRecipeCategory(guiHelper));
|
||||
|
||||
for (EFluidGenerator type : EFluidGenerator.values())
|
||||
registry.addRecipeCategories(new FluidGeneratorRecipeCategory(type, guiHelper));
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.addRecipeCategories(new ScrapboxRecipeCategory(guiHelper));
|
||||
}
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registry.addRecipeCategories(new CompressorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ExtractorRecipeCategory(guiHelper));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
final IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_BERYLLIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CALCIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CALCIUM_CARBONATE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CHLORITE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_DEUTERIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_GLYCERYL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUM_3));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUMPLASMA));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HYDROGEN));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_LITHIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_MERCURY));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_METHANE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROCOAL_FUEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROFUEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROGEN));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROGENDIOXIDE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_POTASSIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SILICON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUMPERSULFATE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_TRITIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_WOLFRAMIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SULFUR));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SULFURIC_ACID));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CARBON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CARBON_FIBER));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITRO_CARBON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUM_SULFIDE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_DIESEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITRO_DIESEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_OIL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_ELECTROLYZED_WATER));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_COMPRESSED_AIR));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.MISSING_RECIPE_PLACEHOLDER));
|
||||
|
||||
if (CompatManager.isQuantumStorageLoaded) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.QUANTUM_CHEST));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.QUANTUM_TANK));
|
||||
}
|
||||
|
||||
if (IC2Duplicates.deduplicate()) {
|
||||
for (IC2Duplicates duplicate : IC2Duplicates.values()) {
|
||||
if (duplicate.hasIC2Stack()) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(duplicate.getTrStack());
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < EnumCableType.values().length; i++) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.CABLE, 1, i));
|
||||
}
|
||||
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("rubber"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("rubberSap"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("electronicCircuit"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("advancedCircuit"));
|
||||
if (!Core.worldGen.config.rubberTreeConfig.shouldSpawn) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_SAPLING));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_LOG));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_PLANKS));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_LEAVES));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.TREE_TAP));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.ELECTRIC_TREE_TAP));
|
||||
}
|
||||
}
|
||||
|
||||
registry.handleRecipes(AlloySmelterRecipe.class, recipe -> new AlloySmelterRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.handleRecipes(AssemblingMachineRecipe.class, recipe -> new AssemblingMachineRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.handleRecipes(BlastFurnaceRecipe.class, recipe -> new BlastFurnaceRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.handleRecipes(CentrifugeRecipe.class, recipe -> new CentrifugeRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.handleRecipes(ChemicalReactorRecipe.class, recipe -> new ChemicalReactorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.handleRecipes(FusionReactorRecipe.class, FusionReactorRecipeWrapper::new, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.handleRecipes(GrinderRecipe.class, recipe -> new GrinderRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.GRINDER);
|
||||
registry.handleRecipes(ImplosionCompressorRecipe.class, recipe -> new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.handleRecipes(IndustrialElectrolyzerRecipe.class, recipe -> new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.handleRecipes(IndustrialGrinderRecipe.class, recipe -> new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.handleRecipes(IndustrialSawmillRecipe.class, recipe -> new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.handleRecipes(VacuumFreezerRecipe.class, recipe -> new VacuumFreezerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.handleRecipes(DistillationTowerRecipe.class, recipe -> new DistillationTowerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
registry.handleRecipes(FluidReplicatorRecipe.class, recipe -> new FluidReplicatorRecipeWrapper(jeiHelpers,recipe), RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
registry.handleRecipes(ShapelessRecipes.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapedRecipes.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapedOreRecipe.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapelessOreRecipe.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
|
||||
for (EFluidGenerator type : EFluidGenerator.values()) {
|
||||
registry.handleRecipes(FluidGeneratorRecipe.class, recipe -> new FluidGeneratorRecipeWrapper(jeiHelpers, recipe), type.getRecipeID());
|
||||
}
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.handleRecipes(ScrapboxRecipe.class, recipe -> new ScrapboxRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.SCRAPBOX);
|
||||
}
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registry.handleRecipes(CompressorRecipe.class, recipe -> new CompressorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.handleRecipes(ExtractorRecipe.class, recipe -> new ExtractorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.EXTRACTOR);
|
||||
}
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList.stream().filter(recipe -> {
|
||||
if (recipe instanceof ScrapboxRecipe) {
|
||||
return CompatConfigs.showScrapbox;
|
||||
}
|
||||
return true;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipes(FluidReplicatorRecipeList.recipes, RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
GeneratorRecipeHelper.fluidRecipes.forEach((type, list) -> registry.addRecipes(list.getRecipes(), type.getRecipeID()));
|
||||
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
} catch (final RuntimeException e) {
|
||||
Core.logHelper
|
||||
.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (Config.isDebugModeEnabled()) {
|
||||
TechRebornJeiPlugin.addDebugRecipes(registry);
|
||||
}
|
||||
|
||||
registry.addIngredientInfo(ItemParts.getPartByName("rubberSap"), ItemStack.class, StringUtils.t("techreborn.desc.rubberSap"));
|
||||
if (!BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||
registry.addIngredientInfo(new ItemStack(ModItems.SCRAP_BOX), ItemStack.class, StringUtils.t("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
registry.addIngredientInfo(new ItemStack(ModItems.SCRAP_BOX), ItemStack.class, StringUtils.t("techreborn.desc.scrapBox"));
|
||||
}
|
||||
|
||||
//NEW ONES
|
||||
addRecipeClickArea(GuiCentrifuge.class, 150, 4, 20, 12, RecipeCategoryUids.CENTRIFUGE);
|
||||
addRecipeClickArea(GuiElectricFurnace.class, 150, 4, 20, 12, VanillaRecipeCategoryUid.SMELTING);
|
||||
addRecipeClickArea(GuiGenerator.class, 150, 4, 20, 12, VanillaRecipeCategoryUid.FUEL);
|
||||
addRecipeClickArea(GuiExtractor.class, 150, 4, 20, 12, RecipeCategoryUids.EXTRACTOR);
|
||||
addRecipeClickArea(GuiCompressor.class, 150, 4, 20, 12, RecipeCategoryUids.COMPRESSOR);
|
||||
addRecipeClickArea(GuiGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.GRINDER);
|
||||
addRecipeClickArea(GuiVacuumFreezer.class, 150, 4, 20, 12, RecipeCategoryUids.VACUUM_FREEZER);
|
||||
addRecipeClickArea(GuiBlastFurnace.class, 150, 4, 20, 12, RecipeCategoryUids.BLAST_FURNACE);
|
||||
addRecipeClickArea(GuiChemicalReactor.class, 150, 4, 20, 12, RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
addRecipeClickArea(GuiImplosionCompressor.class, 150, 4, 20, 12, RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
addRecipeClickArea(GuiIndustrialGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
addRecipeClickArea(GuiIndustrialSawmill.class, 150, 4, 20, 15, RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
addRecipeClickArea(GuiIndustrialElectrolyzer.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
addRecipeClickArea(GuiSemifluidGenerator.class, 150, 4, 18, 18, EFluidGenerator.SEMIFLUID.getRecipeID());
|
||||
addRecipeClickArea(GuiDieselGenerator.class, 150, 4, 18, 18, EFluidGenerator.DIESEL.getRecipeID());
|
||||
addRecipeClickArea(GuiGasTurbine.class, 150, 4, 18, 18, EFluidGenerator.GAS.getRecipeID());
|
||||
addRecipeClickArea(GuiThermalGenerator.class, 150, 4, 18, 18, EFluidGenerator.THERMAL.getRecipeID());
|
||||
addRecipeClickArea(GuiAlloySmelter.class, 150, 4, 18, 18, RecipeCategoryUids.ALLOY_SMELTER);
|
||||
addRecipeClickArea(GuiPlasmaGenerator.class, 150, 4, 18, 18, EFluidGenerator.PLASMA.getRecipeID());
|
||||
addRecipeClickArea(GuiDistillationTower.class, 150, 4, 18, 18, RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
addRecipeClickArea(GuiScrapboxinator.class, 150, 4, 18, 18, RecipeCategoryUids.SCRAPBOX);
|
||||
addRecipeClickArea(GuiFusionReactor.class, 150, 4, 18, 18, RecipeCategoryUids.FUSION_REACTOR);
|
||||
addRecipeClickArea(GuiRollingMachine.class, 150, 4, 20, 12, RecipeCategoryUids.ROLLING_MACHINE);
|
||||
addRecipeClickArea(GuiFluidReplicator.class, 150, 4, 20, 12, RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
addRecipeClickArea(GuiAssemblingMachine.class, 150, 4, 20, 12, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
|
||||
//OLD ONES
|
||||
addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IRON_FURNACE), VanillaRecipeCategoryUid.SMELTING, VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IRON_ALLOY_FURNACE), RecipeCategoryUids.ALLOY_SMELTER, VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.SOLID_FUEL_GENEREATOR), VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.SEMI_FLUID_GENERATOR), EFluidGenerator.SEMIFLUID.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GAS_TURBINE), EFluidGenerator.GAS.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.DIESEL_GENERATOR), EFluidGenerator.DIESEL.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.THERMAL_GENERATOR), EFluidGenerator.THERMAL.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.COMPRESSOR), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.EXTRACTOR), RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GRINDER), RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.VACUUM_FREEZER), RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ELECTRIC_FURNACE), VanillaRecipeCategoryUid.SMELTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ALLOY_SMELTER), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ASSEMBLY_MACHINE), RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.CHEMICAL_REACTOR), RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.FUSION_CONTROL_COMPUTER), RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IMPLOSION_COMPRESSOR), RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_GRINDER), RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_SAWMILL), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ROLLING_MACHINE), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.DISTILLATION_TOWER), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.FLUID_REPLICATOR), RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.addRecipeCatalyst(new ItemStack(ModItems.SCRAP_BOX), RecipeCategoryUids.SCRAPBOX);
|
||||
}
|
||||
|
||||
final IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("fusionreactor", RecipeCategoryUids.FUSION_REACTOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialelectrolyzer", RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialgrinder", RecipeCategoryUids.GRINDER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("implosioncompressor", RecipeCategoryUids.IMPLOSION_COMPRESSOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("vacuumfreezer", RecipeCategoryUids.VACUUM_FREEZER, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("blastfurnace", RecipeCategoryUids.BLAST_FURNACE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloyfurnace", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloyfurnace", VanillaRecipeCategoryUid.FUEL, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloysmelter", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("assemblingmachine", RecipeCategoryUids.ASSEMBLING_MACHINE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("chemicalreactor", RecipeCategoryUids.CHEMICAL_REACTOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("centrifuge", RecipeCategoryUids.CENTRIFUGE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("grinder", RecipeCategoryUids.GRINDER, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("extractor", RecipeCategoryUids.EXTRACTOR, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("compressor", RecipeCategoryUids.COMPRESSOR, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialsawmill", RecipeCategoryUids.INDUSTRIAL_SAWMILL, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("distillationtower", RecipeCategoryUids.DISTILLATION_TOWER, 36, 2, 0, 36));
|
||||
|
||||
registry.addAdvancedGuiHandlers(new AdvancedGuiHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
|
||||
recipesGui = jeiRuntime.getRecipesGui();
|
||||
}
|
||||
|
||||
public static class AdvancedGuiHandler implements IAdvancedGuiHandler<GuiBase> {
|
||||
|
||||
@Override
|
||||
public Class<GuiBase> getGuiContainerClass() {
|
||||
return GuiBase.class;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<Rectangle> getGuiExtraAreas(GuiBase guiContainer) {
|
||||
return GuiSlotConfiguration.getExtraSpace(guiContainer);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getIngredientUnderMouse(GuiBase guiContainer, int mouseX, int mouseY) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//Taken from JEI so we can have a custom impliemntation of it
|
||||
//This is done as I didnt see an easy way to disable the show recipes button when a certain condition is met
|
||||
public void addRecipeClickArea(Class<? extends GuiContainer> guiContainerClass, int xPos, int yPos, int width, int height, String... recipeCategoryUids) {
|
||||
ErrorUtil.checkNotNull(guiContainerClass, "guiContainerClass");
|
||||
ErrorUtil.checkNotEmpty(recipeCategoryUids, "recipeCategoryUids");
|
||||
|
||||
RecipeClickableArea recipeClickableArea = new RecipeClickableArea(yPos, yPos + height, xPos, xPos + width, recipeCategoryUids);
|
||||
recipeClickableAreas.put(guiContainerClass, recipeClickableArea);
|
||||
}
|
||||
|
||||
public static RecipeClickableArea getRecipeClickableArea(GuiContainer gui, int mouseX, int mouseY) {
|
||||
for (RecipeClickableArea recipeClickableArea : recipeClickableAreas.toImmutable().get(gui.getClass())) {
|
||||
if (recipeClickableArea.checkHover(mouseX, mouseY)) {
|
||||
return recipeClickableArea;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void drawScreenEvent(GuiScreenEvent.DrawScreenEvent.Post event) {
|
||||
if (GuiBase.showSlotConfig) {
|
||||
return;
|
||||
}
|
||||
GuiScreen gui = event.getGui();
|
||||
if (gui instanceof GuiContainer) {
|
||||
GuiContainer guiContainer = (GuiContainer) gui;
|
||||
if (getRecipeClickableArea(guiContainer, event.getMouseX() - guiContainer.getGuiLeft(), event.getMouseY() - guiContainer.getGuiTop()) != null) {
|
||||
TooltipRenderer.drawHoveringText(guiContainer.mc, Translator.translateToLocal("jei.tooltip.show.recipes"), event.getMouseX(), event.getMouseY());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void handleMouseClick(GuiScreenEvent.MouseInputEvent.Pre event) {
|
||||
if (GuiBase.showSlotConfig) {
|
||||
return;
|
||||
}
|
||||
final int eventButton = Mouse.getEventButton();
|
||||
if (eventButton > -1) {
|
||||
if (Mouse.getEventButtonState()) {
|
||||
if (event.getGui() instanceof GuiContainer) {
|
||||
int x = Mouse.getEventX() * event.getGui().width / event.getGui().mc.displayWidth;
|
||||
int y = event.getGui().height - Mouse.getEventY() * event.getGui().height / event.getGui().mc.displayHeight - 1;
|
||||
GuiContainer guiContainer = (GuiContainer) event.getGui();
|
||||
RecipeClickableArea clickableArea = getRecipeClickableArea(guiContainer, x - guiContainer.getGuiLeft(), y - guiContainer.getGuiTop());
|
||||
if (clickableArea != null) {
|
||||
List<String> recipeCategoryUids = clickableArea.getRecipeCategoryUids();
|
||||
recipesGui.showCategories(recipeCategoryUids);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeCategory implements IRecipeCategory<AlloySmelterRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public AlloySmelterRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 52);
|
||||
title = StringUtils.t("tile.techreborn:alloy_smelter.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AlloySmelterRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 95, 7);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
|
||||
private final IDrawableAnimated progressright;
|
||||
private final IDrawableAnimated progressleft;
|
||||
|
||||
public AlloySmelterRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
AlloySmelterRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressrightStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
IDrawableStatic progressleftStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 84, 161, 16, 10);
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
|
||||
this.progressright = guiHelper.createAnimatedDrawable(progressrightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
this.progressleft = guiHelper.createAnimatedDrawable(progressleftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progressright.draw(minecraft, 25, 12);
|
||||
progressleft.draw(minecraft, 75, 12);
|
||||
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeCategory implements IRecipeCategory<AssemblingMachineRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 125, 65, 74, 42);
|
||||
title = StringUtils.t("tile.techreborn:assembly_machine.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AssemblingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 2);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 12);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 16);
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.blastFurnace;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeCategory implements IRecipeCategory<BlastFurnaceRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public BlastFurnaceRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 94, 120, 78);
|
||||
title = StringUtils.t("tile.techreborn:industrial_blast_furnace.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull BlastFurnaceRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 21, 3);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 21, 23);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 63, 12);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 81, 12);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.blastFurnace;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
private final IDrawable heat;
|
||||
|
||||
public BlastFurnaceRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
int j = (int) ((double) baseRecipe.neededHeat / (double) 3230 * 106);
|
||||
if (j < 0)
|
||||
j = 0;
|
||||
|
||||
this.heat = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 0, 246, j, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 43, 17);
|
||||
heat.draw(minecraft, 7, 47);
|
||||
|
||||
int y = 64;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.neededHeat + " Heat", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.neededHeat + " Heat") / 2), 48, 0xFFFFFF);
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.centrifuge;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeCategory implements IRecipeCategory<CentrifugeRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CentrifugeRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 0, 104, 62);
|
||||
title = StringUtils.t("tile.techreborn:industrial_centrifuge.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CentrifugeRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 12);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 32);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 45, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 64, 3);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 83, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 64, 41);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.centrifuge;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public CentrifugeRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CentrifugeRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 26);
|
||||
|
||||
int y1 = 1;
|
||||
int y2 = 54;
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.chemicalReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class ChemicalReactorRecipeCategory implements IRecipeCategory<ChemicalReactorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ChemicalReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 52);
|
||||
title = StringUtils.t("tile.techreborn:chemical_reactor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 95, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.chemicalReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
|
||||
private final IDrawableAnimated progressright;
|
||||
private final IDrawableAnimated progressleft;
|
||||
|
||||
public ChemicalReactorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressrightStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
IDrawableStatic progressleftStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 84, 161, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progressright = guiHelper.createAnimatedDrawable(progressrightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
this.progressleft = guiHelper.createAnimatedDrawable(progressleftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progressright.draw(minecraft, 25, 12);
|
||||
progressleft.draw(minecraft, 75, 12);
|
||||
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.compressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeCategory implements IRecipeCategory<CompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:compressor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.compressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public CompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.distillationTower;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
|
||||
public class DistillationTowerRecipeCategory implements IRecipeCategory<DistillationTowerRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public DistillationTowerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 0, 104, 62);
|
||||
title = StringUtils.t("tile.techreborn:distillation_tower.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.DISTILLATION_TOWER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull DistillationTowerRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 12);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 32);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 45, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 64, 3);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 83, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 64, 41);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.distillationTower;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class DistillationTowerRecipeWrapper extends BaseRecipeWrapper<DistillationTowerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
/**
|
||||
* @param jeiHelpers JEI Helper Class
|
||||
* @param baseRecipe Distillation Tower recipe
|
||||
*/
|
||||
|
||||
public DistillationTowerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull DistillationTowerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 26);
|
||||
|
||||
int y1 = 1;
|
||||
int y2 = 54;
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.extractor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeCategory implements IRecipeCategory<ExtractorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ExtractorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:extractor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ExtractorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.extractor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ExtractorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ExtractorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.fluidReplicator;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeCategory implements IRecipeCategory<FluidReplicatorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] OUTPUT_TANKS = { 0 };
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private final IDrawable background;
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public FluidReplicatorRecipeCategory(@Nonnull IGuiHelper guiHelper) {
|
||||
this.background = guiHelper.createDrawable(texture, 125, 0, 72, 60);
|
||||
this.tankOverlay = guiHelper.createDrawable(texture, 196, 0, 12, 47);
|
||||
this.title = StringUtils.t("tile.techreborn:fluid_replicator.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.FLUID_REPLICATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FluidReplicatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 2, 21);
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(OUTPUT_TANKS[0], false, 52, 6, 12, 47, 10_000, true, tankOverlay);
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, null, null, OUTPUT_TANKS);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.fluidReplicator;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeWrapper implements IRecipeWrapper {
|
||||
private final FluidReplicatorRecipe recipe;
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public FluidReplicatorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidReplicatorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
int ticksPerCycle = recipe.getTickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see mezz.jei.api.recipe.IRecipeWrapper#getIngredients(mezz.jei.api.ingredients.IIngredients)
|
||||
*/
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInput(ItemStack.class, new ItemStack(ModItems.UU_MATTER, recipe.getInput()));
|
||||
ingredients.setOutput(FluidStack.class, new FluidStack(recipe.getFluid(), Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
progress.draw(minecraft, 25, 25);
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeCategory implements IRecipeCategory<FusionReactorRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int inputSlotTop = 0;
|
||||
private static final int inputSlotBottom = 1;
|
||||
private static final int outputSlot = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
@Nonnull
|
||||
private final String title;
|
||||
|
||||
public FusionReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 64, 0, 40, 20, 20);
|
||||
title = StringUtils.t("tile.techreborn:fusion_control_computer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
FusionReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 23, 7);
|
||||
itemStacks.init(inputSlotBottom, true, 115, 7);
|
||||
itemStacks.init(outputSlot, false, 69, 7);
|
||||
|
||||
itemStacks.set(inputSlotTop, recipeWrapper.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, recipeWrapper.getBottomInput());
|
||||
itemStacks.set(outputSlot, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class FusionReactorRecipeWrapper implements IRecipeWrapper {
|
||||
private final FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
|
||||
ingredients.setOutput(ItemStack.class, baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
public ItemStack getTopInput() {
|
||||
return baseRecipe.getTopInput();
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput() {
|
||||
return baseRecipe.getBottomInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime());
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.generators.fluid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class FluidGeneratorRecipeCategory implements IRecipeCategory<FluidGeneratorRecipeWrapper> {
|
||||
public static ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei_fluid_generator.png");
|
||||
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
private final IDrawable tankOverlay;
|
||||
private final EFluidGenerator generatorType;
|
||||
|
||||
public FluidGeneratorRecipeCategory(EFluidGenerator generatorType, IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 42, 16, 102, 60);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 72, 12, 47);
|
||||
title = StringUtils.t("techreborn.jei.category.generator." + generatorType.name().toLowerCase());
|
||||
this.generatorType = generatorType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUid() {
|
||||
return this.generatorType.getRecipeID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper,
|
||||
IIngredients ingredients) {
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.generators.fluid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FluidGeneratorRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final FluidGeneratorRecipe baseRecipe;
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) {
|
||||
this.baseRecipe = recipe;
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(FluidGeneratorRecipeCategory.texture, 176, 3, 25, 14);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, 200, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
progress.draw(minecraft, 73, 26);
|
||||
minecraft.fontRenderer
|
||||
.drawString(PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.getEnergyPerMb() * 1000) + " "
|
||||
+ PowerSystem.getDisplayPower().abbreviation, 70, 13, 0x444444);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, new FluidStack(this.baseRecipe.getFluid(), Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.grinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeCategory implements IRecipeCategory<GrinderRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public GrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:grinder.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull GrinderRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.grinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public GrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
GrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory implements IRecipeCategory<ImplosionCompressorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2, 3};
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 95, 120, 42);
|
||||
title = StringUtils.t("tile.techreborn:implosion_compressor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 21, 2);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 21, 22);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 63, 11);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 81, 11);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<ImplosionCompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ImplosionCompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 43, 16);
|
||||
|
||||
int x = -35;
|
||||
int y = 13;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory implements IRecipeCategory<IndustrialElectrolyzerRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
private final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 49, 18, 78, 50);
|
||||
title = StringUtils.t("tile.techreborn:industrial_electrolyzer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 0, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 20, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 40, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 60, 0);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
private final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
public IndustrialElectrolyzerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(this.texture, 176, 14, 30, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 24, 20);
|
||||
|
||||
int x = 60;
|
||||
int y = 20;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,116 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialGrinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory implements IRecipeCategory<IndustrialGrinderRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_grinder.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
private final IDrawable background;
|
||||
// for covering the lightning power symbol
|
||||
private final IDrawable blankArea;
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
title = StringUtils.t("tile.techreborn:industrial_grinder.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 129, 49);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 87, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 105, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 123, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialGrinder.TANK_CAPACITY, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialGrinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_grinder.png");
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialGrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 24, 17);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
|
||||
super.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
|
||||
int x = 70;
|
||||
int y = 40;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("Energy: " + PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.euPerTick) + " " + PowerSystem.getDisplayPower().abbreviation + "/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialSawmillRecipeCategory implements IRecipeCategory<IndustrialSawmillRecipeWrapper> {
|
||||
|
||||
private final String title;
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
private final IDrawable background;
|
||||
private final IDrawable tankOverlay;
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
|
||||
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
|
||||
title = StringUtils.t("tile.techreborn:industrial_sawmill.name");
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*/
|
||||
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialSawmillRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialSawmillRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 13);
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
|
||||
super.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 48, 23);
|
||||
|
||||
if (minecraft.fontRenderer != null) {
|
||||
int x = 70;
|
||||
int y = 40;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("FE: " + baseRecipe.euPerTick + " FE/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeCategory implements IRecipeCategory<RollingMachineRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
private static final int[] OUTPUT_SLOTS = { 10 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated progress;
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
private final String title;
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rolling_machine.png");
|
||||
|
||||
public RollingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 29, 16, 116, 54);
|
||||
title = StringUtils.t("tile.techreborn:rolling_machine.name");
|
||||
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 18);
|
||||
progress = guiHelper.createAnimatedDrawable(progressStatic, 250, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
|
||||
craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOTS[0], OUTPUT_SLOTS[0]);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft) {
|
||||
progress.draw(minecraft, 62, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RollingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
int i = k1 + l * 3;
|
||||
guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18);
|
||||
}
|
||||
}
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18);
|
||||
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class));
|
||||
guiItemStacks.set(OUTPUT_SLOTS[0], ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe.getValue());
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class RollingMachineRecipeWrapper implements IRecipeWrapper {
|
||||
private final IRecipeWrapper baseRecipe;
|
||||
|
||||
public RollingMachineRecipeWrapper(IRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers, IRecipe baseRecipe) {
|
||||
IRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper(jeiHelpers, (ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper(jeiHelpers, (ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RollingMachineRecipeWrapper(recipeWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients) {
|
||||
baseRecipe.getIngredients(ingredients);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.scrapbox;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeCategory implements IRecipeCategory<ScrapboxRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ScrapboxRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("jei.techreborn.scrapbox.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ScrapboxRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.scrapbox;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import techreborn.api.recipe.machines.ScrapboxRecipe;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
|
||||
public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.vacuumFreezer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeCategory implements IRecipeCategory<VacuumFreezerRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:vacuum_freezer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.jei.vacuumFreezer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public VacuumFreezerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.opencomputers;
|
||||
|
||||
import li.cil.oc.api.Driver;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
public class CompatOpenComputers implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
Driver.add(new DriverMachine());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.opencomputers;
|
||||
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.driver.DriverBlock;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
import li.cil.oc.api.prefab.AbstractManagedEnvironment;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IUpgradeable;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
public class DriverMachine implements DriverBlock {
|
||||
@Override
|
||||
public boolean worksWith(World world, BlockPos blockPos, EnumFacing enumFacing) {
|
||||
return world.getTileEntity(blockPos) instanceof TilePowerAcceptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManagedEnvironment createEnvironment(World world, BlockPos blockPos, EnumFacing enumFacing) {
|
||||
return new MachineEnvironment((TilePowerAcceptor) world.getTileEntity(blockPos));
|
||||
}
|
||||
|
||||
public static class MachineEnvironment extends AbstractManagedEnvironment implements NamedBlock {
|
||||
TilePowerAcceptor machine;
|
||||
|
||||
public MachineEnvironment(TilePowerAcceptor machine) {
|
||||
this.machine = machine;
|
||||
setNode(Network.newNode(this, Visibility.Network).withComponent("tr_machine", Visibility.Network).create());
|
||||
}
|
||||
|
||||
@Callback(value = "getTeir", getter = true, doc = "Gets the current teir of the machine, this changes with upgrades")
|
||||
public Object[] getTeir(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getTier().name());
|
||||
}
|
||||
|
||||
@Callback(value = "getEnergy", getter = true, doc = "Gets the currentally stored energy of the machine. in EU")
|
||||
public Object[] getEnergy(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getEnergy());
|
||||
}
|
||||
|
||||
|
||||
@Callback(value = "getMaxPower", getter = true, doc = "Gets the maximum energy that can be stored in the machine. in EU")
|
||||
public Object[] getMaxPower(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxPower());
|
||||
}
|
||||
|
||||
@Callback(value = "getMaxInput", getter = true, doc = "Gets the maximum energy that can be inputted in to the machine. in EU")
|
||||
public Object[] getMaxInput(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxInput());
|
||||
}
|
||||
|
||||
@Callback(value = "getMaxOutput", getter = true, doc = "Gets the maximum energy that can be extracted from the machine. in EU")
|
||||
public Object[] getMaxOutput(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxOutput());
|
||||
}
|
||||
|
||||
@Callback(value = "canBeUprgraded", getter = true, doc = "Returns true if the machine can be upgraded")
|
||||
public Object[] canBeUprgraded(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine instanceof IUpgradeable && machine.canBeUpgraded());
|
||||
}
|
||||
|
||||
@Callback(value = "hasRecipeCrafter", getter = true, doc = "Returns true if the machine has a recipe crafter")
|
||||
public Object[] hasRecipeCrafter(Context context, Arguments arguments) throws Exception{
|
||||
return getObjects(machine instanceof IRecipeCrafterProvider);
|
||||
}
|
||||
|
||||
@Callback(value = "getRecipeName", getter = true, doc = "Gets the name of the recipe that the machine crafts")
|
||||
public Object[] getRecipeName(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return getObjects(((IRecipeCrafterProvider) machine).getRecipeCrafter().recipeName);
|
||||
}
|
||||
|
||||
@Callback(value = "getInputSlots", getter = true, doc = "Gets the slot ids that the crafter uses to look for inputs")
|
||||
public Object[] getInputSlots(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().inputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
|
||||
}
|
||||
|
||||
@Callback(value = "getOutputSlots", getter = true, doc = "Gets the slot ids that the crafter uses for outputs")
|
||||
public Object[] getOutputSlots(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().outputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
|
||||
}
|
||||
|
||||
@Callback(value = "isActive", getter = true, doc = "Returns a boolean if the machine is actice")
|
||||
public Object[] isActive(Context context, Arguments arguments) throws Exception{
|
||||
return getObjects(machine.isActive());
|
||||
}
|
||||
|
||||
@Callback(value = "getFacing", getter = true, doc = "Gets the facing for the machine")
|
||||
public Object[] getFacing(Context context, Arguments arguments) throws Exception{
|
||||
EnumFacing facing = machine.getFacing();
|
||||
if(facing == null){
|
||||
return null;
|
||||
}
|
||||
return getObjects(facing.getName());
|
||||
}
|
||||
|
||||
private Object[] getObjects(Object... objects){
|
||||
return objects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String preferredName() {
|
||||
return "tr_machine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int priority() {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.compat.psi;
|
||||
//
|
||||
//import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
//import techreborn.compat.compat.ICompatModule;
|
||||
//import techreborn.compat.compat.psi.spell.trick.block.PieceTrickBlockTap;
|
||||
//import vazkii.psi.api.PsiAPI;
|
||||
//import vazkii.psi.api.spell.Spell;
|
||||
//import vazkii.psi.api.spell.SpellPiece;
|
||||
//import vazkii.psi.common.lib.LibPieceGroups;
|
||||
//
|
||||
//public class CompatModulePsi implements ICompatModule {
|
||||
// public static PieceContainer trickTreetap;
|
||||
// public static final String TRICK_TAP_BLOCK = "trickTapBlock";
|
||||
//
|
||||
// @Override
|
||||
// public void preInit(FMLPreInitializationEvent event) {
|
||||
// trickTreetap = register(PieceTrickBlockTap.class, TRICK_TAP_BLOCK, LibPieceGroups.BLOCK_WORKS);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void init(FMLInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void postInit(FMLPostInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void serverStarting(FMLServerStartingEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public static PieceContainer register(Class<? extends SpellPiece> clazz, String name, String group) {
|
||||
// return register(clazz, name, group, false);
|
||||
// }
|
||||
//
|
||||
// public static PieceContainer register(Class<? extends SpellPiece> clazz, String name, String group, boolean main) {
|
||||
// PsiAPI.registerSpellPieceAndTexture(name, clazz);
|
||||
// PsiAPI.addPieceToGroup(clazz, group, main);
|
||||
// return (Spell s) -> {
|
||||
// return SpellPiece.create(clazz, s);
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// public static interface PieceContainer {
|
||||
// public SpellPiece get(Spell s);
|
||||
// }
|
||||
//
|
||||
//}
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.compat.psi.spell.trick.block;
|
||||
//
|
||||
//import java.util.Random;
|
||||
//
|
||||
//import net.minecraft.block.state.IBlockState;
|
||||
//import net.minecraft.entity.item.EntityItem;
|
||||
//import net.minecraft.util.EnumFacing;
|
||||
//import net.minecraft.util.math.BlockPos;
|
||||
//import techreborn.blocks.BlockRubberLog;
|
||||
//import techreborn.items.ItemParts;
|
||||
//import vazkii.psi.api.internal.Vector3;
|
||||
//import vazkii.psi.api.spell.EnumSpellStat;
|
||||
//import vazkii.psi.api.spell.Spell;
|
||||
//import vazkii.psi.api.spell.SpellCompilationException;
|
||||
//import vazkii.psi.api.spell.SpellContext;
|
||||
//import vazkii.psi.api.spell.SpellMetadata;
|
||||
//import vazkii.psi.api.spell.SpellParam;
|
||||
//import vazkii.psi.api.spell.SpellRuntimeException;
|
||||
//import vazkii.psi.api.spell.param.ParamVector;
|
||||
//import vazkii.psi.api.spell.piece.PieceTrick;
|
||||
//
|
||||
//public class PieceTrickBlockTap extends PieceTrick {
|
||||
//
|
||||
// SpellParam position;
|
||||
// SpellParam side;
|
||||
//
|
||||
// public PieceTrickBlockTap(Spell spell) {
|
||||
// super(spell);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void initParams() {
|
||||
// addParam(position = new ParamVector(SpellParam.GENERIC_NAME_POSITION, SpellParam.BLUE, false, false));
|
||||
// addParam(side = new ParamVector("Side", SpellParam.GREEN, false, false));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addToMetadata(SpellMetadata meta) throws SpellCompilationException {
|
||||
// super.addToMetadata(meta);
|
||||
//
|
||||
// meta.addStat(EnumSpellStat.POTENCY, 20);
|
||||
// meta.addStat(EnumSpellStat.COST, 25);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object execute(SpellContext context) throws SpellRuntimeException {
|
||||
// if (context.caster.worldObj.isRemote)
|
||||
// return null;
|
||||
//
|
||||
// Vector3 positionVal = this.<Vector3> getParamValue(context, position);
|
||||
// Vector3 sideVal = this.<Vector3> getParamValue(context, side);
|
||||
//
|
||||
// if (positionVal == null)
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR);
|
||||
// if (!context.isInRadius(positionVal))
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS);
|
||||
//
|
||||
// if (sideVal == null)
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR);
|
||||
// if (!context.isInRadius(sideVal))
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS);
|
||||
//
|
||||
// if(!sideVal.isAxial()){
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// BlockPos pos = new BlockPos(positionVal.x, positionVal.y, positionVal.z);
|
||||
// IBlockState state = context.caster.worldObj.getBlockState(pos);
|
||||
// if (state.getBlock() instanceof BlockRubberLog) {
|
||||
// System.out.println("Is rubber log");
|
||||
// if (state.getValue(BlockRubberLog.HAS_SAP)) {
|
||||
// System.out.println("Has sap");
|
||||
// if (state.getValue(BlockRubberLog.SAP_SIDE) == null) {
|
||||
// System.out.println("got this far");
|
||||
// context.caster.worldObj.setBlockState(pos, state.withProperty(BlockRubberLog.HAS_SAP, false)
|
||||
// .withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
// // TODO 1.9 sounds
|
||||
// // worldIn.playSoundAtEntity(playerIn,
|
||||
// // "techreborn:sap_extract", 0.8F, 1F);
|
||||
// if (!context.caster.worldObj.isRemote) {
|
||||
// System.out.println("doing stuff");
|
||||
// Random rand = new Random();
|
||||
// BlockPos itemPos = pos.offset(context.positionBroken.sideHit);
|
||||
// EntityItem item = new EntityItem(context.caster.worldObj, itemPos.getX(), itemPos.getY(),
|
||||
// itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||
// float factor = 0.05F;
|
||||
// item.motionX = rand.nextGaussian() * factor;
|
||||
// item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
// item.motionZ = rand.nextGaussian() * factor;
|
||||
// context.caster.worldObj.spawnEntityInWorld(item);
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
//
|
||||
// }
|
||||
//}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.api.IProbeConfig;
|
||||
import mcjty.theoneprobe.api.IProbeConfigProvider;
|
||||
import mcjty.theoneprobe.api.IProbeHitData;
|
||||
import mcjty.theoneprobe.api.IProbeHitEntityData;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class ProbeConfig implements IProbeConfigProvider {
|
||||
@Override
|
||||
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, Entity entity, IProbeHitEntityData data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
|
||||
TileEntity tile = world.getTileEntity(data.getPos());
|
||||
if (tile instanceof TilePowerAcceptor) {
|
||||
config.setRFMode(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.api.*;
|
||||
import mcjty.theoneprobe.apiimpl.providers.ChestInfoTools;
|
||||
import mcjty.theoneprobe.apiimpl.styles.ProgressStyle;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.IEnergyInterfaceTile;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.StringUtils;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class ProbeProvider implements IProbeInfoProvider {
|
||||
|
||||
ProgressStyle euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
|
||||
|
||||
MethodHandle methodHandle_addStacks;
|
||||
|
||||
public ProbeProvider() {
|
||||
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
|
||||
euStyle.numberFormat(NumberFormat.COMMAS);
|
||||
|
||||
try {
|
||||
//Can we just all agree to make things that might be useful to others public, thanks.
|
||||
MethodHandles.Lookup lookup = MethodHandles.lookup();
|
||||
Method pm = ChestInfoTools.class.getDeclaredMethod("showChestContents", IProbeInfo.class, World.class, BlockPos.class, List.class, boolean.class);
|
||||
pm.setAccessible(true);
|
||||
methodHandle_addStacks = lookup.unreflect(pm);
|
||||
} catch (NoSuchMethodException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return "TechReborn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
|
||||
euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
|
||||
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
|
||||
TileEntity tile = world.getTileEntity(data.getPos());
|
||||
if (tile instanceof IListInfoProvider) {
|
||||
List<String> strs = new ArrayList<>();
|
||||
((IListInfoProvider) tile).addInfo(strs, true);
|
||||
for (String string : strs) {
|
||||
probeInfo.text(string);
|
||||
}
|
||||
}
|
||||
if (tile instanceof IEnergyInterfaceTile) {
|
||||
IEnergyInterfaceTile energy = (IEnergyInterfaceTile) tile;
|
||||
if (PowerSystem.getDisplayPower() != PowerSystem.EnergySystem.EU) {
|
||||
probeInfo.progress((int) energy.getEnergy() * RebornCoreConfig.euPerFU, (int) energy.getMaxPower() * RebornCoreConfig.euPerFU, euStyle);
|
||||
} else {
|
||||
probeInfo.progress((int) energy.getEnergy(), (int) energy.getMaxPower(), euStyle);
|
||||
}
|
||||
}
|
||||
if (tile instanceof TileLegacyMachineBase && methodHandle_addStacks != null) {
|
||||
TileLegacyMachineBase legacyMachineBase = (TileLegacyMachineBase) tile;
|
||||
if (legacyMachineBase.getInventoryForTile().isPresent()) {
|
||||
if (player.isSneaking()) {
|
||||
probeInfo.text(StringUtils.t("techreborn.tooltip.inventory"));
|
||||
}
|
||||
Inventory inventory = legacyMachineBase.getInventoryForTile().get();
|
||||
if(!inventory.isEmpty()){
|
||||
List<ItemStack> stacks = Arrays.stream(inventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
|
||||
try {
|
||||
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!legacyMachineBase.upgradeInventory.isEmpty() && player.isSneaking()) {
|
||||
probeInfo.horizontal();
|
||||
probeInfo.text(StringUtils.t("techreborn.tooltip.upgrades"));
|
||||
List<ItemStack> stacks = Arrays.stream(legacyMachineBase.upgradeInventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
|
||||
try {
|
||||
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.TheOneProbe;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
import static techreborn.compat.compat.CompatConfigs.enableTOP;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class TheOneProbeCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (enableTOP) {
|
||||
TheOneProbe.theOneProbeImp.registerProvider(new ProbeProvider());
|
||||
TheOneProbe.theOneProbeImp.registerProbeConfigProvider(new ProbeConfig());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.thermalexpansion;
|
||||
|
||||
import cofh.api.util.ThermalExpansionHelper;
|
||||
import cofh.thermalfoundation.init.TFFluids;
|
||||
import cofh.thermalfoundation.item.ItemMaterial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.init.recipes.RecipeMethods;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemPlates;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 06/07/2017.
|
||||
*/
|
||||
public class RecipeThermalExpansion implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2000, new ItemStack(Items.ENDER_PEARL), RecipeMethods.getMaterial("ender_pearl", 1, RecipeMethods.Type.DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.ENDER_EYE), RecipeMethods.getMaterial("ender_eye", 2, RecipeMethods.Type.DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.FLINT), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.SMALL_DUST), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(ModItems.CELL), RecipeMethods.getMaterial("tin", 4, RecipeMethods.Type.SMALL_DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(Blocks.END_STONE), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sulfur", 1, RecipeMethods.Type.DUST), 50);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("ruby", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("ruby", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("red_garnet", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sapphire", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sapphire", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("bauxite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("bauxite", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("pyrite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("pyrite", 5, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("iron", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("cinnabar", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("cinnabar", 3, RecipeMethods.Type.DUST), new ItemStack(Items.REDSTONE), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(4000, RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sphalerite", 4, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("zinc", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial("tungsten", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("tungsten", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("manganese", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("peridot", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("peridot", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("emerald", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sodalite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sodalite", 12, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
|
||||
|
||||
for(String plate : ItemPlates.types){
|
||||
if(!plate.equals(ModItems.META_PLACEHOLDER) && ItemDusts.hasDust(plate)){
|
||||
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.PLATE), RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.DUST));
|
||||
}
|
||||
}
|
||||
|
||||
ThermalExpansionHelper.addSmelterRecipe(4000, new ItemStack(Items.IRON_INGOT, 2), new ItemStack(Blocks.SAND), RecipeMethods.getMaterial("refined_iron", 2, RecipeMethods.Type.INGOT), ItemMaterial.crystalSlag.copy(), 25);
|
||||
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, TFFluids.fluidPyrotheum, 80);
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, TFFluids.fluidCreosote, 40);
|
||||
|
||||
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(4, TFFluids.fluidCoal, 100, 20));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.tinkers;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* @author Prospector on 08/05/16
|
||||
*/
|
||||
public class CompatModuleTinkers implements ICompatModule {
|
||||
|
||||
public CompatModuleTinkers() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
// TinkersFluids.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.compat.tinkers;
|
||||
//
|
||||
//import net.minecraft.item.EnumRarity;
|
||||
//import net.minecraft.nbt.NBTTagCompound;
|
||||
//import net.minecraft.nbt.NBTTagList;
|
||||
//import net.minecraft.util.ResourceLocation;
|
||||
//import net.minecraftforge.fluids.Fluid;
|
||||
//import net.minecraftforge.fluids.FluidRegistry;
|
||||
//import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
//import slimeknights.tconstruct.library.fluid.FluidMolten;
|
||||
//
|
||||
///**
|
||||
// * @author Prospector on 08/05/16
|
||||
// */
|
||||
//public class TinkersFluids {
|
||||
// private static ResourceLocation moltenMetal = new ResourceLocation("tconstruct:blocks/fluids/molten_metal");
|
||||
// private static ResourceLocation moltenMetalFlowing = new ResourceLocation(
|
||||
// "tconstruct:blocks/fluids/molten_metal_flow");
|
||||
//
|
||||
// public static FluidMolten moltenChrome = new FluidMolten("chrome", 0x90C9C9, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenInvar = new FluidMolten("invar", 0x7F907F, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenIridium = new FluidMolten("iridium", 0xFFFFFF, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenPlatinum = new FluidMolten("platinum", 0x34BFBF, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenTitanium = new FluidMolten("titanium", 0x3C372F, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenTungsten = new FluidMolten("tungsten", 0x3A464F, moltenMetal, moltenMetalFlowing);
|
||||
//
|
||||
// public static void init() {
|
||||
// addFluidStuff(moltenChrome, "Chrome");
|
||||
// moltenChrome.setTemperature(800);
|
||||
// addFluidStuff(moltenInvar, "Invar");
|
||||
// moltenInvar.setTemperature(580);
|
||||
// addFluidStuff(moltenIridium, "Iridium");
|
||||
// moltenIridium.setTemperature(4000);
|
||||
// moltenIridium.setRarity(EnumRarity.EPIC);
|
||||
// addFluidStuff(moltenPlatinum, "Platinum");
|
||||
// moltenPlatinum.setTemperature(900);
|
||||
// addFluidStuff(moltenTitanium, "Titanium");
|
||||
// moltenTitanium.setTemperature(1000);
|
||||
// addFluidStuff(moltenTungsten, "Tungsten");
|
||||
// moltenTungsten.setTemperature(1200);
|
||||
//
|
||||
// //Invar Alloying
|
||||
// NBTTagList tagList = new NBTTagList();
|
||||
// NBTTagCompound fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "invar");
|
||||
// fluid.setInteger("Amount", 144);
|
||||
// tagList.appendTag(fluid);
|
||||
// fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "iron");
|
||||
// fluid.setInteger("Amount", 96);
|
||||
// tagList.appendTag(fluid);
|
||||
// fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "nickel");
|
||||
// fluid.setInteger("Amount", 48);
|
||||
// tagList.appendTag(fluid);
|
||||
//
|
||||
// NBTTagCompound message = new NBTTagCompound();
|
||||
// message.setTag("alloy", tagList);
|
||||
// FMLInterModComms.sendMessage("tconstruct", "alloy", message);
|
||||
// }
|
||||
//
|
||||
// public static void addFluidStuff(Fluid fluid, String oreSuffix) {
|
||||
// FluidRegistry.registerFluid(fluid);
|
||||
// FluidRegistry.addBucketForFluid(fluid);
|
||||
// NBTTagCompound tag = new NBTTagCompound();
|
||||
// tag.setString("fluid", fluid.getName());
|
||||
// tag.setString("ore", oreSuffix);
|
||||
// tag.setBoolean("toolforge", true);
|
||||
// FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag);
|
||||
// }
|
||||
//}
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaPlugin;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import mcp.mobius.waila.api.WailaPlugin;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
|
||||
@WailaPlugin
|
||||
public class CompatModuleWaila implements IWailaPlugin {
|
||||
|
||||
@Override
|
||||
public void register(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WailaProviderMachines(), BaseTileBlock.class);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WailaProviderMachines implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) accessor.getTileEntity()).addInfo(tip, true);
|
||||
}
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) {
|
||||
return tag;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue