diff --git a/.gitattributes b/.gitattributes index dfe07704..412eeda7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,22 @@ # Auto detect text files and perform LF normalization * text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..32b03a50 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,27 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: [ push, pull_request ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8' + cache: 'gradle' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build the mod + run: ./gradlew --no-daemon build + - uses: actions/upload-artifact@v3 + with: + name: Download + path: build/libs diff --git a/.gitignore b/.gitignore index d31a8cae..7a9b2f87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,66 +1,31 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -/build/ +#ant stuff +build.xml /bin/ +/download/ +#Remove OS generated garbage +*/.DS_Store +.DS_Store +.DS_Store? +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db +#gradle stuff +/.gradle +/build/ /run/ - -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Gradle -################# - -/.gradle/ -/gradle/ -gradlew -gradlew.bat +#IDEA files from Gradle +.idea/ +/*.iml +/*.ipr +/*.iws +out/ +#Vim backups +*~ +#eclipse stuffs +/.classpath +/.project +/.settings/ +/eclipse/ +/*.launch \ No newline at end of file diff --git a/build.gradle b/build.gradle index 28732f5e..f8ad4e97 100644 --- a/build.gradle +++ b/build.gradle @@ -1,91 +1,209 @@ -buildscript { - repositories { - jcenter() - maven { url = "http://files.minecraftforge.net/maven" } +import org.jetbrains.gradle.ext.Gradle + +plugins { + id 'java' + id 'java-library' + id 'maven-publish' + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' + id 'eclipse' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.35' + id 'com.matthewprenger.cursegradle' version '1.4.0' +} + +version = project.mod_version +group = project.maven_group +archivesBaseName = project.archives_base_name + +// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + // Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64 + vendor.set(org.gradle.jvm.toolchain.JvmVendorSpec.AZUL) + } + // Generate sources and javadocs jars when building and publishing + withSourcesJar() + // withJavadocJar() +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' +} + +configurations { + embed + implementation.extendsFrom(embed) +} + +minecraft { + mcVersion = '1.12.2' + + // MCP Mappings + mcpMappingChannel = 'stable' + mcpMappingVersion = '39' + + // Set username here, the UUID will be looked up automatically + username = 'Developer' + + // Add any additional tweaker classes here + // extraTweakClasses.add('org.spongepowered.asm.launch.MixinTweaker') + + // Add various JVM arguments here for runtime + def args = ["-ea:${project.group}"] + if (project.use_coremod.toBoolean()) { + args << '-Dfml.coreMods.load=' + coremod_plugin_class_name } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + if (project.use_mixins.toBoolean()) { + args << '-Dmixin.hotSwap=true' + args << '-Dmixin.checks.interfaces=true' + args << '-Dmixin.debug.export=true' } + extraRunJvmArguments.addAll(args) + + // Include and use dependencies' Access Transformer files + useDependencyAccessTransformers = true + + // Add any properties you want to swap out for a dynamic value at build time here + // Any properties here will be added to a class at build time, the name can be configured below + // Example: + injectedTags.put('VERSION', project.version) + injectedTags.put('MOD_ID', project.mod_id) +} + +// Generate a group.mod_id.Tags class +tasks.injectTags.configure { + // Change Tags class' name here: + outputClassName.set("${project.group}.${project.mod_id}.Tags") } -apply plugin: 'net.minecraftforge.gradle.forge' -//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. repositories { - mavenCentral() maven { - name = "CurseForge" - url = "https://minecraft.curseforge.com/api/maven/" + name 'CleanroomMC Maven' + url 'https://maven.cleanroommc.com' + } + maven { + name 'SpongePowered Maven' + url 'https://repo.spongepowered.org/maven' } maven { - name = "thiakil" - url = "http://maven.thiakil.com" + name 'CurseMaven' + url 'https://cursemaven.com' + content { + includeGroup 'curse.maven' + } } + maven { + name 'BlameJared Maven' + url 'https://maven.blamejared.com' + } + mavenLocal() // Must be last for caching to work } -version = "1.8.4" -group = "com.verdantartifice.thaumicwonders" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "thaumicwonders" +dependencies { + if (project.use_assetmover.toBoolean()) { + implementation 'com.cleanroommc:assetmover:2.5' + } + if (project.use_mixins.toBoolean()) { + implementation 'zone.rong:mixinbooter:9.1' + implementation 'com.cleanroommc:configanytime:3.0' + } + + // Example of deobfuscating a dependency + implementation rfg.deobf('curse.maven:thaumcraft-223628:2629023') + implementation rfg.deobf('curse.maven:baubles-227083:2518667') + runtimeOnly 'curse.maven:jei-238222:4538010' -sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. -compileJava { - sourceCompatibility = targetCompatibility = '1.8' + if (project.use_mixins.toBoolean()) { + // Change your mixin refmap name here: + String mixin = modUtils.enableMixins('zone.rong:mixinbooter:9.1', "mixins.${project.mod_id}.refmap.json") + api(mixin) { + transitive = false + } + annotationProcessor 'org.ow2.asm:asm-debug-all:5.2' + annotationProcessor 'com.google.guava:guava:24.1.1-jre' + annotationProcessor 'com.google.code.gson:gson:2.8.6' + annotationProcessor(mixin) { + transitive = false + } + } } -minecraft { - version = "1.12.2-14.23.5.2768" - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not always work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20171003" - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +// Adds Access Transformer files to tasks +if (project.use_access_transformer.toBoolean()) { + for (File at : sourceSets.getByName("main").resources.files) { + if (at.name.toLowerCase().endsWith("_at.cfg")) { + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) + } + } } -dependencies { - deobfCompile "com.azanor.baubles:Baubles:1.12-1.5.2" - deobfCompile "thaumcraft:Thaumcraft:1.12.2:6.1.BETA26" - - // you may put jars on which you depend on in ./libs - // or you may define them like so.. - //compile "some.group:artifact:version:classifier" - //compile "some.group:artifact:version" - - // real examples - //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - - // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. - //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, - // except that these dependencies get remapped to your current MCP mappings - //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' - //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // for more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html +processResources { + // This will ensure that this task is redone when the versions change + inputs.property 'version', project.version + inputs.property 'mcversion', project.minecraft.version + // Replace various properties in mcmod.info and pack.mcmeta if applicable + filesMatching(['mcmod.info', 'pack.mcmeta']) { fcd -> + // Replace version and mcversion + fcd.expand('version': project.version, + 'mcversion': project.minecraft.version) + } + + if (project.use_access_transformer.toBoolean()) { + rename '(.+_at.cfg)', 'META-INF/$1' // Make sure Access Transformer files are in META-INF folder + } } -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else except the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' +jar { + manifest { + def attribute_map = [:] + if (project.use_coremod.toBoolean()) { + attribute_map['FMLCorePlugin'] = project.coremod_plugin_class_name + if (project.include_mod.toBoolean()) { + attribute_map['FMLCorePluginContainsFMLMod'] = true + attribute_map['ForceLoadAsMod'] = project.gradle.startParameter.taskNames[0] == "build" + } + } + if (project.use_access_transformer.toBoolean()) { + attribute_map['FMLAT'] = project.mod_id + '_at.cfg' + } + attributes(attribute_map) + } + // Add all embedded dependencies into the jar + from(provider { configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } }) +} + +idea { + module { + inheritOutputDirs = true + } + project { + settings { + runConfigurations { + "1. Run Client"(Gradle) { + taskNames = ["runClient"] + } + "2. Run Server"(Gradle) { + taskNames = ["runServer"] + } + "3. Run Obfuscated Client"(Gradle) { + taskNames = ["runObfClient"] + } + "4. Run Obfuscated Server"(Gradle) { + taskNames = ["runObfServer"] + } + } + compiler.javac { + afterEvaluate { + javacAdditionalOptions = "-encoding utf8" + moduleJavacAdditionalOptions = [(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')] + } + } + } } } + +tasks.named("processIdeaSettings").configure { + dependsOn("injectTags") +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..f2a00a4a --- /dev/null +++ b/gradle.properties @@ -0,0 +1,23 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs = -Xmx3G + +# Mod Information +mod_id = thaumicwonders +mod_version = 1.8.4 +maven_group = com.verdantartifice.thaumicwonders +archives_base_name = Thaumic-Wonders + +# If any properties changes below this line, run `gradlew setupDecompWorkspace` and refresh gradle again to ensure everything is working correctly. + +# Boilerplate Options +use_mixins = false +use_coremod = false +use_assetmover = false + +# Access Transformer files should be in the root of `resources` folder and with the filename formatted as: `{archives_base_name}_at.cfg` +use_access_transformer = false + +# Coremod Arguments +include_mod = true +coremod_plugin_class_name = \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..c1962a79 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..37aef8d3 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 00000000..aeb74cbb --- /dev/null +++ b/gradlew @@ -0,0 +1,245 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# 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 ;; #( + MSYS* | 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" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..93e3f59f --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@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=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@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="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +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 execute + +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 + +: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 %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 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! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..2c64da61 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + repositories { + maven { + // RetroFuturaGradle + name 'GTNH Maven' + url 'https://nexus.gtnewhorizons.com/repository/public/' + mavenContent { + includeGroup 'com.gtnewhorizons' + includeGroup 'com.gtnewhorizons.retrofuturagradle' + } + } + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + +plugins { + // Automatic toolchain provisioning + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' +} + +// Due to an IntelliJ bug, this has to be done +// rootProject.name = archives_base_name +rootProject.name = rootProject.projectDir.getName() diff --git a/src/main/java/com/verdantartifice/thaumicwonders/client/renderers/tile/TesrDimensionalRipper.java b/src/main/java/com/verdantartifice/thaumicwonders/client/renderers/tile/TesrDimensionalRipper.java index 4dd3d8c8..1183bbaa 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/client/renderers/tile/TesrDimensionalRipper.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/client/renderers/tile/TesrDimensionalRipper.java @@ -72,8 +72,8 @@ public void render(TileDimensionalRipper te, double x, double y, double z, float GlStateManager.depthMask(false); for (EnumFacing face : EnumFacing.values()) { GL11.glPushMatrix(); - GL11.glRotatef(90.0F, -face.getFrontOffsetY(), face.getFrontOffsetX(), -face.getFrontOffsetZ()); - if (face.getFrontOffsetZ() < 0) { + GL11.glRotatef(90.0F, -face.getYOffset(), face.getXOffset(), -face.getZOffset()); + if (face.getZOffset() < 0) { GL11.glTranslated(0.0D, 0.0D, 0.126D); GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } else { diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/base/BlockTW.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/base/BlockTW.java index 519ef8a1..f6357563 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/base/BlockTW.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/base/BlockTW.java @@ -10,7 +10,7 @@ public class BlockTW extends Block { public BlockTW(Material material, String name) { super(material); setRegistryName(ThaumicWonders.MODID, name); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); setResistance(2.0F); setHardness(1.5F); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockAlkahestVat.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockAlkahestVat.java index 528fa6b2..5c50fee1 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockAlkahestVat.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockAlkahestVat.java @@ -68,7 +68,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc } @Override - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { if (entityIn instanceof EntityItem) { this.releaseVis(worldIn, pos, ((EntityItem)entityIn).getItem()); @@ -85,7 +85,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s } } } - super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn); + super.onEntityCollision(worldIn, pos, state, entityIn); } @Override diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockCatalyzationChamber.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockCatalyzationChamber.java index 60413f55..72166081 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockCatalyzationChamber.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockCatalyzationChamber.java @@ -18,6 +18,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.MobEffects; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -57,7 +58,7 @@ public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {} @Override @SideOnly(Side.CLIENT) - public BlockRenderLayer getBlockLayer() { + public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } @@ -107,7 +108,7 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { } @Override - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn.posX < pos.getX() + 0.3F) { entityIn.motionX += 0.0001D; } @@ -136,7 +137,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s ((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(MobEffects.POISON, 100)); } } - super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn); + super.onEntityCollision(worldIn, pos, state, entityIn); } @Override diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockOreDiviner.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockOreDiviner.java index 3b732eac..52ef78e1 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockOreDiviner.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockOreDiviner.java @@ -42,7 +42,7 @@ public boolean isOpaqueCube(IBlockState state) { @Override @SideOnly(Side.CLIENT) - public BlockRenderLayer getBlockLayer() { + public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.TRANSLUCENT; } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockPrimordialAccretionChamber.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockPrimordialAccretionChamber.java index 7cd4547a..36b50fe7 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockPrimordialAccretionChamber.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockPrimordialAccretionChamber.java @@ -15,6 +15,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.MobEffects; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -53,7 +54,7 @@ public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {} @Override @SideOnly(Side.CLIENT) - public BlockRenderLayer getBlockLayer() { + public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } @@ -105,7 +106,7 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { } @Override - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn.posX < pos.getX() + 0.3F) { entityIn.motionX += 0.0001D; } @@ -134,6 +135,6 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s ((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(MobEffects.POISON, 100)); } } - super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn); + super.onEntityCollision(worldIn, pos, state, entityIn); } } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockVoidBeacon.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockVoidBeacon.java index a631060a..faad2088 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockVoidBeacon.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/devices/BlockVoidBeacon.java @@ -37,7 +37,7 @@ public boolean isOpaqueCube(IBlockState state) { @Override @SideOnly(Side.CLIENT) - public BlockRenderLayer getBlockLayer() { + public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/essentia/BlockCreativeEssentiaJar.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/essentia/BlockCreativeEssentiaJar.java index 5c45334c..d800af57 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/essentia/BlockCreativeEssentiaJar.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/essentia/BlockCreativeEssentiaJar.java @@ -71,7 +71,7 @@ public SoundType getSoundType() { @Override @SideOnly(Side.CLIENT) - public BlockRenderLayer getBlockLayer() { + public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.TRANSLUCENT; } @@ -165,7 +165,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if (phialAspects != null && phialAspects.size() == 1) { Aspect aspect = phialAspects.getAspects()[0]; if (!worldIn.isRemote && playerIn.getHeldItem(hand).getItemDamage() != 0 && tileEntity.amount <= (CAPACITY - 10) && tileEntity.doesContainerAccept(aspect) && tileEntity.addToContainer(aspect, 10) == 0) { - worldIn.markAndNotifyBlock(pos, worldIn.getChunkFromBlockCoords(pos), state, state, 0x3); + worldIn.markAndNotifyBlock(pos, worldIn.getChunk(pos), state, state, 0x3); tileEntity.syncTile(true); playerIn.getHeldItem(hand).shrink(1); ItemStack newPhialStack = new ItemStack(itemPhial, 1, 0); @@ -192,7 +192,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, if (worldIn.isRemote) { worldIn.playSound(null, pos, SoundsTC.page, SoundCategory.BLOCKS, 1.0F, 1.0F); } else { - worldIn.spawnEntity(new EntityItem(worldIn, pos.getX() + 0.5F + facing.getFrontOffsetX() / 3.0F, pos.getY() + 0.5F, pos.getZ() + 0.5F + facing.getFrontOffsetZ() / 3.0F, new ItemStack(ItemsTC.label))); + worldIn.spawnEntity(new EntityItem(worldIn, pos.getX() + 0.5F + facing.getXOffset() / 3.0F, pos.getY() + 0.5F, pos.getZ() + 0.5F + facing.getZOffset() / 3.0F, new ItemStack(ItemsTC.label))); } } else if (playerIn.isSneaking() && playerIn.getHeldItem(hand).isEmpty()) { // Dump the jar @@ -228,7 +228,7 @@ public boolean applyLabel(EntityPlayer player, BlockPos pos, EnumFacing side, It } this.onBlockPlacedBy(player.world, pos, player.world.getBlockState(pos), player, null); tileEntity.aspectFilter = tileEntity.aspect; - player.world.markAndNotifyBlock(pos, player.world.getChunkFromBlockCoords(pos), player.world.getBlockState(pos), player.world.getBlockState(pos), 0x3); + player.world.markAndNotifyBlock(pos, player.world.getChunk(pos), player.world.getBlockState(pos), player.world.getBlockState(pos), 0x3); tileEntity.markDirty(); player.world.playSound(null, pos, SoundsTC.jar, SoundCategory.BLOCKS, 0.4F, 1.0F); return true; diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/fluids/BlockFluidQuicksilver.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/fluids/BlockFluidQuicksilver.java index 89c33a78..77c15fd9 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/fluids/BlockFluidQuicksilver.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/fluids/BlockFluidQuicksilver.java @@ -21,13 +21,13 @@ public class BlockFluidQuicksilver extends BlockFluidClassic { public BlockFluidQuicksilver() { super(FluidQuicksilver.INSTANCE, FLUID_QUICKSILVER_MATERIAL); this.setRegistryName(ThaumicWonders.MODID, "fluid_quicksilver"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.setQuantaPerBlock(4); } @Override - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn instanceof EntityLivingBase) { ((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(MobEffects.POISON, 100)); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockHexamite.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockHexamite.java index 4264e647..b7c71aff 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockHexamite.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockHexamite.java @@ -17,12 +17,12 @@ public class BlockHexamite extends BlockTNT { public BlockHexamite() { super(); setRegistryName(ThaumicWonders.MODID, "hexamite"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); } @Override - public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { + public void onExplosionDestroy(World worldIn, BlockPos pos, Explosion explosionIn) { if (!worldIn.isRemote) { EntityHexamitePrimed entityPrimed = new EntityHexamitePrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); entityPrimed.setFuse((short)(worldIn.rand.nextInt(entityPrimed.getFuse() / 4) + entityPrimed.getFuse() / 8)); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockTWPlaceholder.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockTWPlaceholder.java index 9a95f2f9..09d44eb5 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockTWPlaceholder.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/misc/BlockTWPlaceholder.java @@ -31,7 +31,7 @@ public BlockTWPlaceholder(String name) { } @Override - public EnumPushReaction getMobilityFlag(IBlockState state) { + public EnumPushReaction getPushReaction(IBlockState state) { return EnumPushReaction.BLOCK; } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/plants/AbstractBlockMysticCrop.java b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/plants/AbstractBlockMysticCrop.java index 1beb1a6a..173ec76f 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/plants/AbstractBlockMysticCrop.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/blocks/plants/AbstractBlockMysticCrop.java @@ -17,7 +17,7 @@ public abstract class AbstractBlockMysticCrop extends BlockCrops { public AbstractBlockMysticCrop(String name) { super(); this.setRegistryName(ThaumicWonders.MODID, name); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); } protected abstract IBlockState getMatureBlockState(); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/entities/EntityPrimalArrow.java b/src/main/java/com/verdantartifice/thaumicwonders/common/entities/EntityPrimalArrow.java index 3e8c0ab4..0caa893f 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/entities/EntityPrimalArrow.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/entities/EntityPrimalArrow.java @@ -365,7 +365,7 @@ protected void onHit(RayTraceResult raytraceResultIn) { this.setIsCritical(false); if (iblockstate.getMaterial() != Material.AIR) { - this.inTile.onEntityCollidedWithBlock(this.world, blockpos, iblockstate, this); + this.inTile.onEntityCollision(this.world, blockpos, iblockstate, this); } } } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemNightVisionGoggles.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemNightVisionGoggles.java index 3b941319..dd752033 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemNightVisionGoggles.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemNightVisionGoggles.java @@ -34,7 +34,7 @@ public class ItemNightVisionGoggles extends ItemArmor implements IBauble, IRende public ItemNightVisionGoggles() { super(ThaumcraftMaterials.ARMORMAT_SPECIAL, 4, EntityEquipmentSlot.HEAD); this.setRegistryName(ThaumicWonders.MODID, "night_vision_goggles"); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.setMaxDamage(350); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemVoidFortressArmor.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemVoidFortressArmor.java index 37282693..b79ff64c 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemVoidFortressArmor.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/armor/ItemVoidFortressArmor.java @@ -37,7 +37,7 @@ public class ItemVoidFortressArmor extends ItemArmor implements ISpecialArmor, I public ItemVoidFortressArmor(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); this.setRegistryName(ThaumicWonders.MODID, name); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/base/ItemTW.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/base/ItemTW.java index 0660e5c4..f5a85c9d 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/base/ItemTW.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/base/ItemTW.java @@ -20,7 +20,7 @@ public ItemTW(String name) { public ItemTW(String name, String... variants) { super(); setRegistryName(ThaumicWonders.MODID, name); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.baseName = name; @@ -33,11 +33,11 @@ public ItemTW(String name, String... variants) { } @Override - public String getUnlocalizedName(ItemStack stack) { + public String getTranslationKey(ItemStack stack) { if (this.getHasSubtypes() && stack.getMetadata() < this.variants.length && this.variants[stack.getMetadata()] != this.baseName) { - return String.format(super.getUnlocalizedName() + ".%s", this.variants[stack.getMetadata()]); + return String.format(super.getTranslationKey() + ".%s", this.variants[stack.getMetadata()]); } else { - return super.getUnlocalizedName(stack); + return super.getTranslationKey(stack); } } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPanacea.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPanacea.java index ada02fa7..3a76c120 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPanacea.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPanacea.java @@ -29,7 +29,7 @@ public ItemPanacea() { super(6, 1.8F, false); this.baseName = "panacea"; this.setRegistryName(ThaumicWonders.MODID, this.baseName); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.setAlwaysEdible(); @@ -42,11 +42,11 @@ public ItemPanacea() { } @Override - public String getUnlocalizedName(ItemStack stack) { + public String getTranslationKey(ItemStack stack) { if (this.getHasSubtypes() && stack.getMetadata() < this.variants.length && this.variants[stack.getMetadata()] != this.baseName) { - return String.format(super.getUnlocalizedName() + ".%s", this.variants[stack.getMetadata()]); + return String.format(super.getTranslationKey() + ".%s", this.variants[stack.getMetadata()]); } else { - return super.getUnlocalizedName(stack); + return super.getTranslationKey(stack); } } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPrimalArrow.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPrimalArrow.java index 620517c2..09e217dc 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPrimalArrow.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/consumables/ItemPrimalArrow.java @@ -25,7 +25,7 @@ public class ItemPrimalArrow extends ItemArrow implements IVariantItem { public ItemPrimalArrow() { this.baseName = "primal_arrow"; setRegistryName(ThaumicWonders.MODID, this.baseName); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.variants = new String[] { "air", "earth", "fire", "water", "order", "entropy" }; @@ -37,11 +37,11 @@ public ItemPrimalArrow() { } @Override - public String getUnlocalizedName(ItemStack stack) { + public String getTranslationKey(ItemStack stack) { if (this.getHasSubtypes() && stack.getMetadata() < this.variants.length && this.variants[stack.getMetadata()] != this.baseName) { - return String.format(super.getUnlocalizedName() + ".%s", this.variants[stack.getMetadata()]); + return String.format(super.getTranslationKey() + ".%s", this.variants[stack.getMetadata()]); } else { - return super.getUnlocalizedName(stack); + return super.getTranslationKey(stack); } } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/misc/ItemTimewinder.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/misc/ItemTimewinder.java index cbf5e67b..916a4c0a 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/misc/ItemTimewinder.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/misc/ItemTimewinder.java @@ -25,7 +25,7 @@ public class ItemTimewinder extends ItemClock implements IRechargable { public ItemTimewinder() { super(); setRegistryName(ThaumicWonders.MODID, "timewinder"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); setMaxStackSize(1); setNoRepair(); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemCinderpearlSeed.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemCinderpearlSeed.java index 992f27b5..3cb09e44 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemCinderpearlSeed.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemCinderpearlSeed.java @@ -13,7 +13,7 @@ public class ItemCinderpearlSeed extends ItemSeeds { public ItemCinderpearlSeed() { super(BlocksTW.CINDERPEARL_CROP, Blocks.SAND); setRegistryName(ThaumicWonders.MODID, "cinderpearl_seed"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemShimmerleafSeed.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemShimmerleafSeed.java index 19b8e345..e0f226f3 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemShimmerleafSeed.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemShimmerleafSeed.java @@ -13,7 +13,7 @@ public class ItemShimmerleafSeed extends ItemSeeds { public ItemShimmerleafSeed() { super(BlocksTW.SHIMMERLEAF_CROP, Blocks.GRASS); setRegistryName(ThaumicWonders.MODID, "shimmerleaf_seed"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemVishroomSpore.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemVishroomSpore.java index 37ca66d0..c25211c4 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemVishroomSpore.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/plants/ItemVishroomSpore.java @@ -13,7 +13,7 @@ public class ItemVishroomSpore extends ItemSeeds { public ItemVishroomSpore() { super(BlocksTW.VISHROOM_CROP, Blocks.GRASS); setRegistryName(ThaumicWonders.MODID, "vishroom_spore"); - setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); setCreativeTab(ThaumicWonders.CREATIVE_TAB); } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemBoneBow.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemBoneBow.java index 877c8eca..d9a5db1e 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemBoneBow.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemBoneBow.java @@ -30,7 +30,7 @@ public class ItemBoneBow extends ItemBow implements IRechargable { public ItemBoneBow() { this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.setRegistryName(ThaumicWonders.MODID, "bone_bow"); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); this.setMaxStackSize(1); this.setMaxDamage(512); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemPrimalDestroyer.java b/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemPrimalDestroyer.java index c910b8f9..5dd9ddab 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemPrimalDestroyer.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/items/tools/ItemPrimalDestroyer.java @@ -40,7 +40,7 @@ public ItemPrimalDestroyer() { super(toolMatVoidflame); this.setCreativeTab(ThaumicWonders.CREATIVE_TAB); this.setRegistryName(ThaumicWonders.MODID, "primal_destroyer"); - this.setUnlocalizedName(ThaumicWonders.MODID + "." + this.getRegistryName().getResourcePath()); + this.setTranslationKey(ThaumicWonders.MODID + "." + this.getRegistryName().getPath()); } @Override diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/misc/CreativeTabTW.java b/src/main/java/com/verdantartifice/thaumicwonders/common/misc/CreativeTabTW.java index d5e31d59..134096e3 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/misc/CreativeTabTW.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/misc/CreativeTabTW.java @@ -4,6 +4,8 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class CreativeTabTW extends CreativeTabs { @@ -16,8 +18,8 @@ public CreativeTabTW(int index, String label) { } @Override - public ItemStack getTabIconItem() { + @SideOnly(Side.CLIENT) + public ItemStack createIcon() { return new ItemStack(ItemsTW.FLYING_CARPET); } - } diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/network/packets/PacketDimensionalRipperFx.java b/src/main/java/com/verdantartifice/thaumicwonders/common/network/packets/PacketDimensionalRipperFx.java index fc848cfa..9b9e86a7 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/network/packets/PacketDimensionalRipperFx.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/network/packets/PacketDimensionalRipperFx.java @@ -57,9 +57,9 @@ private void handle(PacketDimensionalRipperFx message, MessageContext ctx) { if (state.getBlock() instanceof IBlockFacing) { EnumFacing blockFacing = state.getValue(IBlockFacing.FACING); FXDispatcher.INSTANCE.beamBore( - message.source.getX() + 0.5D + (blockFacing.getFrontOffsetX() / 2.0D), - message.source.getY() + 0.5D + (blockFacing.getFrontOffsetY() / 2.0D), - message.source.getZ() + 0.5D + (blockFacing.getFrontOffsetZ() / 2.0D), + message.source.getX() + 0.5D + (blockFacing.getXOffset() / 2.0D), + message.source.getY() + 0.5D + (blockFacing.getYOffset() / 2.0D), + message.source.getZ() + 0.5D + (blockFacing.getZOffset() / 2.0D), message.target.getX() + 0.5D, message.target.getY() + 0.5D, message.target.getZ() + 0.5D, diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/AbstractTileResearchEngine.java b/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/AbstractTileResearchEngine.java index 1ca9d46a..5f2eef0f 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/AbstractTileResearchEngine.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/AbstractTileResearchEngine.java @@ -70,7 +70,7 @@ private void fill() { int taken = otherTile.takeEssentia(this.getAspect(), 1, face.getOpposite()); int leftover = this.addToContainer(this.getAspect(), taken); if (leftover > 0) { - ThaumicWonders.LOGGER.info("{} spilling {} essentia on fill", this.blockType.getRegistryName().getResourcePath(), leftover); + ThaumicWonders.LOGGER.info("{} spilling {} essentia on fill", this.blockType.getRegistryName().getPath(), leftover); AuraHelper.polluteAura(this.world, this.pos, leftover, true); } this.syncTile(false); diff --git a/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/TileCatalyzationChamber.java b/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/TileCatalyzationChamber.java index b1abd164..7b701d1a 100644 --- a/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/TileCatalyzationChamber.java +++ b/src/main/java/com/verdantartifice/thaumicwonders/common/tiles/devices/TileCatalyzationChamber.java @@ -203,7 +203,7 @@ private int getBellows() { if ( tile != null && tile instanceof TileBellows && BlockStateUtils.getFacing(this.world.getBlockState(tilePos)) == dir.getOpposite() && - this.world.isBlockIndirectlyGettingPowered(tilePos) == 0 ) { + this.world.getRedstonePowerFromNeighbors(tilePos) == 0 ) { count++; } } @@ -213,8 +213,8 @@ private int getBellows() { private void setFacing() { EnumFacing face = this.getFacing().getOpposite(); - this.facingX = face.getFrontOffsetX(); - this.facingZ = face.getFrontOffsetZ(); + this.facingX = face.getXOffset(); + this.facingZ = face.getZOffset(); } @Override