Compare commits

...
87 Commits
Author SHA1 Message Date
Dream Master 1c69ce9b4d update 2025-08-16 18:47:40 +07:00
Pedro Ortiz Bledow 1049ca875c Add sound for Maintenance Focus (#100) 2025-08-15 17:35:40 +07:00
Dream Master 1d613494e9 update 2025-08-04 09:58:02 +07:00
Andreyandgithub-actions[bot] 1d81835e32 Fix solar panel draining Thaumcraft node twice (#98)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-04 08:17:34 +07:00
boubou19 940073709b Speed up forge event registration (#97) 2025-07-17 23:01:47 +00:00
Martin Robertz 9052428a3d update 2025-06-21 00:32:16 +02:00
JuliaandMartin Robertz e1e53af24f Update uses of crafting tools (#96)
Co-authored-by: Martin Robertz <[email protected]>
2025-05-25 16:34:37 +02:00
ceg 71c9976777 Fix ConcurrentModificationException in ItemShieldFocus (#95) 2025-05-18 19:04:37 +02:00
Martin Robertz cc46d6a039 update 2025-05-16 21:57:46 +02:00
Caedis 358a1f213e Replace Baubles with Baubles Expanded (#94) 2025-05-13 08:07:24 -05:00
Martin Robertz 91a816555b update 2025-04-28 20:26:16 +02:00
koolkrafter5 bb9ed2f219 Fix a bug where the essentia generator overdraws essentia from every nearby jar and voids essentia over its max capacity.
Make it so non-full generators do not check 9^3 blocks every tick for jars. The timer is set to 40 ticks (2 seconds) on failure. This reuses the timer value that was previously set to 0 every tick.
Fix logic error where a refuel value over 1 (is it ever even changed, or is it just to store the constant?) would overdraw and void essentia.
Move some default values from constructor to field declarations.
Clean up the fillfrompipe method.
2025-04-28 09:20:55 -04:00
Maya 730826c9d9 update 2025-04-23 14:48:09 -05:00
__felix__and__felix__ 0650072b85 Change optional decorator modid from gregtech to gregtech_nh for gt6 compat (#92)
Co-authored-by: __felix__ <134875831+48a3efa65c881ef567345b17f3910e06@users.noreply.github.com>
2025-04-23 14:48:01 -05:00
Maya d48233f266 update 2025-04-08 14:14:09 -05:00
Niclas Klugmann 367f37c7d5 Move Nano/Quantum armor pieces to GT Hazard API (#91) 2025-04-08 14:12:38 -05:00
Maya a1151399fc update 2025-03-16 13:11:39 -05:00
koolkrafter5 cb68d0a951 EMT Foci Bugfixes/Cleanup (#90) 2025-03-16 13:11:20 -05:00
Martin Robertz 3456ce64d7 update 2024-12-31 14:39:51 +01:00
glowredman f3ccdb450d Add Localizations (#89) 2024-12-30 17:44:06 -06:00
Martin Robertz 6df81d82d1 update gt version 2024-12-23 19:30:24 +01:00
Maya 83733212fb update 2024-12-17 10:02:40 -06:00
Maya 721c5c6aca Migrate Research Completer to GT5u (#88) 2024-12-15 17:18:48 -06:00
Martin Robertz 501cca5fd2 update 2024-10-20 11:42:08 +02:00
MeegooandMartin Robertz 7ec71bdcc9 Reset fall damage when holding shift or space with wings (#85)
Co-authored-by: Martin Robertz <[email protected]>
2024-10-20 11:41:35 +02:00
Alexdoruandgithub-actions[bot] c450204272 Multi ToolTip unification (#86)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-14 16:30:02 +02:00
Martin Robertz 58c206501b update 2024-09-06 23:04:52 +02:00
AlexdoruandMartin Robertz e7aaf791ad nuke-ic2-recipes (#83)
Co-authored-by: Martin Robertz <[email protected]>
2024-09-06 16:39:05 +02:00
Martin Robertz ab52ffb5df update 2024-09-03 23:20:47 +02:00
NotAPenguin 7eabde56d9 fix compatibility with the great renaming (#84) 2024-09-03 11:03:29 +02:00
boubou19GitHub GTNH Actionsgithub-actions[bot]
6d8ec1365a Use GT5U Enums (#81)
* use GT5U enums

* spotlessApply (#82)

Co-authored-by: GitHub GTNH Actions <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-31 02:48:14 +02:00
Ethryan 732ccd3b45 Fix it to display the added augments on the focus, (#79)
* Fix it to display the added augments on the focus,
2024-08-15 02:46:25 +02:00
Dream Master b16109fd9d update 2024-08-04 23:30:11 +07:00
Martin Robertz 1087b3dda0 update 2024-05-31 18:46:29 +02:00
Alastors 9f6aac9db0 Flybug + inertial canceling (#78) 2024-05-31 12:42:54 -04:00
Martin Robertz b4f208eca7 update 2024-05-28 08:09:21 +02:00
Martin Robertz f26bd2c290 UPDATE 2024-05-19 13:27:13 +02:00
Caedis 6fea13084d Removed ModelWings Allocations (#77)
* Removed ModelWings Allocations

* init on first call

* Fix wings and speical armor

* spotless
2024-05-19 00:17:44 -05:00
Alastors 5074d8ba1d Update ItemElectricBootsTraveller.java 2024-05-06 23:14:33 +02:00
74d1aced60 Allow changing Electric Boots using ThaumicBoots Keybinds. (#75)
* Allow changing Traveler Boots speed using ThaumicBoots Keybinds.

* Air speed bonus gets modified by speedModifier

* Spotless Apply :/

* Added the temp lib file for tests

This should instead use the remote dependency system once TB PR 27 is merged

* Fix potential NSM exception when GTNH Thaumic Boots is not present.

* Spotless apply.

* Now using ThaumicBoots 1.2.2-Pre build

* Delete ThaumicBoots-1.2.1-master+4e33b9941e-dirty-dev.jar

* Fixed DuplicateMod, Excluded EMT from the ThaumicBoots pre jar

* Fixing the EMT Issues + Updating the way the Electric Boots Work

* Update dependencies.gradle

* update

---------

Co-authored-by: Alastors <[email protected]>
Co-authored-by: Martin Robertz <[email protected]>
2024-05-06 13:48:33 -04:00
Martin Robertz 547db6d7d0 update 2024-03-26 20:08:50 +01:00
glowredman 93dd3c91c2 Another Cleanup + Removal of GT-Harddep (#74)
* Update deps

* Fix generics

* Deobfuscate parameters

* Minor fixes

* Remove GT harddep

* Exclude GT6
2024-03-26 19:45:31 +01:00
Abdiel Kavash f7a608bf2b cleanup 2024-03-10 07:11:50 +01:00
Abdiel Kavash 787bed088f TileEntitySolarBase 2024-03-10 07:11:50 +01:00
Abdiel Kavash d57ee09abf TileEntityBaseGenerator 2024-03-10 07:11:50 +01:00
Abdiel Kavash 6a7262c066 bs + dep 2024-03-10 07:11:50 +01:00
Martin Robertz 31cf03db4e update 2024-02-18 22:00:37 +01:00
Sampsa 224ae70609 Apply boot speed bonus unidirectionally 2024-02-18 20:25:55 +01:00
kamenskyi 4d2d360be2 Update ru_RU.lang 2024-02-12 19:52:34 +01:00
Raven Szewczyk eed4618ace [ci skip] upgraded build system 2024-02-04 19:58:09 +00:00
chochem f3e84bcda0 RA2 EMT 2024-01-14 23:02:31 +01:00
Martin Robertz c7e649e292 update bs+deps 2024-01-12 00:24:58 +01:00
Raven Szewczyk e41e40f425 [ci skip] upgraded build system 2024-01-08 21:25:15 +00:00
Martin Robertz bbd05762d7 update deps 2023-12-04 13:44:53 +01:00
Martin Robertz 39f6a92404 Update dependencies.gradle 2023-12-04 09:16:03 +01:00
Martin Robertz 37ec69859d update gradle+dep+bs 2023-12-03 12:46:53 +01:00
GitHub GTNH Actions f84acae4c4 spotlessApply 2023-12-03 12:34:16 +01:00
glowredman 8541c421eb Register blocks/items/TEs in preInit 2023-12-03 12:34:16 +01:00
Martin Robertz 68351caa3f update deps 2023-10-30 08:36:00 +01:00
kuba6000 cecd0b34ea Remove textures 2023-10-30 08:24:44 +01:00
kuba6000 37aac854b5 Remove DEFC 2023-10-30 08:24:44 +01:00
Martin Robertz e6fe00e986 update bs+deps+gitignore 2023-10-25 19:05:28 +02:00
Alastors bf496967aa Say goodbye to your LEGs (#66) 2023-10-25 10:15:22 -04:00
Caedis 5e1a996798 Update buildscript (#65)
* Update buildscript

+update deps and nuke repositories.gradle

* Remove wildcard imports

* Remove .github/scripts folder as well
2023-10-11 00:37:18 -05:00
AlastorsGitHub GTNH Actionsgithub-actions[bot]
29144cfe3e Mark Bart's LEG for termination (#61)
* Mark Bart's LEG for termination

marking as deprecated for it's future termination.

* spotlessApply (#62)

Co-authored-by: GitHub GTNH Actions <>

* Mark the Hatch and LEG

* Update en_US.lang

* Update EMT_Large_Essentia_Gen.java

* spotlessApply (#64)

Co-authored-by: GitHub GTNH Actions <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-13 20:20:25 +02:00
Dakota Jones 78b68dec47 Fix maintenance focus NPE (#63) 2023-07-04 03:57:15 -07:00
Martin Robertz 5053be782b update bs 2023-05-06 08:40:47 +02:00
Ryan Nasers c5a72c0dff Adding a maintenance foci, thaumic alternative to carrying a toolbox/duct-tape (#60)
* Added maintenance focus.

* Changing some lang to alastor's liking.

* Some tweaks and spotless apply.

* Some tweaks and spotless apply.

* Removed as many extra calls as I could.
2023-05-06 08:38:34 +02:00
Jason MitchellandMartin Robertz e20ae4f103 ForgeDirection (#59)
* ForgeDirection

* Update dependencies.gradle

* update bs

---------

Co-authored-by: Martin Robertz <[email protected]>
2023-05-01 14:03:15 +02:00
Martin Robertz fe84247b9e Update dependencies.gradle 2023-04-23 10:09:50 +02:00
Martin Robertz 0a55e842b1 Fix Materials (#58)
* update buildscript + spottless

* update to newest gt version

* spotless
2023-04-21 19:11:20 +02:00
Jason Mitchell 89154325ee Less super fast (#57)
* update BS

* Sneaking makes things half as fast
2023-02-11 22:15:07 -08:00
Raven Szewczyk f93be63ac7 [ci skip] upgraded build system 2023-01-31 09:52:25 +00:00
Jason Mitchell 09ed4db5b4 [ci skip] Add git-blame-ignore-revs for spotlessApply 2023-01-28 18:41:54 -08:00
Jason Mitchell 6bdb2c0b96 [ci skip] spotlessApply with the new settings 2023-01-28 18:41:54 -08:00
Jason Mitchell c312069d28 [ci skip] Update buildscript to RetroFuturaGradle 2023-01-28 18:41:21 -08:00
Alexdoru 43c4963f3a keybinds (#56)
* unbind keybind by default and put mod name as category

* use isPressed() instead of getIsPressed()
2023-01-27 22:31:25 +01:00
miozune 2690cd2cd8 Remove individual NEI handler (#55) 2023-01-02 17:32:39 +01:00
AndreyGitHub GTNH Actionsgithub-actions[bot]
92b3fb8388 Add jump distance behaviour as it was in original Traveller's Boots (#53)
* DO apply the default behaviour of Traveller's Boots (jump distance) as written in QuestBook and Thaumonomicon

* spotlessApply (#54)

Co-authored-by: Andrey <[email protected]>
Co-authored-by: GitHub GTNH Actions <>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-02 10:49:54 +01:00
miozune ef5a92448c Rewrite GUIs with ModularUI (#52)
* Rewrite GUIs with ModularUI

* Check null stack
2022-12-10 20:14:47 +01:00
d21ba33277 All numbers will obey... (#50)
* Formatting

* spotlessApply (#51)

Co-authored-by: Connor-Colenso <[email protected]>
Co-authored-by: GitHub GTNH Actions <>

Co-authored-by: GTNH-Colen <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-01 14:37:17 +01:00
miozune ab58fc5890 Fix id shift (#49) 2022-10-25 09:06:42 +02:00
Kiwi 6ee77f5da4 Update zh_CN.lang (#48)
* Update zh_CN.lang

* Update zh_CN.lang
2022-09-24 12:38:56 +02:00
greesyB d798f5df68 Make industrial wand recharger a valid energy consumer (#46)
* Update buildscript

* Make industrial wand recharger a valid energy consumer

* Redundant variable

* Add gitattributes
2022-08-29 17:57:15 +02:00
miozune f3de9f25a5 Purge OpV (fix error voltage) (#47)
* Purge OpV (fix error voltage)

* this is better
2022-08-24 11:49:50 +02:00
Martin Robertz a26415bf6e Update de_DE.lang 2022-08-21 15:40:25 +02:00
Martin Robertz 93ba5763f6 Info text (#45)
* add info text for Schemtaics

* add color

* make tooltip translate able

* add de lang file
2022-08-21 15:35:34 +02:00
154 changed files with 4827 additions and 7963 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
# Ignore spotlessApply reformat
6bdb2c0b96290f05da0233ac9f564fc35a9722b2
+44
View File
@@ -0,0 +1,44 @@
* text eol=lf
*.[jJ][aA][rR] binary
*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary
*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary
*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary
*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
*.[pP][aA][tT][cC][hH] -text
*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/env bash
# bashsupport disable=BP5006 # Global environment variables
RUNDIR="run" \
CRASH="crash-reports" \
SERVERLOG="server.log"
# enable nullglob to get 0 results when no match rather than the pattern
shopt -s nullglob
# store matches in array
crash_reports=("$RUNDIR/$CRASH/crash"*.txt)
# if array not empty there are crash_reports
if [ "${#crash_reports[@]}" -gt 0 ]; then
# get the latest crash_report from array
latest_crash_report="${crash_reports[-1]}"
{
printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}"
cat "$latest_crash_report"
} >&2
exit 1
fi
if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then
{
printf 'Fatal errors detected:\n'
cat server.log
} >&2
exit 1
fi
if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \
"$SERVERLOG"; then
{
printf 'Server force stopped:'
cat server.log
} >&2
exit 1
fi
if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
{
printf 'Server did not finish startup:'
cat server.log
} >&2
exit 1
fi
printf 'No crash reports detected'
exit 0
+1
View File
@@ -30,3 +30,4 @@ src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
layout.json
+2 -939
View File
@@ -1,942 +1,5 @@
//version: 1660899027
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
*/
//version: 1707058017
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory
import java.nio.file.Files
import java.nio.file.Paths
import java.util.concurrent.TimeUnit
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream
buildscript {
repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
maven {
name 'jitpack'
url 'https://jitpack.io'
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
}
}
plugins {
id 'java-library'
id 'idea'
id 'eclipse'
id 'scala'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false
id 'org.ajoberstar.grgit' version '4.1.1'
id 'com.github.johnrengelman.shadow' version '4.0.4'
id 'com.palantir.git-version' version '0.13.0' apply false
id 'de.undercouch.download' version '5.0.1'
id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false
id 'com.diffplug.spotless' version '6.7.2' apply false
}
verifySettingsGradle()
dependencies {
implementation 'com.diffplug:blowdryer:1.6.0'
}
apply plugin: 'com.diffplug.blowdryer'
if (project.file('.git/HEAD').isFile()) {
apply plugin: 'com.palantir.git-version'
}
def out = services.get(StyledTextOutputFactory).create('an-output')
apply plugin: 'forge'
def projectJavaVersion = JavaLanguageVersion.of(8)
java {
toolchain {
languageVersion.set(projectJavaVersion)
}
}
idea {
module {
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
if (!disableSpotless) {
apply plugin: 'com.diffplug.spotless'
apply from: Blowdryer.file('spotless.gradle')
}
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
}
checkPropertyExists("modName")
checkPropertyExists("modId")
checkPropertyExists("modGroup")
checkPropertyExists("autoUpdateBuildScript")
checkPropertyExists("minecraftVersion")
checkPropertyExists("forgeVersion")
checkPropertyExists("replaceGradleTokenInFile")
checkPropertyExists("gradleTokenModId")
checkPropertyExists("gradleTokenModName")
checkPropertyExists("gradleTokenVersion")
checkPropertyExists("gradleTokenGroupName")
checkPropertyExists("apiPackage")
checkPropertyExists("accessTransformersFile")
checkPropertyExists("usesMixins")
checkPropertyExists("mixinPlugin")
checkPropertyExists("mixinsPackage")
checkPropertyExists("coreModClass")
checkPropertyExists("containsMixinsAndOrCoreModOnly")
checkPropertyExists("usesShadowedDependencies")
checkPropertyExists("developmentEnvironmentUserName")
boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
boolean usesMixinDebug = project.hasProperty('usesMixinDebug') ?: project.usesMixins.toBoolean()
boolean forceEnableMixins = project.hasProperty('forceEnableMixins') ? project.forceEnableMixins.toBoolean() : false
String channel = project.hasProperty('channel') ? project.channel : 'stable'
String mappingsVersion = project.hasProperty('mappingsVersion') ? project.mappingsVersion : '12'
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
if(apiPackage) {
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
}
if(accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
if(!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
}
if(usesMixins.toBoolean()) {
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
}
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
}
}
if(coreModClass) {
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt"
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
// Make sure GregTech build won't time out
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
}
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
try {
'git config core.fileMode false'.execute()
}
catch (Exception ignored) {
out.style(Style.Failure).println("git isn't installed at all")
}
// Pulls version first from the VERSION env and then git tag
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
}
catch (Exception ignored) {
out.style(Style.Failure).text(
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
)
versionOverride = 'NO-GIT-TAG-SET'
identifiedVersion = versionOverride
}
version = minecraftVersion + '-' + identifiedVersion
ext {
modVersion = identifiedVersion
}
if(identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
}
group = modGroup
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
}
else {
archivesBaseName = modId
}
def arguments = []
def jvmArguments = []
if (usesMixins.toBoolean() || forceEnableMixins) {
arguments += [
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
]
if (usesMixinDebug.toBoolean()) {
jvmArguments += [
"-Dmixin.debug.countInjections=true",
"-Dmixin.debug.verbose=true",
"-Dmixin.debug.export=true"
]
}
}
minecraft {
version = minecraftVersion + '-' + forgeVersion + '-' + minecraftVersion
runDir = 'run'
if (replaceGradleTokenInFile) {
replaceIn replaceGradleTokenInFile
if(gradleTokenModId) {
replace gradleTokenModId, modId
}
if(gradleTokenModName) {
replace gradleTokenModName, modName
}
if(gradleTokenVersion) {
replace gradleTokenVersion, modVersion
}
if(gradleTokenGroupName) {
replace gradleTokenGroupName, modGroup
}
}
clientIntellijRun {
args(arguments)
jvmArgs(jvmArguments)
if(developmentEnvironmentUserName) {
args("--username", developmentEnvironmentUserName)
}
}
serverIntellijRun {
args(arguments)
jvmArgs(jvmArguments)
}
}
if(file('addon.gradle').exists()) {
apply from: 'addon.gradle'
}
apply from: 'repositories.gradle'
configurations {
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
implementation.extendsFrom(shadowCompile)
implementation.extendsFrom(shadeCompile)
}
repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
if(usesMixins.toBoolean() || forceEnableMixins) {
maven {
name 'sponge'
url 'https://repo.spongepowered.org/repository/maven-public'
}
maven {
url 'https://jitpack.io'
}
}
}
dependencies {
if(usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
annotationProcessor('com.google.guava:guava:24.1.1-jre')
annotationProcessor('com.google.code.gson:gson:2.8.6')
annotationProcessor('org.spongepowered:mixin:0.8-SNAPSHOT')
}
if(usesMixins.toBoolean() || forceEnableMixins) {
// using 0.8 to workaround a issue in 0.7 which fails mixin application
compile('com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH') {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
compile('com.github.GTNewHorizons:SpongeMixins:1.5.0')
}
}
apply from: 'dependencies.gradle'
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
task generateAssets {
if (usesMixins.toBoolean()) {
def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json");
if (!mixinConfigFile.exists()) {
mixinConfigFile.text = """{
"required": true,
"minVersion": "0.7.11",
"package": "${modGroup}.${mixinsPackage}",
"plugin": "${modGroup}.${mixinPlugin}",
"refmap": "${mixingConfigRefMap}",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8",
"mixins": [],
"client": [],
"server": []
}
"""
}
}
}
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = modGroup + ".shadow"
}
shadowJar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
configurations = [
project.configurations.shadowImplementation,
project.configurations.shadowCompile
]
dependsOn(relocateShadowJar)
}
jar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
if(usesShadowedDependencies.toBoolean()) {
dependsOn(shadowJar)
enabled = false
}
}
reobf {
if(usesMixins.toBoolean() && file(mixinSrg).exists()) {
addExtraSrgFile mixinSrg
}
}
afterEvaluate {
if(usesMixins.toBoolean()) {
tasks.compileJava {
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobf.srg}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl",
"-XDignore.symbol.file"
]
}
}
}
runClient {
if(developmentEnvironmentUserName) {
arguments += [
"--username",
developmentEnvironmentUserName
]
}
args(arguments)
jvmArgs(jvmArguments)
}
runServer {
args(arguments)
jvmArgs(jvmArguments)
}
tasks.withType(JavaExec).configureEach {
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion = projectJavaVersion
}
)
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
exclude("spotless.gradle")
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace modVersion and minecraftVersion
expand "minecraftVersion": project.minecraft.version,
"modVersion": modVersion,
"modId": modId,
"modName": modName
}
if(usesMixins.toBoolean()) {
from refMap
}
// copy everything else that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'spotless.gradle'
}
}
def getManifestAttributes() {
def manifestAttributes = [:]
if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
}
if(accessTransformersFile) {
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
}
if(coreModClass) {
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
}
if(usesMixins.toBoolean()) {
manifestAttributes += [
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs" : "mixins." + modId + ".json",
"ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean()
]
}
return manifestAttributes
}
task sourcesJar(type: Jar) {
from (sourceSets.main.allSource)
from (file("$projectDir/LICENSE"))
getArchiveClassifier().set('sources')
}
task shadowDevJar(type: ShadowJar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
configurations = [
project.configurations.shadowImplementation,
project.configurations.shadowCompile
]
}
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
target = tasks.shadowDevJar
prefix = modGroup + ".shadow"
}
task circularResolverJar(type: Jar) {
dependsOn(relocateShadowDevJar)
dependsOn(shadowDevJar)
enabled = false
}
task devJar(type: Jar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest {
attributes(getManifestAttributes())
}
if(usesShadowedDependencies.toBoolean()) {
dependsOn(circularResolverJar)
enabled = false
}
}
task apiJar(type: Jar) {
from (sourceSets.main.allSource) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
}
from (sourceSets.main.output) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
}
from (sourceSets.main.resources.srcDirs) {
include("LICENSE")
}
getArchiveClassifier().set('api')
}
artifacts {
if(!noPublishedSources) {
archives sourcesJar
}
archives devJar
if(apiPackage) {
archives apiJar
}
}
// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID),
// and isn't strictly needed with the POM so just disable it.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
// workaround variable hiding in pom processing
def projectConfigs = project.configurations
publishing {
publications {
maven(MavenPublication) {
from components.java
if(usesShadowedDependencies.toBoolean()) {
artifact source: shadowJar, classifier: ""
}
if(!noPublishedSources) {
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
artifact source: apiJar, classifier: "api"
}
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
// Using the identified version, not project.version as it has the prepended 1.7.10
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
// remove extra garbage from minecraft and minecraftDeps configuration
pom.withXml {
def badArtifacts = [:].withDefault {[] as Set<String>}
for (configuration in [
projectConfigs.minecraft,
projectConfigs.minecraftDeps
]) {
for (dependency in configuration.allDependencies) {
badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name
}
}
// example for specifying extra stuff to ignore
// badArtifacts["org.example.group"] += "artifactName"
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
badArtifacts[it.groupId.text()].contains(it.artifactId.text())
}.each() {
it.parent().remove(it)
}
}
}
}
repositories {
maven {
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
}
}
}
}
// Updating
task updateBuildScript {
doLast {
if (performBuildScriptUpdate(projectDir.toString())) return
print("Build script already up-to-date!")
}
}
if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (autoUpdateBuildScript.toBoolean()) {
performBuildScriptUpdate(projectDir.toString())
} else {
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
}
}
static URL availableBuildScriptUrl() {
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
}
static URL exampleSettingsGradleUrl() {
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/settings.gradle.example")
}
def verifySettingsGradle() {
def settingsFile = getFile("settings.gradle")
if (!settingsFile.exists()) {
println("Downloading default settings.gradle")
exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } }
throw new GradleException("Settings.gradle has been updated, please re-run task.")
}
}
boolean performBuildScriptUpdate(String projectDir) {
if (isNewBuildScriptVersionAvailable(projectDir)) {
def buildscriptFile = getFile("build.gradle")
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
verifySettingsGradle()
return true
}
return false
}
boolean isNewBuildScriptVersionAvailable(String projectDir) {
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
}
static String getVersionHash(String buildScriptContent) {
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
if(versionLine != null) {
return versionLine.split(": ").last()
}
return ""
}
configure(updateBuildScript) {
group = 'forgegradle'
description = 'Updates the build script to the latest version'
}
// Parameter Deobfuscation
task deobfParams {
doLast {
String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion"
String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip"
String paramsCSV = "$mcpDir/params.csv"
download.run {
src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip"
dest mcpZIP
overwrite false
}
if(!file(paramsCSV).exists()) {
println("Extracting MCP archive ...")
unzip(mcpZIP, mcpDir)
}
println("Parsing params.csv ...")
Map<String, String> params = new HashMap<>()
Files.lines(Paths.get(paramsCSV)).forEach{line ->
String[] cells = line.split(",")
if(cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) {
params.put(cells[0], cells[1])
}
}
out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!")
out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.")
}
}
static int replaceParams(File file, Map<String, String> params) {
int fileCount = 0
if(file.isDirectory()) {
for(File f : file.listFiles()) {
fileCount += replaceParams(f, params)
}
return fileCount
}
println("Visiting ${file.getName()} ...")
try {
String content = new String(Files.readAllBytes(file.toPath()))
int hash = content.hashCode()
params.forEach{key, value ->
content = content.replaceAll(key, value)
}
if(hash != content.hashCode()) {
Files.write(file.toPath(), content.getBytes("UTF-8"))
return 1
}
} catch(Exception e) {
e.printStackTrace()
}
return 0
}
// Credit: bitsnaps (https://gist.github.com/bitsnaps/00947f2dce66f4bbdabc67d7e7b33681)
static unzip(String zipFileName, String outputDir) {
byte[] buffer = new byte[16384]
ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName))
ZipEntry zipEntry = zis.getNextEntry()
while (zipEntry != null) {
File newFile = new File(outputDir + File.separator, zipEntry.name)
if (zipEntry.isDirectory()) {
if (!newFile.isDirectory() && !newFile.mkdirs()) {
throw new IOException("Failed to create directory $newFile")
}
} else {
// fix for Windows-created archives
File parent = newFile.parentFile
if (!parent.isDirectory() && !parent.mkdirs()) {
throw new IOException("Failed to create directory $parent")
}
// write file content
FileOutputStream fos = new FileOutputStream(newFile)
int len = 0
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len)
}
fos.close()
}
zipEntry = zis.getNextEntry()
}
zis.closeEntry()
zis.close()
}
configure(deobfParams) {
group = 'forgegradle'
description = 'Rename all obfuscated parameter names inherited from Minecraft classes'
}
// Dependency Deobfuscation
def deobf(String sourceURL) {
try {
URL url = new URL(sourceURL)
String fileName = url.getFile()
//get rid of directories:
int lastSlash = fileName.lastIndexOf("/")
if(lastSlash > 0) {
fileName = fileName.substring(lastSlash + 1)
}
//get rid of extension:
if(fileName.endsWith(".jar") || fileName.endsWith(".litemod")) {
fileName = fileName.substring(0, fileName.lastIndexOf("."))
}
String hostName = url.getHost()
if(hostName.startsWith("www.")) {
hostName = hostName.substring(4)
}
List parts = Arrays.asList(hostName.split("\\."))
Collections.reverse(parts)
hostName = String.join(".", parts)
return deobf(sourceURL, "$hostName/$fileName")
} catch(Exception e) {
return deobf(sourceURL, "deobf/${sourceURL.hashCode()}")
}
}
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
def deobf(String sourceURL, String rawFileName) {
String bon2Version = "2.5.1"
String fileName = URLDecoder.decode(rawFileName, "UTF-8")
String cacheDir = "$project.gradle.gradleUserHomeDir/caches"
String bon2Dir = "$cacheDir/forge_gradle/deobf"
String bon2File = "$bon2Dir/BON2-${bon2Version}.jar"
String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar"
String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar"
if(file(deobfFile).exists()) {
return files(deobfFile)
}
String mappingsVer
String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/'
if(remoteMappings) {
String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion"
String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip"
zipMappings(mappingsZIP, remoteMappings, bon2Dir)
mappingsVer = "snapshot_$id"
} else {
mappingsVer = "${channel}_$mappingsVersion"
}
download.run {
src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar"
dest bon2File
quiet true
overwrite false
}
download.run {
src sourceURL
dest obfFile
quiet true
overwrite false
}
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
workingDir bon2Dir
standardOutput = new FileOutputStream("${deobfFile}.log")
}
return files(deobfFile)
}
def zipMappings(String zipPath, String url, String bon2Dir) {
File zipFile = new File(zipPath)
if(zipFile.exists()) {
return
}
String fieldsCache = "$bon2Dir/data/fields.csv"
String methodsCache = "$bon2Dir/data/methods.csv"
download.run {
src "${url}fields.csv"
dest fieldsCache
quiet true
}
download.run {
src "${url}methods.csv"
dest methodsCache
quiet true
}
zipFile.getParentFile().mkdirs()
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
zos.putNextEntry(new ZipEntry("fields.csv"))
Files.copy(Paths.get(fieldsCache), zos)
zos.closeEntry()
zos.putNextEntry(new ZipEntry("methods.csv"))
Files.copy(Paths.get(methodsCache), zos)
zos.closeEntry()
zos.close()
}
// Helper methods
def checkPropertyExists(String propertyName) {
if (!project.hasProperty(propertyName)) {
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
}
}
def getFile(String relativePath) {
return new File(projectDir, relativePath)
id 'com.gtnewhorizons.gtnhconvention'
}
+10 -4
View File
@@ -1,9 +1,15 @@
// Add your dependencies here
dependencies {
compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.41.05:dev'
compile 'com.github.GTNewHorizons:Baubles:1.0.1.14:dev'
api('com.github.GTNewHorizons:Baubles-Expanded:2.1.9-GTNH:dev')
api('com.github.GTNewHorizons:ModularUI:1.2.20:dev')
api('com.github.GTNewHorizons:ThaumicBoots:1.4.13:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
exclude module: 'Baubles'
}
compile 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
compile 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
api('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.428:dev')
}
+163 -24
View File
@@ -1,64 +1,203 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Electro-Magic Tools
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = EMT
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = emt
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Whether to use modGroup as the maven publishing group.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = true
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass = emt.EMTTags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = EMT.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage =
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
#customArchiveBaseName =
# customArchiveBaseName =
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
Binary file not shown.
+3 -1
View File
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+180 -117
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# 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.
@@ -15,80 +15,115 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# 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/platforms/jvm/plugins-application/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
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
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
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='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
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
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
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"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,92 +132,120 @@ 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.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
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
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 or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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" ;;
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=SC2039,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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
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, 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.
# 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"
# 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" )
# 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")"
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 optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# 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" "$@"
Vendored
+27 -33
View File
@@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,10 +27,14 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
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"
@@ -37,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
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.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -51,48 +57,36 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
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.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
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%
"%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%"=="0" goto mainEnd
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!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
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
+1 -25
View File
@@ -1,28 +1,4 @@
// Add any additional repositiroes for your dependencies here
// Add any additional repositories for your dependencies here
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
mavenCentral()
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup "curse.maven"
}
}
maven {
url 'https://jitpack.io'
}
}
+19 -6
View File
@@ -1,10 +1,23 @@
pluginManagement {
repositories {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
}
apply plugin: 'com.diffplug.blowdryerSetup'
blowdryerSetup {
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.4')
//devLocal '.' // Use this when testing config updates locally
}
+35 -20
View File
@@ -1,6 +1,13 @@
package emt;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -13,16 +20,15 @@ import cpw.mods.fml.relauncher.Side;
import emt.command.CommandOutputs;
import emt.init.EMTEntities;
import emt.init.Registry;
import emt.nei.NEI_Config;
import emt.network.PacketEMTKeys;
import emt.network.PacketNodeInfo;
import emt.proxy.CommonProxy;
import emt.tile.solar.Solars;
import emt.util.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import emt.util.EMTClientEventHandler;
import emt.util.EMTConfigHandler;
import emt.util.EMTCreativeTab;
import emt.util.EMTDungeonChestGenerator;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTEventHandler;
@Mod(
modid = EMT.MOD_ID,
@@ -31,20 +37,25 @@ import org.apache.logging.log4j.Logger;
guiFactory = EMT.GUI_FACTORY,
dependencies = EMT.DEPENDS)
public class EMT {
public static final String NAME = "Electro-Magic Tools";
public static final String MOD_ID = "EMT";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String TEXTURE_PATH = "emt";
public static final String VERSION = EMTTags.VERSION;
public static final String RESOURCE_PATH = "emt";
public static final String TEXTURE_PATH = RESOURCE_PATH;
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
public static final String CHANNEL = "EMT";
public static final String DEPENDS = "required-after:Thaumcraft;" + "required-after:IC2;"
+ "required-after:gregtech;"
+ "after:Avaritia;"
+ "after:MagicBees;"
+ "after:ForbiddenMagic;"
+ "after:dreamcraft;";
public static final String DEPENDS = """
required-after:Thaumcraft;\
required-after:IC2;\
required-after:modularui;\
after:gregtech;\
after:Avaritia;\
after:MagicBees;\
after:ForbiddenMagic;\
after:dreamcraft""";
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
@@ -55,12 +66,18 @@ public class EMT {
@Mod.Instance("EMT")
public static EMT instance;
public static boolean isBootsActive = false;
public static final String BOOTS = "thaumicboots";
public boolean isSimulating() {
return !FMLCommonHandler.instance().getEffectiveSide().isClient();
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
if (Loader.isModLoaded(BOOTS)) {
isBootsActive = true;
}
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
if (FMLCommonHandler.instance().getSide().isClient()) {
@@ -69,7 +86,9 @@ public class EMT {
Registry.registerPreInit();
EMTEssentiasOutputs.addPrimalOutputs();
registerPackets();
Solars.populateCache();
if (Registry.enableGTCompat) {
Solars.populateCache();
}
}
@Mod.EventHandler
@@ -82,9 +101,6 @@ public class EMT {
}
EMTDungeonChestGenerator.generateLoot();
EMTEntities.registerEMTEntities();
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
NEI_Config.Init();
}
@Mod.EventHandler
@@ -99,6 +115,5 @@ public class EMT {
public void registerPackets() {
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT);
}
}
+3 -1
View File
@@ -1,10 +1,12 @@
package emt.block;
import emt.EMT;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import emt.EMT;
public abstract class BlockBase extends Block {
public final String name;
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
+11 -14
View File
@@ -1,10 +1,5 @@
package emt.block;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEMT;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
@@ -15,6 +10,12 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEMT;
public abstract class BlockBaseContainer extends BlockContainer {
public int instance;
@@ -27,18 +28,13 @@ public abstract class BlockBaseContainer extends BlockContainer {
this(unlocName, material, soundType, 1, hardness);
}
public BlockBaseContainer(
String unlocName, Material material, SoundType soundType, int countOfMetas, float hardness) {
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
float hardness) {
this(unlocName, material, soundType, countOfMetas, 0, hardness);
}
public BlockBaseContainer(
String unlocName,
Material material,
SoundType soundType,
int countOfMetas,
int curInstance,
float hardness) {
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
int curInstance, float hardness) {
super(material);
this.setBlockName(EMT.MOD_ID + "." + unlocName);
this.setCreativeTab(EMT.TAB);
@@ -154,6 +150,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
@SideOnly(Side.CLIENT)
public static class IconSet {
public IIcon top;
public IIcon bottom;
public IIcon side;
@@ -1,10 +1,7 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileElectricCloud;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
@@ -12,10 +9,16 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileElectricCloud;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXSparkle;
public class BlockElectricCloud extends BlockBase {
public IIcon icon;
public BlockElectricCloud(String unlocName) {
@@ -1,11 +1,8 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.generator.TileEntityBaseGenerator;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntitySmokeFX;
@@ -17,6 +14,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.gtnewhorizons.modularui.api.UIInfos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.generator.TileEntityBaseGenerator;
public class BlockEssentiaGenerators extends BlockBaseContainer {
private static int subtypes = 6;
@@ -45,8 +49,9 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
@@ -60,6 +65,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
return new TileEntityBaseGenerator(meta);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z);
@@ -75,8 +81,9 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
}
}
public boolean onBlockActivated(
World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3) {
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
float f3) {
if (player.isSneaking()) {
return false;
}
@@ -85,7 +92,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
}
TileEntity tileentity = world.getTileEntity(i, j, k);
if (tileentity != null) {
player.openGui(emt.EMT.instance, 1, world, i, j, k);
UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
}
return true;
}
+19 -18
View File
@@ -1,14 +1,8 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.gthandler.common.implementations.automation.EssentiaFiller;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import ic2.api.item.IC2Items;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -22,6 +16,15 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.gtnewhorizons.modularui.api.UIInfos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import ic2.api.item.IC2Items;
public class BlockMachines extends BlockBaseContainer {
public BlockMachines(String name) {
@@ -57,7 +60,7 @@ public class BlockMachines extends BlockBaseContainer {
}
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
@@ -69,19 +72,18 @@ public class BlockMachines extends BlockBaseContainer {
return new TileEntityIndustrialWandRecharge();
} else if (meta == 1) {
return new TileEntityEtherealMacerator();
} else if (meta == 2) {
return new EssentiaFiller();
}
return super.createTileEntity(world, meta);
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) {
player.openGui(EMT.instance, 0, world, x, y, z);
} else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) {
player.openGui(EMT.instance, 1, world, x, y, z);
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
if (!world.isRemote) {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityIndustrialWandRecharge || te instanceof TileEntityEtherealMacerator) {
UIInfos.TILE_MODULAR_UI.open(player, world, x, y, z);
}
}
return true;
}
@@ -123,8 +125,7 @@ public class BlockMachines extends BlockBaseContainer {
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound)
item.getTagCompound().copy());
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
}
float factor = 0.05F;
@@ -1,10 +1,7 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityPortableNode;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,6 +9,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityPortableNode;
import thaumcraft.common.blocks.BlockAiry;
public class BlockPortableNode extends BlockAiry {
@@ -67,8 +69,8 @@ public class BlockPortableNode extends BlockAiry {
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
world.setBlockToAir(x, y, z);
world.removeTileEntity(x, y, z);
@@ -77,7 +79,7 @@ public class BlockPortableNode extends BlockAiry {
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
public TileEntity createNewTileEntity(World worldIn, int meta) {
return null;
}
}
+5 -3
View File
@@ -1,9 +1,7 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -13,6 +11,10 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
public class BlockShield extends Block {
public BlockShield(String name) {
+18 -15
View File
@@ -1,11 +1,8 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.solar.Solars;
import java.util.List;
import java.util.Objects;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -17,6 +14,13 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import com.gtnewhorizons.modularui.api.UIInfos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.solar.Solars;
public class BlockSolars extends BlockBaseContainer {
public BlockSolars(String name, int countOfMetas, int instance) {
@@ -40,14 +44,13 @@ public class BlockSolars extends BlockBaseContainer {
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
IIcon[] sides = {side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide};
IIcon[] sides = { side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide };
if (instance != 1 && instance != 0)
for (int i = 0; i < countOfMetas; i++) {
iconSets[i].bottom = bottom;
iconSets[i].side = sides[(Objects.requireNonNull(Solars.getTileEntitySolarBase(instance, i)).aspect)];
iconSets[i].top = tripleSolarTop;
}
if (instance != 1 && instance != 0) for (int i = 0; i < countOfMetas; i++) {
iconSets[i].bottom = bottom;
iconSets[i].side = sides[(Objects.requireNonNull(Solars.getTileEntitySolarBase(instance, i)).aspect)];
iconSets[i].top = tripleSolarTop;
}
else if (instance == 0) {
for (int i = 0; i < countOfMetas; i++) {
iconSets[i].bottom = bottom;
@@ -102,7 +105,7 @@ public class BlockSolars extends BlockBaseContainer {
}
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
for (int meta = 0; meta < countOfMetas; meta++) {
list.add(new ItemStack(id, 1, meta));
}
@@ -135,8 +138,8 @@ public class BlockSolars extends BlockBaseContainer {
}
@Override
public boolean onBlockActivated(
World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3) {
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
float f3) {
if (player.isSneaking()) {
return false;
}
@@ -145,7 +148,7 @@ public class BlockSolars extends BlockBaseContainer {
}
TileEntity tileentity = world.getTileEntity(i, j, k);
if (tileentity != null) {
player.openGui(emt.EMT.instance, 1, world, i, j, k);
UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
}
return true;
}
+7 -3
View File
@@ -1,15 +1,19 @@
package emt.client;
import cpw.mods.fml.client.registry.ClientRegistry;
import emt.util.EMTTextHelper;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import emt.EMT;
import emt.util.EMTTextHelper;
public class EMTKeys {
public static KeyBinding keyUnequip;
public static void registerKeys() {
keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_Z, "EMT");
keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_NONE, EMT.NAME);
ClientRegistry.registerKeyBinding(keyUnequip);
}
}
@@ -0,0 +1,22 @@
package emt.client.gui;
import static emt.EMT.TEXTURE_PATH;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
public class EMT_UITextures {
public static final UITexture OVERLAY_SLOT_FUSION_CRAFTING = UITexture
.fullImage(TEXTURE_PATH, "guis/overlay_slot/fusion_crafter");
public static final UITexture OVERLAY_SLOT_WAND = UITexture.fullImage(TEXTURE_PATH, "guis/overlay_slot/wand");
public static final UITexture PICTURE_GAUGE_EMPTY_25 = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_25");
public static final UITexture PICTURE_GAUGE_GENERATOR = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_generator");
public static final UITexture PICTURE_GAUGE_SOLAR = UITexture.fullImage(TEXTURE_PATH, "guis/picture/gauge_solar");
public static final UITexture PICTURE_GAUGE_EMPTY_11 = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_11");
public static final UITexture PICTURE_SOLAR_INDICATOR = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/solar_indicator");
}
@@ -1,35 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerEtheralMacerator;
import emt.tile.TileEntityEtherealMacerator;
import emt.util.EMTTextHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiEtherealMacerator extends GuiContainer {
public static final ResourceLocation texture =
new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/etherealmacerator.png");
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
super(new ContainerEtheralMacerator(inventory, te));
xSize = 176;
ySize = 165;
}
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -1,91 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ConainerGenerator;
import emt.tile.generator.TileEntityBaseGenerator;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiGenerator extends GuiContainer {
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/generator.png");
TileEntityBaseGenerator tileentity;
private int xSize;
private int ySize;
public GuiGenerator(InventoryPlayer invPlayer, TileEntityBaseGenerator entity) {
super(new ConainerGenerator(invPlayer, entity));
this.tileentity = entity;
this.allowUserInput = false;
this.xSize = 194;
this.ySize = 168;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String formatPanelName = I18n.format(this.tileentity.getInventoryName());
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
this.fontRendererObj.drawStringWithShadow(formatPanelName, nmPos, 7, 6618118);
String storageString = I18n.format("emt.Storage");
String fuel = I18n.format("emt.Fuel");
if (this.tileentity.maxstorage < 1000)
this.fontRendererObj.drawString(
storageString + this.tileentity.mpshownstroage * 1000 + "/" + this.tileentity.maxstorage + "EU",
36,
22,
0);
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mpshownstroage) + "/" + (this.tileentity.maxstorage / 1000)
+ "kEU",
36,
22,
0);
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mpshownstroage / 1000) + "/"
+ (this.tileentity.maxstorage / 1000000) + "MEU",
36,
22,
0);
else if (1000000000 <= this.tileentity.maxstorage)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mpshownstroage / 1000000) + "/"
+ (this.tileentity.maxstorage / 1000000000) + "GEU",
36,
22,
0);
if (this.tileentity.isActive)
this.fontRendererObj.drawString(
I18n.format("emt.Generating") + Double.toString(this.tileentity.generating / 20 / 20) + " EU/t",
36,
35,
0);
else this.fontRendererObj.drawString(I18n.format("emt.Generating") + "0 EU/t", 36, 35, 0);
this.fontRendererObj.drawString(fuel + ": " + Integer.toString(this.tileentity.fuel), 36, 48, 0);
this.fontRendererObj.drawString(
fuel + "/t: " + Integer.toString((this.tileentity.fuel * 20 * 20) - this.tileentity.tick), 36, 63, 0);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int h = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
if (this.tileentity.mpshownstroage > 0) {
int l = this.tileentity.gaugeEnergyScaled(33);
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
}
if (this.tileentity.fuel > 0) {
int l = this.tileentity.gaugeFuelScaled(33);
drawTexturedModalRect(h + 18, k + 42, 195, 0, l, 14);
}
}
}
@@ -1,35 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerIndustrialWandRecharge;
import emt.tile.TileEntityIndustrialWandRecharge;
import emt.util.EMTTextHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiIndustrialWandRecharger extends GuiContainer {
public static final ResourceLocation texture =
new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/wandcharger.png");
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
super(new ContainerIndustrialWandRecharge(inventory, te));
xSize = 176;
ySize = 165;
}
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
-132
View File
@@ -1,132 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerSolars;
import emt.tile.solar.TileEntitySolarBase;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiSolar extends GuiContainer {
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/solar.png");
TileEntitySolarBase tileentity;
private boolean allowUserInput;
private int xSize;
private int ySize;
private String color;
private int cColor;
public GuiSolar(InventoryPlayer invPlayer, TileEntitySolarBase entity) {
super(new ContainerSolars(invPlayer, entity));
this.tileentity = entity;
this.allowUserInput = false;
this.xSize = 194;
this.ySize = 168;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
color = this.tileentity
.getInventoryName()
.replaceAll("Solar", "")
.replaceAll("Compressed", "")
.replaceAll("Triple", "")
.replaceAll("Double", "")
.trim();
if (color != null)
switch (color) {
case "Aer": {
GL11.glColor4f(1.0f, 0.86f, 0.0f, 1.0f);
break;
}
case "Terra": {
GL11.glColor4f(0.0f, 0.66f, 0.08f, 1.0f);
cColor = 8224255;
break;
}
case "Ordo": {
GL11.glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
break;
}
case "Perditio": {
GL11.glColor4f(0.33F, 0.33F, 0.33F, 1.0F);
break;
}
case "Ignis": {
GL11.glColor4f(0.82f, 0.11f, 0.11f, 1.0f);
break;
}
case "Aqua": {
GL11.glColor4f(0.27f, 0.65f, 1.0f, 1.0f);
break;
}
default: {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
break;
}
}
else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int h = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
if (this.tileentity.mp_storage > 0) {
int l = this.tileentity.gaugeEnergyScaled(33);
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
}
if (this.tileentity.generating > 9) drawTexturedModalRect(h + 18, k + 42, 195, 20, 11, 14);
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String formatPanelName = I18n.format(this.tileentity.getInventoryName(), new Object[0]);
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
if (!color.equals("Terra")) this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, 6618118);
else this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, cColor);
String storageString = I18n.format("emt.Storage", new Object[0]);
if (this.tileentity.maxstorage < 1000)
this.fontRendererObj.drawString(
storageString + this.tileentity.storage + "/" + this.tileentity.maxstorage + "EU", 36, 22, 0);
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mp_storage) + "/" + (this.tileentity.maxstorage / 1000) + "kEU",
36,
22,
0);
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mp_storage / 1000) + "/" + (this.tileentity.maxstorage / 1000000)
+ "MEU",
36,
22,
0);
else if (1000000000 <= this.tileentity.maxstorage)
this.fontRendererObj.drawString(
storageString + (this.tileentity.mp_storage / 1000000) + "/"
+ (this.tileentity.maxstorage / 1000000000) + "GEU",
36,
22,
0);
if (this.tileentity.isActive)
// if (Double.toString(this.tileentity.generating).length()>5)
// this.fontRendererObj.drawString(I18n.format("emt.Generating",new
// Object[0])+Double.toString(this.tileentity.generating).substring(0, 4)+" EU/t", 36, 35, 0);
// else
this.fontRendererObj.drawString(
I18n.format("emt.Generating", new Object[0]) + Double.toString(this.tileentity.generating)
+ " EU/t",
36,
35,
0);
else this.fontRendererObj.drawString(I18n.format("emt.Generating", new Object[0]) + "0 EU/t", 36, 35, 0);
}
}
@@ -2,17 +2,19 @@ package emt.client.gui.config;
import static emt.util.EMTConfigHandler.*;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import emt.EMT;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import emt.EMT;
public class EMTGuiConfig extends GuiConfig {
public EMTGuiConfig(GuiScreen parentScreen) {
@@ -1,10 +1,12 @@
package emt.client.gui.config;
import cpw.mods.fml.client.IModGuiFactory;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory;
public class EMTGuiFactory implements IModGuiFactory {
@Override
@@ -1,91 +0,0 @@
package emt.client.gui.container;
import emt.tile.generator.TileEntityBaseGenerator;
import java.util.Locale;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
public class ConainerGenerator extends Container {
private TileEntityBaseGenerator tileentity;
public ConainerGenerator(InventoryPlayer inventoryplayer, TileEntityBaseGenerator tileentity) {
this.tileentity = tileentity;
}
public void detectAndSendChanges() {
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
icrafting.sendProgressBarUpdate(this, 0, (short) (this.tileentity.generating / 400));
icrafting.sendProgressBarUpdate(this, 1, (byte) this.tileentity.fuel);
icrafting.sendProgressBarUpdate(this, 2, (short) (this.tileentity.storage / 1000));
icrafting.sendProgressBarUpdate(this, 3, (byte) encryptAspect(this.tileentity.aspect));
icrafting.sendProgressBarUpdate(this, 4, (byte) (this.tileentity.isActive ? 1 : 0));
}
}
private byte encryptAspect(Aspect aspect) {
switch (aspect.getTag().toUpperCase(Locale.US)) {
case "POTENTIA":
return 0;
case "IGNIS":
return 1;
case "AURAM":
return 2;
case "ARBOR":
return 3;
case "AER":
return 4;
case "LUCRUM":
return 5;
}
return 0;
}
public void updateProgressBar(int i, int j) {
if (i == 0) {
this.tileentity.generating = (((int) j) * 400);
} else if (i == 1) {
if (j == 0 || this.tileentity.fuel != j) this.tileentity.tick = 0;
this.tileentity.fuel = ((byte) j);
} else if (i == 2) {
this.tileentity.mpshownstroage = (short) j;
} else if (i == 3 && this.tileentity.aspect == null)
switch (j) {
case 0:
this.tileentity.aspect = Aspect.ENERGY;
break;
case 1:
this.tileentity.aspect = Aspect.FIRE;
break;
case 2:
this.tileentity.aspect = Aspect.AURA;
break;
case 3:
this.tileentity.aspect = Aspect.TREE;
break;
case 4:
this.tileentity.aspect = Aspect.AIR;
break;
case 5:
this.tileentity.aspect = Aspect.GREED;
break;
}
else if (i == 4) {
this.tileentity.isActive = ((byte) j) == ((byte) 1);
}
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
return null;
}
public boolean canInteractWith(EntityPlayer entityplayer) {
this.detectAndSendChanges();
return this.tileentity.isUseableByPlayer(entityplayer);
}
}
@@ -1,83 +0,0 @@
package emt.client.gui.container;
import emt.tile.TileEntityEtherealMacerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.common.container.SlotOutput;
public class ContainerEtheralMacerator extends Container {
TileEntityEtherealMacerator te;
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
this.te = ((TileEntityEtherealMacerator) te);
addSlotToContainer(new Slot(this.te, 0, 56, 26));
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return this.te.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 1) {
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
} else if (par2 != 0) {
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
return null;
}
} else if (par2 >= 2 && par2 < 29) {
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
return null;
}
} else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
return null;
}
} else if (!this.mergeItemStack(itemstack1, 3, 38, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -1,69 +0,0 @@
package emt.client.gui.container;
import emt.tile.TileEntityIndustrialWandRecharge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerIndustrialWandRecharge extends Container {
TileEntityIndustrialWandRecharge charger;
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
this.charger = entity;
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
}
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
}
}
this.addSlotToContainer(new Slot(charger, 0, 80, 35));
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return charger.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 36) {
if (!this.mergeItemStack(itemstack1, 0, 35, false)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
} else if (!charger.isItemValidForSlot(0, itemstack1) || !this.mergeItemStack(itemstack1, 36, 37, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -1,59 +0,0 @@
package emt.client.gui.container;
import emt.tile.solar.TileEntitySolarBase;
import java.nio.ByteBuffer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack;
public class ContainerSolars extends Container {
byte[] generating = new byte[8];
byte[] mpStorage = new byte[8];
private TileEntitySolarBase tileentity;
public ContainerSolars(InventoryPlayer inventoryplayer, TileEntitySolarBase tileentity) {
this.tileentity = tileentity;
}
public void detectAndSendChanges() {
byte[] generating =
ByteBuffer.allocate(8).putDouble(this.tileentity.generating).array();
byte[] mpStorage = ByteBuffer.allocate(8)
.putDouble(this.tileentity.getSourceStored() / 1000)
.array();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
for (int j = 0; j < generating.length; j++) {
icrafting.sendProgressBarUpdate(this, j, generating[j]);
}
for (int j = 0; j < mpStorage.length; j++) {
icrafting.sendProgressBarUpdate(this, 8 + j, mpStorage[j]);
}
}
}
public void updateProgressBar(int i, int j) {
if (i < 8) {
generating[i] = (byte) j;
if (i == 7) this.tileentity.generating = ByteBuffer.wrap(generating).getDouble();
}
if (i > 7 && i < 16) {
mpStorage[i - 8] = (byte) j;
if (i == 15)
this.tileentity.mp_storage = (long) ByteBuffer.wrap(mpStorage).getDouble();
}
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
return null;
}
public boolean canInteractWith(EntityPlayer entityplayer) {
this.detectAndSendChanges();
return this.tileentity.isUseableByPlayer(entityplayer);
}
}
@@ -1,15 +1,19 @@
package emt.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSpecialArmor extends ModelBiped {
private static ModelSpecialArmor instance;
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer center;
@@ -28,41 +32,43 @@ public class ModelSpecialArmor extends ModelBiped {
public ModelSpecialArmor(float scale, float offset, int type) {
super(scale, offset, type == 1 ? 128 : 64, type == 0 ? 32 : type == 1 ? 96 : 64);
this.type = type;
switch (this.type) {
case 1:
this.textureWidth = 128;
this.textureHeight = 96;
this.jetpack = new ModelRenderer(this, 16, 69);
this.jetpack.setTextureSize(64, 48);
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
break;
case 2:
this.textureWidth = 64;
this.textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0 + 32);
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
this.textureWidth = 128;
this.textureHeight = 96;
this.jetpack = new ModelRenderer(this, 16, 69);
this.jetpack.setTextureSize(64, 48);
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
leftWing = new ModelRenderer(this, 0, 0 + 32);
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
this.textureWidth = 64;
this.textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0 + 32);
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
center = new ModelRenderer(this, 0, 14 + 32);
center.addBox(0F, 0F, 1F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
break;
}
leftWing = new ModelRenderer(this, 0, 0 + 32);
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
center = new ModelRenderer(this, 0, 14 + 32);
center.addBox(0F, 0F, 1F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
}
public static ModelSpecialArmor getInstance() {
if (instance == null) instance = new ModelSpecialArmor();
return instance;
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
@@ -71,14 +77,8 @@ public class ModelSpecialArmor extends ModelBiped {
model.rotateAngleZ = z;
}
public void render(
Entity entity,
float p_78088_2_,
float p_78088_3_,
float p_78088_4_,
float p_78088_5_,
float p_78088_6_,
float scale) {
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
float p_78088_6_, float scale) {
EntityPlayer player = (EntityPlayer) entity;
this.heldItemRight = player.inventory.getCurrentItem() != null ? 1 : 0;
this.isRiding = player.isRiding();
@@ -100,21 +100,19 @@ public class ModelSpecialArmor extends ModelBiped {
this.center.render(scale);
this.leftWing.render(scale);
this.rightWing.render(scale);
break;
}
}
public void setRotationAngles(
float p_78087_1_,
float p_78087_2_,
float p_78087_3_,
float p_78087_4_,
float p_78087_5_,
float p_78087_6_,
Entity entity) {
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
float p_78087_5_, float p_78087_6_, Entity entity) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if (this.isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
} else {
this.rightWing.rotateAngleY = 0.1570796F;
this.leftWing.rotateAngleY = -0.1570796F;
}
if (this.isSneak) {
@@ -123,14 +121,22 @@ public class ModelSpecialArmor extends ModelBiped {
this.jetpack.rotateAngleX = 0.5F;
break;
case 2:
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
break;
}
} else {
switch (this.type) {
case 1:
this.jetpack.rotateAngleX = 0F;
break;
case 2:
this.center.rotateAngleX = 0F;
this.rightWing.rotateAngleX = 0F;
this.leftWing.rotateAngleX = 0F;
break;
}
}
}
}
+21 -4
View File
@@ -4,8 +4,14 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ModelWings extends ModelBiped {
@SideOnly(Side.CLIENT)
private static ModelWings instance = null;
public boolean isJumping = false;
ModelRenderer rightWing;
ModelRenderer leftWing;
@@ -41,6 +47,12 @@ public class ModelWings extends ModelBiped {
this.bipedBody.addChild(center);
}
public static ModelWings getInstance() {
if (instance == null) instance = new ModelWings();
return instance;
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
@@ -55,20 +67,25 @@ public class ModelWings extends ModelBiped {
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity) {
public void setRotationAngles(float limbSwing, float limbSwingAmount, float playerTicksExisted,
float playerRotationYawHead, float playerRotationPitch, float f5, Entity entity) {
if (isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
} else {
this.rightWing.rotateAngleY = 0.1570796F;
this.leftWing.rotateAngleY = -0.1570796F;
}
if (entity.isSneaking()) {
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
} else {
this.center.rotateAngleX = 0.0F;
this.rightWing.rotateAngleX = 0;
this.leftWing.rotateAngleX = 0;
}
}
}
@@ -1,18 +1,21 @@
package emt.client.renderer;
import emt.EMT;
import emt.entity.EntityLaser;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import emt.EMT;
import emt.entity.EntityLaser;
public class RenderLaser extends Render {
private static final ResourceLocation laserTexture =
new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/lasermodel.png");
private static final ResourceLocation laserTexture = new ResourceLocation(
EMT.TEXTURE_PATH,
"textures/models/lasermodel.png");
@Override
public void doRender(Entity entityLaser, double x, double y, double z, float par8, float pTick) {
@@ -2,8 +2,6 @@ package emt.client.renderer;
import static org.lwjgl.opengl.GL11.*;
import emt.EMT;
import emt.entity.EntityShield;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
@@ -11,12 +9,18 @@ import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import emt.EMT;
import emt.entity.EntityShield;
public class RenderShield extends Render {
private static final ResourceLocation shieldTexture =
new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/shield.png");
private static final ResourceLocation shieldTexture = new ResourceLocation(
EMT.TEXTURE_PATH,
"textures/models/shield.png");
static int glCallList;
static {
@@ -80,15 +84,12 @@ public class RenderShield extends Render {
glDisable(GL_CULL_FACE);
glPushMatrix();
if (((EntityShield) entityShield).owner != null
&& !Minecraft.getMinecraft()
.thePlayer
.getDisplayName()
.equals(((EntityShield) entityShield).owner.getDisplayName())) {
if (((EntityShield) entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName()
.equals(((EntityShield) entityShield).owner.getDisplayName())) {
glTranslated(x, y, z);
}
glCallList(this.glCallList);
glCallList(glCallList);
glPopMatrix();
glPopAttrib();
+19 -17
View File
@@ -1,9 +1,8 @@
package emt.command;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
@@ -12,6 +11,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import thaumcraft.api.aspects.Aspect;
public class CommandOutputs extends CommandBase {
@@ -32,24 +34,28 @@ public class CommandOutputs extends CommandBase {
for (final Aspect aspect : Aspect.aspects.values()) {
++counter;
if (aspect.equals(Aspect.ENERGY)
|| aspect.equals(Aspect.TREE)
if (aspect.equals(Aspect.ENERGY) || aspect.equals(Aspect.TREE)
|| aspect.equals(Aspect.FIRE)
|| aspect.equals(Aspect.AURA)
|| aspect.equals(Aspect.GREED)
|| aspect.equals(Aspect.AIR))
text3 += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D / 20D) + "EU\n";
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D / 20D)
+ "EU\n";
if (counter < 12) {
text2 += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
text2 += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
+ "EU/t\n";
text += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
text += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
+ "EU\n";
} else {
text2 += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
text2 += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
+ "EU\n";
text += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
text += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
+ "EU\n";
bookL.add(text);
bookL2.add(text2);
@@ -91,7 +97,7 @@ public class CommandOutputs extends CommandBase {
}
@Override
public String getCommandUsage(ICommandSender p_71518_1_) {
public String getCommandUsage(ICommandSender sender) {
return "/emt_outputs";
}
@@ -101,7 +107,7 @@ public class CommandOutputs extends CommandBase {
}
@Override
public List addTabCompletionOptions(ICommandSender command, String[] stringArray) {
public List<String> addTabCompletionOptions(ICommandSender command, String[] stringArray) {
return null;
}
@@ -118,12 +124,8 @@ public class CommandOutputs extends CommandBase {
public void processCommand(ICommandSender command, String[] astring) {
ItemStack book = mkbook();
if (!command.getEntityWorld()
.getPlayerEntityByName(command.getCommandSenderName())
.inventory
if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory
.addItemStackToInventory(book))
command.getEntityWorld()
.getPlayerEntityByName(command.getCommandSenderName())
.entityDropItem(book, 0);
command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0);
}
}
+11 -6
View File
@@ -30,7 +30,8 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(
3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
3,
new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
@@ -84,13 +85,17 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
@Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float)
(14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
EntityArrow entityarrow = new EntityArrow(
this.worldObj,
this,
entity,
1.6F,
(float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F)
+ this.rand.nextGaussian() * 0.25D
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
entityarrow.setDamage(
(double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
+17 -15
View File
@@ -1,10 +1,7 @@
package emt.entity;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
@@ -16,9 +13,15 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import thaumcraft.common.Thaumcraft;
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
public static final int RADIUS = 8;
public static final int MAX_TICKS_IN_TILE = 60;
@@ -96,14 +99,14 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
}
/** Generating Coords for every Entity **/
ArrayList<Entity> entities = new ArrayList();
ArrayList<Entity> entities = new ArrayList<>();
int chunkSize = ((RADIUS - 1) >> 4) + 2;
for (int chX = -chunkSize; chX < chunkSize; chX++) {
for (int chZ = -chunkSize; chZ < chunkSize; chZ++) {
Chunk chunk = worldObj.getChunkFromChunkCoords(
chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
Chunk chunk = worldObj
.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
if (chunk.isChunkLoaded && chunk.hasEntities) {
for (int i = 0; i < chunk.entityLists.length; i++) {
@@ -112,8 +115,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
double width = entity.posX - this.posX;
double height = entity.posY - this.posY;
double length = entity.posZ - this.posZ;
double hyp =
MathHelper.sqrt_double((width * width) + (length * length) + (height * height));
double hyp = MathHelper
.sqrt_double((width * width) + (length * length) + (height * height));
if (hyp <= RADIUS) {
entities.add(entity);
@@ -135,8 +138,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
else {
/** Collision detection **/
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next);
this.ticksInAir++;
@@ -151,9 +154,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI) - 90.0F;
this.rotationPitch - this.prevRotationPitch < -180.0F;
this.prevRotationPitch -= 360.0F) {
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI)
- 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
@@ -217,7 +219,7 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0));
nbt.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
nbt.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
}
@Override
+36 -28
View File
@@ -1,9 +1,7 @@
package emt.entity;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -17,7 +15,12 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityLaser extends Entity implements IThrowableEntity, IProjectile {
public Entity shootingEntity;
private Block inTile;
private int xTile;
@@ -99,8 +102,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (block.getMaterial() != Material.air) {
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb =
block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
@@ -109,8 +112,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
}
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb =
block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
@@ -121,7 +124,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(
this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead();
}
@@ -142,12 +150,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
} else {
++this.ticksInAir;
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false);
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3next = Vec3.createVectorHelper(
this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {
vec3next = Vec3.createVectorHelper(
@@ -157,22 +165,20 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
this,
this.boundingBox
.addCoord(this.motionX, this.motionY, this.motionZ)
.expand(1.0D, 1.0D, 1.0D));
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float down;
for (l = 0; l < list.size(); ++l) {
Entity entity1 = (Entity) list.get(l);
Entity entity1 = list.get(l);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
down = 0.3F;
AxisAlignedBB axisalignedbb1 =
entity1.boundingBox.expand((double) down, (double) down, (double) down);
AxisAlignedBB axisalignedbb1 = entity1.boundingBox
.expand((double) down, (double) down, (double) down);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3);
if (movingobjectposition1 != null) {
@@ -190,14 +196,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null
&& movingobjectposition.entityHit != null
if (movingobjectposition != null && movingobjectposition.entityHit != null
&& movingobjectposition.entityHit instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage
|| this.shootingEntity instanceof EntityPlayer
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
movingobjectposition = null;
}
}
@@ -211,7 +215,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(
this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead();
}
} else {
@@ -238,9 +247,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI);
this.rotationPitch - this.prevRotationPitch < -180.0F;
this.prevRotationPitch -= 360.0F)
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D
/ Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
;
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+4 -2
View File
@@ -1,14 +1,16 @@
package emt.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityShield extends Entity {
public EntityPlayer owner;
public boolean needCheck = true;
@@ -1,62 +0,0 @@
package emt.gthandler.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.gthandler.common.items.EMT_CasingBlock;
import gregtech.api.enums.Textures;
import gregtech.api.render.TextureFactory;
import gregtech.common.blocks.GT_Block_Casings_Abstract;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class EMT_GT_Block extends GT_Block_Casings_Abstract {
@SideOnly(Side.CLIENT)
private IIcon[] texture;
private final String[] textureNames;
public EMT_GT_Block(String[] texture) {
super(EMT_CasingBlock.class, "EMT_GTBLOCK_CASEING", Material.anvil);
this.setHardness(15.0F);
this.setResistance(30.0F);
this.textureNames = texture;
this.setCreativeTab(EMT.TAB);
// Taking one texture slot :P
Textures.BlockIcons.setCasingTexture((byte) 1, (byte) (15 + 48), TextureFactory.of(this, 7));
}
@Override
public int damageDropped(final int meta) {
return meta;
}
@Override
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
for (int i = 0; i < textureNames.length; i++) {
list.add(new ItemStack(item, 1, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return meta < texture.length ? texture[meta] : texture[1];
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
texture = new IIcon[textureNames.length];
for (int i = 0; i < textureNames.length; i++) {
texture[i] = par1IconRegister.registerIcon(textureNames[i]);
}
}
}
@@ -1,164 +0,0 @@
package emt.gthandler.common.implementations;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import java.util.ArrayList;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.fluids.FluidStack;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
private static int ApTe = (int) Math.ceil(Aspect.aspects.size() / GT_Values.V.length);
private AspectList current = new AspectList();
public EssentiaHatch(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
}
public EssentiaHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
public EssentiaHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
public boolean addAspectList(final AspectList A) {
if ((this.mTier + 1) * ApTe > A.size() + current.size()) {
if (current.visSize() + A.visSize() < (this.mTier + 1) * ApTe * 64) current.add(A);
return true;
} else return false;
}
public void setCurrent(AspectList List) {
this.current = List;
}
public AspectList getAspects() {
return current;
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new EssentiaHatch(
"Essentia Hatch " + GT_Values.VN[this.mTier], this.mTier, this.getDescription(), this.mTextures);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
// TODO: new GUI.
return null;
}
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
// TODO: new contanier GUI.
return null;
}
@Override
public String[] getInfoData() {
ArrayList<String> list = new ArrayList<String>();
list.add("This Essentia-Hatch contains:");
for (final Aspect A : this.current.aspects.keySet())
list.add(A.getName() + ": " + Integer.toString(current.getAmount(A)));
String[] ret = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
ret[i] = list.get(i);
}
return ret;
/*String[] old = super.getInfoData();
if (old.length!=0) {
String[] newDescription = new String[old.length + 1];
for (int i = 0; i < old.length; i++) {
newDescription[i] = old[i];
}
newDescription[old.length] = "This Contains: " + current.size() + " different Aspects";
return newDescription;
}else
return new String[]{"This Contains: " + current.size() + " different Aspects"};*/
}
@Override
public String[] getDescription() { // this is the fucking tooltip -_-'
return new String[] {
"Essentia Hatch for usage in Multiblocks",
"Can only be filled with the Essentia Filler",
"Can hold " + Integer.toString((ApTe * (mTier + 1))) + " Different Essentia Types",
"Can hold " + Integer.toString((64 * ApTe * (mTier + 1))) + " Essentia in total"
};
}
@Override
public boolean isGivingInformation() {
return true;
}
@Override
public void saveNBTData(NBTTagCompound var1) {
NBTTagList tlist = new NBTTagList();
Aspect[] aspectA = current.getAspects();
for (int i = 0; i < aspectA.length; ++i) {
Aspect aspect = aspectA[i];
if (aspect != null) {
NBTTagCompound f = new NBTTagCompound();
f.setString("key", aspect.getTag());
f.setInteger("amount", current.getAmount(aspect));
tlist.appendTag(f);
}
}
var1.setTag("Aspects", tlist);
super.saveNBTData(var1);
}
@Override
public void loadNBTData(NBTTagCompound var1) {
current = new AspectList();
NBTTagList tlist = var1.getTagList("Aspects", 10);
for (int j = 0; j < tlist.tagCount(); ++j) {
NBTTagCompound rs = tlist.getCompoundTagAt(j);
if (rs.hasKey("key")) {
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
}
}
super.loadNBTData(var1);
}
public int fuelleft() {
int ret = 0;
for (final Aspect A : current.aspects.keySet()) {
ret += current.getAmount(A);
}
return ret;
}
public boolean isFluidInputAllowed(FluidStack aFluid) {
return false;
}
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
public int getCapacity() {
return 0;
}
}
@@ -1,242 +0,0 @@
package emt.gthandler.common.implementations.automation;
import emt.gthandler.common.implementations.EssentiaHatch;
import emt.tile.TileEntityEMT;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import java.util.ArrayList;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.aspects.IEssentiaTransport;
public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport {
private AspectList current = new AspectList();
private byte tick = 0;
@Override
public void writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
NBTTagList tlist = new NBTTagList();
Aspect[] aspectA = current.getAspects();
for (int i = 0; i < aspectA.length; ++i) {
Aspect aspect = aspectA[i];
if (aspect != null) {
NBTTagCompound f = new NBTTagCompound();
f.setString("key", aspect.getTag());
f.setInteger("amount", current.getAmount(aspect));
tlist.appendTag(f);
}
}
tagCompound.setTag("Aspects", tlist);
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
current = new AspectList();
NBTTagList tlist = tagCompound.getTagList("Aspects", 10);
for (int j = 0; j < tlist.tagCount(); ++j) {
NBTTagCompound rs = tlist.getCompoundTagAt(j);
if (rs.hasKey("key")) {
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
}
}
}
@Override
public void updateEntity() {
++tick;
fillfrompipe();
if (tick % 20 == 0) {
TileEntity T = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
if (checkTE(T)) {
tick = 0;
return;
}
if (T == null) T = this.worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
if (checkTE(T)) {
tick = 0;
return;
}
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
if (checkTE(T)) {
tick = 0;
return;
}
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if (checkTE(T)) {
tick = 0;
return;
}
if (T == null) T = this.worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
if (checkTE(T)) {
tick = 0;
return;
}
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
if (checkTE(T)) {
tick = 0;
return;
}
}
}
private boolean checkTE(final TileEntity T) {
if (T == null) return false;
if (this.current.visSize() > 0)
if (T instanceof IGregTechTileEntity) {
IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity();
if (M instanceof EssentiaHatch) {
if (((EssentiaHatch) M).addAspectList(current)) this.current = new AspectList();
return true;
}
}
return false;
}
public void fillfrompipe() {
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
te[i] = ThaumcraftApiHelper.getConnectableTile(
this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]);
if (te[i] != null) {
IEssentiaTransport pipe = (IEssentiaTransport) te[i];
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
return;
}
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null)
&& (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i])
< getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
addToContainer(
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
pipe.takeEssentia(
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
1,
ForgeDirection.VALID_DIRECTIONS[i]));
}
}
}
}
@Override
public AspectList getAspects() {
return current;
}
@Override
public void setAspects(AspectList aspectList) {
this.current.add(aspectList);
}
@Override
public boolean doesContainerAccept(Aspect aspect) {
return true;
}
@Override
public int addToContainer(Aspect aspect, int i) {
current.add(aspect, i);
return 0;
}
@Override
public boolean takeFromContainer(Aspect aspect, int i) {
return false;
}
@Override
public boolean takeFromContainer(AspectList aspectList) {
return false;
}
@Override
public boolean doesContainerContainAmount(Aspect aspect, int i) {
return current.aspects.containsKey(aspect) && i <= current.getAmount(aspect);
}
@Override
public boolean doesContainerContain(AspectList aspectList) {
ArrayList<Boolean> ret = new ArrayList<Boolean>();
for (Aspect a : aspectList.aspects.keySet())
if (current.aspects.containsKey(a)) {
ret.add(true);
} else ret.add(false);
return !ret.contains(false);
}
@Override
public int containerContains(Aspect aspect) {
return current.aspects.containsKey(aspect) ? current.getAmount(aspect) : 0;
}
@Override
public boolean isConnectable(ForgeDirection forgeDirection) {
return true;
}
@Override
public boolean canInputFrom(ForgeDirection forgeDirection) {
return true;
}
@Override
public boolean canOutputTo(ForgeDirection forgeDirection) {
return false;
}
@Override
public void setSuction(Aspect aspect, int i) {}
@Override
public Aspect getSuctionType(ForgeDirection forgeDirection) {
return null;
}
@Override
public int getSuctionAmount(ForgeDirection forgeDirection) {
return 256;
}
@Override
public int takeEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
return 0;
}
@Override
public int addEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
current.add(aspect, i);
return 0;
}
@Override
public Aspect getEssentiaType(ForgeDirection forgeDirection) {
return current.getAspects()[0];
}
@Override
public int getEssentiaAmount(ForgeDirection forgeDirection) {
int ret = 0;
for (final Aspect A : current.aspects.keySet()) {
ret += current.getAmount(A);
}
return ret;
}
@Override
public int getMinimumSuction() {
return Integer.MAX_VALUE;
}
@Override
public boolean renderExtendedTube() {
return true;
}
}
@@ -1,107 +0,0 @@
package emt.gthandler.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.gthandler.common.blocks.EMT_GT_Block;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Item_Casings_Abstract;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class EMT_CasingBlock extends GT_Item_Casings_Abstract {
public static final Block[] EMT_GT_BLOCKS = {
new EMT_GT_Block(new String[] {
EMT.TEXTURE_PATH + ":machines/side",
EMT.TEXTURE_PATH + ":machines/GT/inner",
EMT.TEXTURE_PATH + ":machines/GT/siderawI",
EMT.TEXTURE_PATH + ":machines/GT/rawcoreI",
EMT.TEXTURE_PATH + ":machines/GT/siderawII",
EMT.TEXTURE_PATH + ":machines/GT/rawcoreII",
EMT.TEXTURE_PATH + ":machines/GT/rawcoreII", // unused?
EMT.TEXTURE_PATH + ":machines/GT/ROBUST_NAQUADAH_ALLOY",
EMT.TEXTURE_PATH + ":machines/GT/BLOODY_ICHORIUM",
EMT.TEXTURE_PATH + ":machines/GT/DRACONIUM",
EMT.TEXTURE_PATH + ":machines/GT/WYVERN",
EMT.TEXTURE_PATH + ":machines/GT/AWAKENED_DRACONIUM",
EMT.TEXTURE_PATH + ":machines/GT/CHAOTIC",
})
};
protected final String deccCasing01Tooltip = GT_LanguageManager.addStringLocalization(
"gt.casing01tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 1");
protected final String deccCasing02Tooltip = GT_LanguageManager.addStringLocalization(
"gt.casing02tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 2");
protected final String deccCasing03Tooltip = GT_LanguageManager.addStringLocalization(
"gt.casing03tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 3");
protected final String deccCasing04Tooltip = GT_LanguageManager.addStringLocalization(
"gt.casing04tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 4");
protected final String deccCasing05Tooltip = GT_LanguageManager.addStringLocalization(
"gt.casing05tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 5");
public EMT_CasingBlock(final Block par1) {
super(par1);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setCreativeTab(EMT.TAB);
}
@Override
public int getMetadata(final int aMeta) {
return aMeta;
}
@Override
public String getUnlocalizedName(final ItemStack aStack) {
return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
}
@Override
@SideOnly(Side.CLIENT) // so it only gets sent clientside?
public void addInformation(
final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
switch (getDamage(aStack)) {
case 8:
aList.add(this.deccCasing01Tooltip);
break;
case 9:
aList.add(this.deccCasing02Tooltip);
break;
case 10:
aList.add(this.deccCasing03Tooltip);
break;
case 11:
aList.add(this.deccCasing04Tooltip);
break;
case 12:
aList.add(this.deccCasing05Tooltip);
break;
default:
break;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass) {
return this.field_150939_a.getIcon(0, stack.getItemDamage());
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
return getIcon(stack, renderPass);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) {
return this.field_150939_a.getIcon(0, p_77618_2_);
}
}
@@ -1,219 +1,28 @@
package emt.gthandler.common.loader;
import static emt.command.CommandOutputs.mkbook;
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import cpw.mods.fml.common.Loader;
import emt.gthandler.common.implementations.EssentiaHatch;
import emt.gthandler.common.items.EMT_CasingBlock;
import emt.gthandler.common.tileentities.machines.multi.DE_Fusion_Crafter;
import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen;
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.ConfigBlocks;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TierEU;
import gregtech.api.util.GTOreDictUnificator;
import thaumcraft.common.config.ConfigItems;
public class EMT_GT_Loader implements Runnable {
public class EMT_GT_Loader {
public static final int TIERS = GT_Values.VN.length;
public static int aIDoffset = 13000 - TIERS - 1;
public static ItemStack[] EHatch = new ItemStack[TIERS];
public static ItemStack LEG;
public static ItemStack DECC;
public static ItemStack ResearchMultiblock;
@Override
public void run() {
for (int i = 0; i < TIERS; i++) {
EHatch[i] = new EssentiaHatch(
aIDoffset + i, "Essentia Hatch " + GT_Values.VN[i], "Essentia Hatch " + GT_Values.VN[i], i)
.getStackForm(1L);
}
LEG = new EMT_Large_Essentia_Gen(aIDoffset + TIERS + 1, "Large Essentia Generator", "Large Essentia Generator")
.getStackForm(1L);
// Dragonblood recipe for magics haters
if (Loader.isModLoaded("miscutils")) {
GT_Values.RA.addMixerRecipe(
new ItemStack[] {
new ItemStack(Blocks.dragon_egg, 1),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64L),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64L)
},
new FluidStack[] {Materials.Radon.getPlasma(144)},
new ItemStack[] {GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 8L)},
new FluidStack[] {new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 288)},
14000,
1966080);
}
// Casing blocks
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1L),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmiridium, 4L)
},
Materials.SolderingAlloy.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Indium, 1L),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Tungsten, 4L)
},
Materials.SolderingAlloy.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
if (Loader.isModLoaded("ThaumicTinkerer"))
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2),
GT_ModHandler.getModItem("ThaumicTinkerer", "kamiResource", 2L, 2)
},
Materials.Concrete.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
else
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2), Materials.ElectrumFlux.getPlates(8)
},
Materials.Concrete.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 8L)
},
Materials.Osmiridium.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 5),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.NaquadahAlloy, 6L),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.NaquadahAlloy, 6L)
},
Materials.Void.getMolten(1152L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 7),
24000,
491520);
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
GT_ModHandler.getModItem("dreamcraft", "tile.BloodyIchorium", 1, 0),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6L)
},
Materials.Void.getMolten(1152L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 8),
24000,
491520);
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 8),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Draconium, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0)
},
Materials.Void.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 9),
24000,
491520); // uv
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 9),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.CosmicNeutronium, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 2, 0)
},
Materials.Void.getMolten(4608L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 10),
12000,
1996080); // uhv, you need uhv to get the thing anyway?
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 10),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.DraconiumAwakened, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 3, 0)
},
Materials.Void.getMolten(9216L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 11),
12000,
7864320); // uev
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 11),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "chaoticCore", 4, 0)
},
Materials.Void.getMolten(18432L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 12),
12000,
31457280); // uiv, use the multi
EMT_RecipeAdder.Run();
DECC = new DE_Fusion_Crafter(5001, "de_fusion_crafter", "Draconic Evolution Fusion Crafter").getStackForm(1L);
/* New DECF controller recipe moved to TT. only create the old one here if tectech or blood magic is not around.*/
if (!(Loader.isModLoaded("tectech") && Loader.isModLoaded("AWWayofTime"))) {
GT_Values.RA.addAssemblylineRecipe(
GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 10780),
144000,
new Object[] {
GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 10780),
ItemList.Robot_Arm_LuV.get(2L),
ItemList.Electric_Motor_LuV.get(2L),
ItemList.Field_Generator_LuV.get(1L),
new Object[] {OrePrefixes.circuit.get(Materials.Master), 2},
ItemList.Casing_Coil_Naquadah.get(8L),
},
new FluidStack[] {
Materials.SolderingAlloy.getMolten(2304L), Materials.Thaumium.getMolten(1440L),
},
DECC,
1500,
16384);
}
for (int i = 0; i < ItemList.HATCHES_INPUT.length; i++) {
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {ItemList.HATCHES_INPUT[i].get(1L), new ItemStack(ConfigBlocks.blockTube, 1, 4)},
Materials.Thaumium.getMolten(288L),
EHatch[i],
100,
(int) (GT_Values.V[i] - (GT_Values.V[i] / 10)));
}
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(
aIDoffset + TIERS + 2, "Research Completer", "Research Completer")
.getStackForm(1L);
}
public void runlate() {
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
new ItemStack(Items.book),
GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L),
new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE)
},
GT_Values.NF,
mkbook(),
128,
64);
public static void runlate() {
GTValues.RA.stdBuilder()
.itemInputs(
new ItemStack(Items.book),
GTOreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L),
new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE))
.itemOutputs(mkbook()).duration(6 * SECONDS).eut(TierEU.RECIPE_MV / 2).addTo(assemblerRecipes);
}
}
@@ -1,222 +0,0 @@
package emt.gthandler.common.loader;
import static gregtech.api.enums.GT_Values.E;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import cpw.mods.fml.common.Loader;
import emt.init.EMTItems;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import java.util.HashSet;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class EMT_RecipeAdder {
public static final GT_Recipe.GT_Recipe_Map sFusionCraftingRecipes = new GT_Recipe.GT_Recipe_Map(
new HashSet<>(4),
"emt.recipe.fusioncrafting",
"Draconic Evolution Fusion Crafter",
null,
RES_PATH_GUI + "basicmachines/FusionCrafter",
9,
1,
1,
0,
1,
"Tier Casing: ",
1,
E,
false,
false);
public static void addFusionCraftingRecipe(
ItemStack[] inputs,
FluidStack[] fluidinputs,
ItemStack[] outputs,
FluidStack[] fluidoutputs,
int aDuration,
int aEUt,
int aTier) {
sFusionCraftingRecipes.addRecipe(
true, inputs, outputs, null, fluidinputs, fluidoutputs, aDuration, aEUt, aTier);
}
public static void addFusionCraftingRecipeNonOptimized(
ItemStack[] inputs,
FluidStack[] fluidinputs,
ItemStack[] outputs,
FluidStack[] fluidoutputs,
int aDuration,
int aEUt,
int aTier) {
sFusionCraftingRecipes.addRecipe(
false, inputs, outputs, null, fluidinputs, fluidoutputs, aDuration, aEUt, aTier);
}
public static void addFusionCraftingRecipe(
ItemStack[] inputs, ItemStack output, int aDuration, int aEUt, int aTier) {
addFusionCraftingRecipe(inputs, null, new ItemStack[] {output}, null, aDuration, aEUt, aTier);
}
// Use this if you don't want your recipes quantity to be splitted
public static void addFusionCraftingRecipeNonOptimized(
ItemStack[] inputs,
FluidStack fluidinput,
ItemStack output,
FluidStack fluidoutput,
int aDuration,
int aEUt,
int aTier) {
addFusionCraftingRecipeNonOptimized(
inputs,
new FluidStack[] {fluidinput},
new ItemStack[] {output},
new FluidStack[] {fluidoutput},
aDuration,
aEUt,
aTier);
}
public static void Run() {
// CORES
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmiridium, 4),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Ichorium, 1),
ItemList.QuantumEye.get(1L),
new ItemStack(EMTItems.itemEMTItems, 0, 16)
},
Materials.Sunnarium.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0),
GT_Values.NF,
400,
500000,
1);
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 4, 0),
ItemList.QuantumStar.get(1L),
new ItemStack(EMTItems.itemEMTItems, 0, 17),
},
Materials.Neutronium.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 1, 0),
GT_Values.NF,
800,
2000000,
2);
if (Loader.isModLoaded("supersolarpanel")) {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 12),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 4, 0),
GT_ModHandler.getModItem("supersolarpanel", "enderquantumcomponent", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18)
},
Materials.Infinity.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 1, 0),
GT_Values.NF,
1600,
8000000,
3);
} else {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 12),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 4, 0),
GT_ModHandler.getModItem("dreamcraft", "item.ManyullynCrystal", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18)
},
Materials.Infinity.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 1, 0),
GT_Values.NF,
1600,
8000000,
3);
}
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 16),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 4, 0),
GT_ModHandler.getModItem("DraconicEvolution", "chaosFragment", 2, 2),
new ItemStack(EMTItems.itemEMTItems, 0, 19)
},
Materials.SpaceTime.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "chaoticCore", 1, 0),
GT_Values.NF,
3200,
24000000,
4);
// ENERGY CORES
addFusionCraftingRecipe(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StellarAlloy, 4),
GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 4, 1),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 17)
},
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 1, 0),
1000,
500000,
2);
addFusionCraftingRecipe(
new ItemStack[] {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 8),
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 4, 0),
GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 4, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18)
},
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 1, 1),
2000,
2000000,
3);
// Dragon Blood
if (Loader.isModLoaded("miscutils")) {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
new ItemStack(Blocks.dragon_egg, 0),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64)
},
Materials.Radon.getPlasma(144),
null,
new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 288),
4200,
1966080,
3);
addFusionCraftingRecipeNonOptimized(
new ItemStack[] {
GT_ModHandler.getModItem("witchery", "infinityegg", 0),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64)
},
Materials.Radon.getPlasma(72),
null,
new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 432),
3600,
1966080,
3);
}
}
}
@@ -1,265 +0,0 @@
package emt.gthandler.common.tileentities.machines.multi;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import emt.EMT;
import emt.gthandler.common.items.EMT_CasingBlock;
import emt.gthandler.common.loader.EMT_RecipeAdder;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import java.util.Arrays;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.tuple.Pair;
public class DE_Fusion_Crafter extends GT_MetaTileEntity_EnhancedMultiBlockBase<DE_Fusion_Crafter> {
private static final int CASING_INDEX = (1 << 7) + (15 + 48);
private int mTierCasing = 0;
private int mFusionTierCasing = 0;
private int mCasing = 0;
public DE_Fusion_Crafter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
public DE_Fusion_Crafter(String aName) {
super(aName);
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new DE_Fusion_Crafter(mName);
}
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final List<Pair<Block, Integer>> fusionCasingTiers =
Arrays.asList(Pair.of(GregTech_API.sBlockCasings4, 6), Pair.of(GregTech_API.sBlockCasings4, 8));
private static final List<Pair<Block, Integer>> coreTiers = Arrays.asList(
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 8),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 9),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 10),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 11),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 12));
private static final IStructureDefinition<DE_Fusion_Crafter> STRUCTURE_DEFINITION =
StructureDefinition.<DE_Fusion_Crafter>builder()
.addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] {
{"nnnnn", "nnnnn", "nnnnn", "nnnnn", "nnnnn"},
{" ", " F ", " FfF ", " F ", " "},
{" ", " F ", " FfF ", " F ", " "},
{"RRRRR", "R F R", "RFfFR", "R F R", "RRRRR"},
{" ", " F ", " FfF ", " F ", " "},
{" ", " F ", " FfF ", " F ", " "},
{"RRRRR", "R F R", "RFfFR", "R F R", "RRRRR"},
{" ", " F ", " FfF ", " F ", " "},
{" ", " F ", " FfF ", " F ", " "},
{"NN~NN", "NNNNN", "NNNNN", "NNNNN", "NNNNN"}
}))
.addElement(
'N',
ofChain(
onElementPass(e -> e.mCasing++, ofBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0], 7)),
ofHatchAdder(DE_Fusion_Crafter::addEnergyInputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addInputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addOutputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addMaintenanceToMachineList, CASING_INDEX, 1)))
.addElement('n', onElementPass(e -> e.mCasing++, ofBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0], 7)))
.addElement('f', ofBlock(GregTech_API.sBlockCasings4, 7))
.addElement(
'F',
ofBlocksTiered(
(Block b, int m) -> {
if (b != GregTech_API.sBlockCasings4 || (m != 6 && m != 8)) return -2;
return m == 6 ? 1 : 2;
},
fusionCasingTiers,
-1,
(e, i) -> e.mFusionTierCasing = i,
e -> e.mFusionTierCasing))
.addElement(
'R',
ofBlocksTiered(
(Block b, int m) -> {
if (b != EMT_CasingBlock.EMT_GT_BLOCKS[0] || m < 8 || m > 12) return -2;
return m - 7;
},
coreTiers,
-1,
(e, i) -> e.mTierCasing = i,
e -> e.mTierCasing))
.build();
@Override
public IStructureDefinition<DE_Fusion_Crafter> getStructureDefinition() {
return STRUCTURE_DEFINITION;
}
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasing = 0;
mTierCasing = -1;
mFusionTierCasing = -1;
if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 9, 0)) return false;
if (mCasing < 19) return false;
if (mTierCasing == -2 || mFusionTierCasing == -2) return false;
if (mTierCasing > 3 && mFusionTierCasing < 2) return false;
return mMaintenanceHatches.size() == 1;
}
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Fusion Crafter")
.addInfo("Controller Block for the Draconic Evolution Fusion Crafter")
.addInfo("Machine can be overclocked by using casings above the recipe tier:")
.addInfo("Recipe time is divided by number of tiers above the recipe")
.addInfo("Normal EU OC still applies !")
.addInfo("To see the structure, use a " + EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE
+ "Tech" + EnumChatFormatting.GRAY + " structure hologram on the Controller!")
.addSeparator()
.beginStructureBlock(5, 10, 5, false)
.addController("Front bottom center")
.addCasingInfo("Naquadah Alloy Fusion Casing", 19)
.addOtherStructurePart("Fusion Coil Block", "Center pillar")
.addOtherStructurePart("Fusion Machine Casing", "Touching Fusion Coil Block at every side")
.addOtherStructurePart("Tiered Fusion Casing", "Rings (5x5 hollow) at layer 4 and 7")
.addStructureInfo("Bloody Ichorium for tier 1, Draconium for tier 2, etc")
.addStructureInfo("To use tier 3 + you have to use fusion casing MK II")
.addInputBus("Any bottom casing", 1)
.addInputHatch("Any bottom casing", 1)
.addOutputBus("Any bottom casing", 1)
.addOutputHatch("Any bottom casing", 1)
.addEnergyHatch("Any bottom casing", 1)
.addMaintenanceHatch("Any bottom casing", 1)
.toolTipFinisher(EMT.NAME);
return tt;
}
@Override
public ITexture[] getTexture(
IGregTechTileEntity aBaseMetaTileEntity,
byte aSide,
byte aFacing,
byte aColorIndex,
boolean aActive,
boolean aRedstone) {
if (aSide == aFacing) {
if (aActive)
return new ITexture[] {
TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder()
.addIcon(OVERLAY_TELEPORTER_ACTIVE)
.extFacing()
.build(),
TextureFactory.builder()
.addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW)
.extFacing()
.glow()
.build()
};
return new ITexture[] {
TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(OVERLAY_TELEPORTER).extFacing().build(),
TextureFactory.builder()
.addIcon(OVERLAY_TELEPORTER_GLOW)
.extFacing()
.glow()
.build()
};
}
if (aActive)
return new ITexture[] {
TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder()
.addIcon(MACHINE_CASING_MAGIC_ACTIVE)
.extFacing()
.build(),
TextureFactory.builder()
.addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW)
.extFacing()
.glow()
.build()
};
return new ITexture[] {
TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC).extFacing().build(),
TextureFactory.builder()
.addIcon(MACHINE_CASING_MAGIC_GLOW)
.extFacing()
.glow()
.build()
};
}
@Override
public boolean isCorrectMachinePart(ItemStack aStack) {
return true;
}
@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return EMT_RecipeAdder.sFusionCraftingRecipes;
}
@Override
public boolean checkRecipe(ItemStack aStack) {
ItemStack[] tInputs = getCompactedInputs();
FluidStack[] tFluids = getCompactedFluids();
if (tInputs.length > 0) {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
GT_Recipe tRecipe = EMT_RecipeAdder.sFusionCraftingRecipes.findRecipe(
getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
if ((tRecipe != null)
&& (this.mTierCasing >= tRecipe.mSpecialValue)
&& (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 2, tVoltage);
if (this.mEUt > 0) this.mEUt = (-this.mEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
this.mMaxProgresstime /= ((mTierCasing - tRecipe.mSpecialValue) + 1);
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0), tRecipe.getOutput(1)};
this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
updateSlots();
return true;
}
}
return false;
}
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
public int getDamageToComponent(ItemStack aStack) {
return 0;
}
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
@Override
public void construct(ItemStack itemStack, boolean b) {
buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 9, 0);
}
}
@@ -1,440 +0,0 @@
package emt.gthandler.common.tileentities.machines.multi.generator;
import emt.gthandler.common.implementations.EssentiaHatch;
import emt.gthandler.common.items.EMT_CasingBlock;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.XSTR;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.visnet.VisNetHandler;
import thaumcraft.common.config.ConfigBlocks;
public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
private static final byte CASING_INDEX = 2;
public ArrayList<EssentiaHatch> mEssentiaHatches = new ArrayList();
private byte tick = 0;
private boolean has_lube = false;
public EMT_Large_Essentia_Gen(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
public EMT_Large_Essentia_Gen(String aName) {
super(aName);
}
@Override
public String[] getDescription() {
return new String[] {
"Controller Block for the Large Essentia Generator.",
"Produces energy from magical essentia decay.",
"Size(WxHxD): 7x4x7, Controller (Bottom, Center)",
"Top-Middle 5x1x5 layer are Muffler Hatches",
"Middle 5x2x5 layer are Essentia Diffusion Cells",
"Everything from here on goes either in the bottom or on the sides",
"1x Fluid Input Hatch",
"1x Essentia Input Hatch",
"1x Dynamo Hatches",
"1x Maintenance Hatch",
"The outer hull is made out of Magic Containing Casings",
"Produces 20x more than the singleblock generator per essentia",
"Causes magical and serious conventional pollution",
"Needs 1L Lubricant per second or will cause way more conventional pollution",
"Needs 10 " + EMTTextHelper.LIGHT_BLUE + "Aqua" + EMTTextHelper.LIGHT_GRAY
+ " cVis per second or will cause way more magical pollution",
"Added by EMT",
"Made by bartimaeusnek"
};
}
public int getCurrentEfficiency(ItemStack itemStack) {
return this.mEfficiency
- (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10;
}
@Override
public ITexture[] getTexture(
IGregTechTileEntity aBaseMetaTileEntity,
byte aSide,
byte aFacing,
byte aColorIndex,
boolean aActive,
boolean aRedstone) {
if (aSide == aFacing) {
return new ITexture[] {
Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
new GT_RenderedTexture(
aActive
? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE
: Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)
};
}
return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)};
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
return new EMT_Large_Essentia_Gen(this.mName);
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
// TODO Auto-generated method stub
return new int[0];
}
@Override
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
// TODO Auto-generated method stub
return false;
}
@Override
public int getSizeInventory() {
return 0;
}
@Override
public ItemStack getStackInSlot(int p_70301_1_) {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
// TODO Auto-generated method stub
return null;
}
@Override
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
// TODO Auto-generated method stub
}
@Override
public String getInventoryName() {
// TODO Auto-generated method stub
return this.mName;
}
@Override
public boolean hasCustomInventoryName() {
// TODO Auto-generated method stub
return true;
}
@Override
public int getInventoryStackLimit() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void markDirty() {
// TODO Auto-generated method stub
}
@Override
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
// TODO Auto-generated method stub
return true;
}
@Override
public void openInventory() {
// TODO Auto-generated method stub
}
@Override
public void closeInventory() {
// TODO Auto-generated method stub
}
@Override
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3;
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3;
for (int x = -3; x <= 3; x++) {
for (int z = -3; z <= 3; z++) {
for (int h = 0; h <= 3; h++) {
final IGregTechTileEntity tTileEntity =
aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, h, zDir + z);
if (!(Math.abs(x) == 3 || Math.abs(z) == 3)) {
// Muffler on top.
if ((h == 3)) {
if (!this.addMufflerToMachineList(tTileEntity, CASING_INDEX)) {
return false;
}
} else if (h != 0) {
// inside Special Blocks
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0]) return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1)) return false;
} else if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
// ground still casings
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0]) return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
} else if (h != 0) {
// walls
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0]) return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
} else if (h == 0) {
// top and bottom corners
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
if (((xDir + x) != 0) || ((zDir + z) != 0)) // controller
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0]) return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0))
return false;
}
}
}
}
if (this.mDynamoHatches.size() != 1) return false;
if (this.mInputHatches.size() != 1) return false;
if (this.mMaintenanceHatches.size() != 1) return false;
/*
//repair shit debug shit
this.mWrench = true;
this.mScrewdriver = true;
this.mSoftHammer = true;
this.mHardHammer = true;
this.mSolderingTool = true;
this.mCrowbar = true;
*/
return true;
}
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity instanceof EssentiaHatch) return addEssetiaHatchToList(aTileEntity, aBaseCasingIndex);
return super.addInputToMachineList(aTileEntity, aBaseCasingIndex);
}
private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
} else {
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) {
return false;
} else if (aMetaTileEntity instanceof EssentiaHatch) {
((EssentiaHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
return this.mEssentiaHatches.add((EssentiaHatch) aMetaTileEntity);
} else {
return false;
}
}
}
private void make_energy() {
AspectList fuel = this.mEssentiaHatches.get(0).getAspects();
double cached = 0;
++tick;
// make energy
for (final Aspect A : fuel.aspects.keySet()) {
if (fuel.getAmount(A) > 0) {
double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue();
cached += (burnvalue / 20D);
cached = Math.ceil(cached);
if (tick % 20 == 0) { // every second consume 1 essentia
// consume essentia and remove it from the Aspect List if its 0
this.mEssentiaHatches.get(0).getAspects().reduce(A, 1);
if (this.mEssentiaHatches.get(0).getAspects().getAmount(A) == 0)
this.mEssentiaHatches.get(0).getAspects().remove(A);
}
}
}
if (tick % 20 == 0) {
// consume lubricant
if (has_lube) this.mInputHatches.get(0).getFluid().amount -= 1;
tick = 0; // reset ticktimer
}
// transfer energy into mEU
this.mEUt = (int) Math.ceil(cached);
}
@Override
public boolean checkRecipe(ItemStack arg0) {
/*
if (!this.getBaseMetaTileEntity().isActive())
if (this.mEfficiency > 100)
this.mEfficiency -= 8;
else
this.mEfficiency = 100;
*/
if (this.mEssentiaHatches.get(0).fuelleft() > 0) {
this.mMaxProgresstime = 1;
this.mProgresstime = 0;
}
return this.mEssentiaHatches.get(0).fuelleft() > 0;
}
@Override
public boolean onRunningTick(ItemStack aStack) {
if (tick % 20 == 0) { // every second
// highers eff to max by 0.16% every running tick = 3,2% every second
if (this.mEfficiency < this.getMaxEfficiency(null) - 320) this.mEfficiency += 320;
else this.mEfficiency = getMaxEfficiency(null);
// check for Lubricant
this.has_lube = this.mInputHatches.get(0).getFluid() != null
&& this.mInputHatches.get(0).getFluid().isFluidEqual(Materials.Lubricant.getFluid(1L))
&& this.mInputHatches.get(0).getFluidAmount() > 0;
}
if (tick % 2 == 0) { // every 2nd tick
final XSTR R = new XSTR();
final World WORLD = this.getBaseMetaTileEntity().getWorld();
int x = this.getBaseMetaTileEntity().getXCoord();
int y = this.getBaseMetaTileEntity().getYCoord();
int z = this.getBaseMetaTileEntity().getZCoord();
// if out of aqua, make much flux but to not stop.
boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9;
// Random Change of a bit of Flux Gas.
final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size());
// gets a chanche to release flux gas based on missing efficiency, min 1%
if ((R.nextInt(getMaxEfficiency(null)) > (this.mEfficiency > 100 ? this.mEfficiency : 100)) || outOfcVis) {
x = this.mMufflerHatches
.get(RANDOMHATCH)
.getBaseMetaTileEntity()
.getXCoord();
y = this.mMufflerHatches
.get(RANDOMHATCH)
.getBaseMetaTileEntity()
.getYCoord()
+ 1;
z = this.mMufflerHatches
.get(RANDOMHATCH)
.getBaseMetaTileEntity()
.getZCoord();
WORLD.setBlock(x, y, z, ConfigBlocks.blockFluxGas, R.nextInt(8), 3);
}
}
make_energy();
++this.mProgresstime;
return super.onRunningTick(aStack);
}
@Override
public boolean explodesOnComponentBreak(ItemStack arg0) {
return false;
}
@Override
public int getDamageToComponent(ItemStack arg0) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getMaxEfficiency(ItemStack arg0) {
// TODO Auto-generated method stub
return 10000;
}
@Override
public int getPollutionPerTick(ItemStack arg0) {
return has_lube ? 50 : 1000;
}
@Override
public boolean isCorrectMachinePart(ItemStack arg0) {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isGivingInformation() {
return true;
}
@Override
public String[] getInfoData() {
String[] old = super.getInfoData();
old[2] = "Produces " + EMTTextHelper.RED + mEUt + EMTTextHelper.WHITE + "EU/t";
return old;
}
/* @Override
public void explodeMultiblock() {
final World WORLD=this.getBaseMetaTileEntity().getWorld();
final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3;
final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3;
for (int x = -3; x <= 3; x++)
for (int z = -3; z <= 3; z++)
for (int h = 0; h <= 3; h++)
WORLD.setBlock(xDir+x, this.getBaseMetaTileEntity().getYCoord()+h, zDir+z, ConfigBlocks.blockFluxGas, 8, 3);
super.explodeMultiblock();
}*/
}
+20 -39
View File
@@ -2,15 +2,19 @@ package emt.init;
import static thaumcraft.api.ThaumcraftApi.registerObjectTag;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.block.*;
import emt.block.BlockElectricCloud;
import emt.block.BlockEssentiaGenerators;
import emt.block.BlockMachines;
import emt.block.BlockPortableNode;
import emt.block.BlockShield;
import emt.item.block.ItemBlockElectricCloud;
import emt.item.block.ItemBlockEssentiaGenerators;
import emt.item.block.ItemBlockMachines;
import emt.item.block.ItemBlockSolars;
import emt.tile.solar.Solars;
import ic2.api.item.IC2Items;
import net.minecraft.block.Block;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -18,7 +22,7 @@ public class EMTBlocks {
public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud;
public static Block[] solars = new Block[Solars.getCountOfInstances()];
public static Block[] solars = new Block[0];
public static void registerBlocks() {
portableNode = new BlockPortableNode("portablenode");
@@ -27,22 +31,17 @@ public class EMTBlocks {
shield = new BlockShield("shield");
GameRegistry.registerBlock(shield, "ShieldBlock");
for (int i = 0; i < solars.length; i++) {
if (i == 0) {
solars[i] = new BlockSolars("solar", Solars.getCountOfMetas(i), i);
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars");
} else {
solars[i] = new BlockSolars("solar" + (i + 1), Solars.getCountOfMetas(i), i);
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars" + (i + 1));
}
if (Registry.enableGTCompat) {
solars = Solars.registerBlocks();
}
emtMachines = new BlockMachines("machine");
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
if (Registry.enableGTCompat) {
essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
}
electricCloud = new BlockElectricCloud("electricCloud");
GameRegistry.registerBlock(electricCloud, ItemBlockElectricCloud.class, "electricCloud");
}
@@ -62,17 +61,11 @@ public class EMTBlocks {
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("waterMill"),
new AspectList()
.add(Aspect.METAL, 2)
.add(Aspect.ENERGY, 1)
.add(Aspect.WATER, 2)
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("solarPanel"),
new AspectList()
.add(Aspect.METAL, 1)
.add(Aspect.ENERGY, 1)
.add(Aspect.LIGHT, 2)
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("windMill"),
@@ -94,31 +87,19 @@ public class EMTBlocks {
new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("electroFurnace"),
new AspectList()
.add(Aspect.METAL, 2)
.add(Aspect.ENERGY, 1)
.add(Aspect.FIRE, 3)
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("macerator"),
new AspectList()
.add(Aspect.METAL, 1)
.add(Aspect.ENERGY, 2)
.add(Aspect.MINE, 2)
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("extractor"),
new AspectList()
.add(Aspect.METAL, 2)
.add(Aspect.ENERGY, 1)
.add(Aspect.CRAFT, 2)
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("compressor"),
new AspectList()
.add(Aspect.METAL, 1)
.add(Aspect.ENERGY, 2)
.add(Aspect.VOID, 3)
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3)
.add(Aspect.MECHANISM, 1));
}
}
+4 -3
View File
@@ -1,14 +1,15 @@
package emt.init;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
import cpw.mods.fml.common.registry.EntityRegistry;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.entity.EntityEnergyBall;
import emt.entity.EntityLaser;
import emt.entity.EntityShield;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
public class EMTEntities {
+23 -12
View File
@@ -1,5 +1,11 @@
package emt.init;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.EMT;
import emt.item.ItemElectricScribingTools;
@@ -18,7 +24,13 @@ import emt.item.armor.wings.ItemFeatherWing;
import emt.item.armor.wings.ItemNanoWing;
import emt.item.armor.wings.ItemQuantumWing;
import emt.item.armor.wings.ItemThaumiumReinforcedWing;
import emt.item.focus.*;
import emt.item.focus.ItemChargeFocus;
import emt.item.focus.ItemChristmasFocus;
import emt.item.focus.ItemEnergyBallFocus;
import emt.item.focus.ItemExplosionFocus;
import emt.item.focus.ItemMaintenanceFocus;
import emt.item.focus.ItemShieldFocus;
import emt.item.focus.ItemWandChargingFocus;
import emt.item.tool.ItemElectricHoeGrowth;
import emt.item.tool.ItemElectricThorHammer;
import emt.item.tool.ItemThorHammer;
@@ -32,11 +44,6 @@ import emt.item.tool.omnitool.ItemOmnitoolDiamond;
import emt.item.tool.omnitool.ItemOmnitoolIron;
import emt.item.tool.omnitool.ItemOmnitoolThaumium;
import ic2.core.init.InternalName;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi;
public class EMTItems {
@@ -57,6 +64,7 @@ public class EMTItems {
public static Item christmasFocus;
public static Item shieldFocus;
public static Item energyBallFocus;
public static Item maintenanceFocus;
public static Item electricGoggles;
public static Item streamChainsaw;
public static Item rockbreakerDrill;
@@ -78,8 +86,8 @@ public class EMTItems {
public static Item nanoWing;
public static Item quantumWing;
public static Item quantumArmor;
public static ItemArmor.ArmorMaterial featherWingMaterial =
EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[] {2, 2, 2, 2}, 6);
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper
.addArmorMaterial("FEATEHRWiNG", 1, new int[] { 2, 2, 2, 2 }, 6);
public static void registerItems() {
itemEMTItems = new ItemMaterials();
@@ -124,8 +132,8 @@ public class EMTItems {
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum");
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
electricScribingTools =
new ItemElectricScribingTools().setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
electricScribingTools = new ItemElectricScribingTools()
.setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.feather");
@@ -135,8 +143,8 @@ public class EMTItems {
.setUnlocalizedName(EMT.MOD_ID + ".wing.thaumium");
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
nanoWing =
new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.nano");
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
.setUnlocalizedName(EMT.MOD_ID + ".wing.nano");
GameRegistry.registerItem(nanoWing, "NanosuitWing");
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
@@ -196,5 +204,8 @@ public class EMTItems {
energyBallFocus = new ItemEnergyBallFocus();
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
maintenanceFocus = new ItemMaintenanceFocus();
GameRegistry.registerItem(maintenanceFocus, "MaintenanceFocus");
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+39 -39
View File
@@ -1,7 +1,6 @@
package emt.init;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.gthandler.common.implementations.automation.EssentiaFiller;
import emt.tile.TileElectricCloud;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
@@ -13,49 +12,50 @@ public class EMTTiles {
public static void registerTileEntities() {
// Essentia Gens
// legacy support
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityarborgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
if (Registry.enableGTCompat) {
// Essentia Gens
// legacy support
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityarborgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
// new TEs will be called TileEntityEssentiaGenerator
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
// new TEs will be called TileEntityEssentiaGenerator
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
// Solars
// legacy support
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitywatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublewatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplewatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubledarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripledarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityfiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublefiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplefiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityearthsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
// new TEs will be called TileEntityXCompressedSolar
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
}
// Machinery
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
GameRegistry.registerTileEntity(EssentiaFiller.class, "EssentiaFillerTE");
// Solars
// legacy support
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitywatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublewatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplewatersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubledarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripledarksolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleordersolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityfiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublefiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplefiresolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleairsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityearthsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
// new TEs will be called TileEntityXCompressedSolar
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
// Random Stuff
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
@@ -1,272 +0,0 @@
package emt.init;
import static thaumcraft.api.aspects.Aspect.*;
import emt.EMT;
import emt.util.EMTResearchItem;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.CrucibleRecipe;
import thaumcraft.api.crafting.IArcaneRecipe;
import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.crafting.ShapedArcaneRecipe;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
public class EMT_GTNH_Recipes_And_Researches implements Runnable {
private static LinkedHashMap<String, IArcaneRecipe> arcaneRecipeLinkedHashMap = new LinkedHashMap<>();
private static LinkedHashMap<String, InfusionRecipe> infusionRecipeLinkedHashMap = new LinkedHashMap<>();
private static LinkedHashMap<String, CrucibleRecipe> cruciblRecipeLinkedHashMap = new LinkedHashMap<>();
private static AspectList getPrimals(int amount) {
return new AspectList()
.add(ORDER, amount)
.add(ENTROPY, amount)
.add(AIR, amount)
.add(EARTH, amount)
.add(WATER, amount)
.add(FIRE, amount);
}
@Override
public void run() {
// ItemStack glue =new ItemStack(EMTItems.itemEMTItems,1,8);
// HashSet<ShapelessRecipes> recipesHashSet = new HashSet<>();
// recipesHashSet.add(new ShapelessRecipes(glue,
// Arrays.asList(GT_ModHandler.getModItem("TConstruct","materials",1,36),GT_ModHandler.getModItem("TConstruct","materials",1,36))));
// recipesHashSet.add(new ShapelessRecipes(glue,
// Collections.singletonList(GT_ModHandler.getModItem("TConstruct", "materials", 2, 36))));
// for ( ShapelessRecipes sr : recipesHashSet)
// CraftingManager.getInstance().getRecipeList().add(sr);
//
// //Rubber ball recipes
//
// GT_Values.RA.addAlloySmelterRecipe(Materials.RubberTreeSap.getDust(4),ItemList.Shape_Mold_Ball.get(0),new
// ItemStack(EMTItems.itemEMTItems,1,10),200,16);
// GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(Items.paper,12),new
// ItemStack(EMTItems.itemEMTItems,1,10)},Materials.Glue.getMolten(6912),new
// ItemStack(EMTItems.itemEMTItems,1,9),600,30);
//
// GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ball.get(0),Materials.Rubber.getMolten(576),new
// ItemStack(EMTItems.itemEMTItems,1,10),100,30);
// GT_Values.RA.addPulveriserRecipe(new ItemStack(EMTItems.itemEMTItems,1,10),new
// ItemStack[]{Materials.Rubber.getDust(4)},null,300,2);
// GT_Values.RA.addFormingPressRecipe(Materials.Rubber.getPlates(4),ItemList.Shape_Mold_Ball.get(0),new
// ItemStack(EMTItems.itemEMTItems,1,10),100,30);
EMTResearches.addResearchTab();
runArcaneRecipes();
runResreaches();
}
private void runInfusionRecipes() {}
private void runKettleRecipes() {}
private void runArcaneRecipes() {
arcaneRecipeLinkedHashMap.put(
"DiamondChainsaw",
new ShapedArcaneRecipe(
"DiamondChainsaw",
new ItemStack(EMTItems.diamondChainsaw),
getPrimals(35),
"sts",
"pmp",
"pbp",
's',
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Diamond, 1),
'p',
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Diamond, 1),
't',
GT_OreDictUnificator.get(OrePrefixes.toolHeadChainsaw, Materials.Thaumium, 1),
'b',
ItemList.Battery_RE_LV_Sodium.get(1),
'm',
ItemList.Electric_Motor_MV.get(1)));
arcaneRecipeLinkedHashMap.put(
"ThaumiumChainsaw",
new ShapedArcaneRecipe(
"ThaumiumChainsaw",
new ItemStack(EMTItems.thaumiumChainsaw),
getPrimals(35),
"sps",
"pmp",
"ppp",
's',
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Thaumium, 1),
'p',
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1),
'b',
ItemList.Battery_RE_LV_Sodium.get(1),
'm',
new ItemStack(EMTItems.diamondChainsaw)));
for (IArcaneRecipe recipe : arcaneRecipeLinkedHashMap.values()) {
ThaumcraftApi.getCraftingRecipes().add(recipe);
}
}
private void runResreaches() {
HashSet<ResearchItem> researches = new HashSet<>();
researches.add(new EMTResearchItem(
"ElectricMagicTools", 0, 0, 0, new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"))
.setSpecial()
.setAutoUnlock()
.setPages(new ResearchPage("")));
researches.add(new EMTResearchItem(
"DiamondChainsaw",
new AspectList()
.add(GREED, 12)
.add(FIRE, 9)
.add(METAL, 6)
.add(EARTH, 3),
0,
-2,
2,
new ItemStack(EMTItems.diamondChainsaw))
.setPages(new ResearchPage(arcaneRecipeLinkedHashMap.get("DiamondChainsaw")))
.setRound()
.setParentsHidden("ElectricMagicTools"));
// researches.add(new EMTResearchItem("DiamondChainsaw",new
// AspectList().add(GREED,12).add(FIRE,9).add(METAL,6).add(EARTH,3),0,-2,2,new
// ItemStack(EMTItems.diamondChainsaw)).setRound());
researches.forEach(ResearchItem::registerResearchItem);
}
class ShapedArcaneRecipeIgnoresNBT extends ShapedArcaneRecipe {
protected String research;
protected ItemStack result;
protected AspectList aspects;
protected Object[] recipe;
protected LinkedHashMap<Character, Object> translation = new LinkedHashMap<>();
int[] rowcolm;
public ShapedArcaneRecipeIgnoresNBT(String research, ItemStack result, AspectList aspects, Object... recipe) {
super(research, result, aspects, recipe);
this.research = research;
this.result = result;
this.aspects = aspects;
this.recipe = recipe;
int rows = 0;
int colums = 0;
if (!(recipe[0] instanceof String))
throw new UnsupportedOperationException(
"The Recipe must start with at least one String for the first row!");
int i = 0;
rowcolm = new int[3];
do {
rows++;
colums = Math.max(colums, ((String) recipe[i]).length());
rowcolm[i] = colums;
i = rows;
} while (recipe[i] instanceof String);
if (rows > 3 || colums > 3)
throw new UnsupportedOperationException("The Recipe must fit in a 3x3 crafting field!");
rowcolm = Arrays.copyOf(rowcolm, rows);
int k = 0;
for (int j = i; j < recipe.length; j += 2) {
k++;
if (recipe[j] instanceof Character) translation.put((Character) recipe[j], recipe[j + 1]);
}
}
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player) {
if (this.research.length() > 0
&& !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))
return false;
else {
for (int y = 0; y < rowcolm.length; y++) {
String rowAsString = ((String) recipe[y]);
for (int x = 0; x < rowcolm[y]; x++) {
Object itemReplacement = translation.get(rowAsString.toCharArray()[x]);
ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y);
if (itemReplacement != null && slot == null) {
return false;
} else if (itemReplacement instanceof String) {
if (!GT_Utility.areStacksEqual(
GT_OreDictUnificator.getFirstOre(itemReplacement, 1),
GT_OreDictUnificator.get(slot),
true))
if (!OreDictionary.getOres((String) itemReplacement)
.contains(slot)) return false;
} else if (itemReplacement instanceof ItemStack) {
if (!GT_Utility.isStackValid(itemReplacement)) {
return false;
}
if (!GT_Utility.areStacksEqual((ItemStack) itemReplacement, slot, true))
if (!GT_Utility.areUnificationsEqual((ItemStack) itemReplacement, slot, true))
if (!(((ItemStack) itemReplacement)
.getItem()
.equals(slot.getItem())
&& ((ItemStack) itemReplacement).getItemDamage()
== OreDictionary.WILDCARD_VALUE)) return false;
} else if (itemReplacement instanceof Collection) {
boolean hit = false;
for (Object o : (Collection) itemReplacement) {
if (GT_Utility.areStacksEqual((ItemStack) o, slot, true)
|| GT_Utility.areUnificationsEqual((ItemStack) o, slot, true)
|| (((ItemStack) o).getItem().equals(slot.getItem())
&& ((ItemStack) itemReplacement).getItemDamage()
== OreDictionary.WILDCARD_VALUE)) hit = true;
}
if (!hit) {
return false;
}
}
}
}
return true;
}
}
@Override
public ItemStack getCraftingResult(IInventory iInventory) {
return result;
}
@Override
public int getRecipeSize() {
return recipe.length;
}
@Override
public ItemStack getRecipeOutput() {
return result;
}
@Override
public AspectList getAspects() {
return aspects;
}
@Override
public AspectList getAspects(IInventory iInventory) {
return aspects;
}
@Override
public String getResearch() {
return research;
}
}
}
+13 -6
View File
@@ -1,30 +1,37 @@
package emt.init;
import cpw.mods.fml.common.Loader;
import emt.gthandler.common.loader.EMT_GT_Loader;
import emt.tile.solar.Solars;
import emt.util.EMTEssentiasOutputs;
public class Registry {
private static final EMT_GT_Loader gtloader = new EMT_GT_Loader();
public static void registerPreInit() {}
public static boolean enableGTCompat;
public static void registerInit() {
public static void registerPreInit() {
enableGTCompat = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
EMTBlocks.registerBlocks();
EMTItems.registerItems();
EMTTiles.registerTileEntities();
gtloader.run();
}
public static void registerInit() {
EMTRecipes.registerEarlyRecipes();
}
public static void registerLate() {
EMTEssentiasOutputs.addOutputs();
EMTBlocks.addAspects();
gtloader.runlate();
if (enableGTCompat) {
EMT_GT_Loader.runlate();
}
EMTRecipes.registerLateRecipes();
// new EMT_GTNH_Recipes_And_Researches().run();
EMTRecipes.registerUUMInfusionRecipes();
EMTResearches.register();
Solars.registerReverseRecipes();
if (enableGTCompat) {
Solars.registerReverseRecipes();
}
}
}
+4 -4
View File
@@ -1,11 +1,12 @@
package emt.item;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import emt.EMT;
import emt.util.EMTTextHelper;
public class ItemBase extends Item {
public ItemBase(String unlocName, String textureName) {
@@ -23,7 +24,6 @@ public class ItemBase extends Item {
public String getItemStackDisplayName(ItemStack stack) {
return (EMTTextHelper.GREEN
+ StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name"))
.trim();
+ StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
}
}
@@ -1,16 +1,18 @@
package emt.item;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import thaumcraft.api.IScribeTools;
import thaumcraft.common.items.ItemInkwell;
@@ -24,9 +26,8 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
this.setMaxStackSize(1);
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -51,7 +52,7 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
+16 -14
View File
@@ -1,5 +1,16 @@
package emt.item;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
@@ -8,15 +19,6 @@ import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import thaumcraft.api.IRunicArmor;
public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
@@ -65,7 +67,7 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
list.add(new ItemStack(this, 1, 0));
list.add(new ItemStack(this, 1, 1));
}
@@ -89,8 +91,8 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.armorInventory[i] != null)
&& (((EntityPlayer) player).inventory.armorInventory[i].getItem()
instanceof IElectricItem)) {
&& (((EntityPlayer) player).inventory.armorInventory[i]
.getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
((EntityPlayer) player).inventory.armorInventory[i],
energyLeft,
@@ -111,8 +113,8 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.mainInventory[i] != null)
&& (((EntityPlayer) player).inventory.mainInventory[i].getItem()
instanceof IElectricItem)) {
&& (((EntityPlayer) player).inventory.mainInventory[i]
.getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
((EntityPlayer) player).inventory.mainInventory[i],
energyLeft,
+24 -10
View File
@@ -1,9 +1,7 @@
package emt.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -14,6 +12,7 @@ import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
@@ -22,6 +21,10 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import thaumcraft.common.config.Config;
import thaumcraft.common.lib.utils.InventoryUtils;
@@ -107,6 +110,18 @@ public class ItemMaterials extends Item {
return "item." + EMT.MOD_ID + "." + name;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> result, boolean advanced) {
switch (stack.getItemDamage()) {
case 16:
case 17:
case 18:
case 19:
result.add(EnumChatFormatting.RED + "[DEPRECATED] Please put in the crafting table to get back!");
break;
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
@@ -137,7 +152,7 @@ public class ItemMaterials extends Item {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
for (int i = 1; i <= 19; i++) {
list.add(new ItemStack(this, 1, i));
}
@@ -151,12 +166,12 @@ public class ItemMaterials extends Item {
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
double playerY =
(player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D)
- player.yOffset;
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
float f6 = MathHelper.sin(-f1 * 0.01745329F);
float f7 = f4 * f5;
@@ -210,8 +225,7 @@ public class ItemMaterials extends Item {
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5);
if ((!entity.worldObj.isRemote)
&& ((stack.getItemDamage() == 13))
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13))
&& ((entity instanceof EntityLivingBase))
&& (!((EntityLivingBase) entity).isEntityUndead())
&& (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID))
+71 -58
View File
@@ -1,13 +1,8 @@
package emt.item;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@@ -20,11 +15,19 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IWarpingGear;
import thaumcraft.api.ThaumcraftApiHelper;
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor {
private static final String NBT_TAG_FORGE_DATA = "EMT";
private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption";
private static final String NBT_TAG_WARP = "warp";
@@ -58,10 +61,11 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> list, boolean par4) {
String colourCode = "" + EnumChatFormatting.DARK_RED;
list.add(colourCode
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
list.add(
colourCode
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
list.add(colourCode + "Can RUIN your game if you don't understand what this does. READ THE QUEST!!");
super.addInformation(itemStack, player, list, par4);
}
@@ -77,7 +81,7 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
list.add(new ItemStack(this, 1, 0));
}
@@ -128,11 +132,11 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
// Stop doing this 20 times per second...
if (random.nextInt(20) > 0) return;
/* Why dump to a new tag when you can just grab the tag and work with it?
NBTTagCompound tag = new NBTTagCompound();
((EntityPlayer) player).writeToNBT(tag);
NBTTagCompound forgeTag = tag.getCompoundTag("ForgeData");
*/
/*
* Why dump to a new tag when you can just grab the tag and work with it? NBTTagCompound tag = new
* NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); NBTTagCompound forgeTag =
* tag.getCompoundTag("ForgeData");
*/
// Retrieve Players NBT Data
@@ -149,12 +153,17 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
// stack, false ) ));
if (corruption == 0) {
((EntityPlayer) player)
.addChatMessage(new ChatComponentText(
((EntityPlayer) player).addChatMessage(
new ChatComponentText(
EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever "
+ EMTTextHelper.PURPLE + "tainted. " + EMTTextHelper.RED + EMTTextHelper.ITALIC
+ "Beware of wearing the ring. The tainting will only " + EMTTextHelper.RED
+ EMTTextHelper.ITALIC + "increase, and strange things will start happening."));
+ EMTTextHelper.PURPLE
+ "tainted. "
+ EMTTextHelper.RED
+ EMTTextHelper.ITALIC
+ "Beware of wearing the ring. The tainting will only "
+ EMTTextHelper.RED
+ EMTTextHelper.ITALIC
+ "increase, and strange things will start happening."));
}
// First effect should become active after ~5 Minutes
else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) {
@@ -176,33 +185,41 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
if (corruption >= 300) { // worn more than 5 minutes
if (random.nextInt(100) == 0) { // every 100 seconds
getItemWarpLevel(stack, true);
((EntityPlayer) player)
.addChatMessage(new ChatComponentText(
EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
}
if (random.nextInt(300) == 0) { // randomly every 5 minutes
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 1, false); // adds 1 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer(
(EntityPlayer) player, random.nextInt(1)); // adds 0-1 sticky warp
((EntityPlayer) player)
.addChatMessage(new ChatComponentText(
EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, random.nextInt(1)); // adds 0-1
// sticky warp
((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
}
if (corruption >= 3600) { // if you wear it for more than an hour total
if (random.nextInt(300) == 0) {
ThaumcraftApiHelper.addWarpToPlayer(
(EntityPlayer) player, 5 + random.nextInt(5), false); // adds 5-10 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer(
(EntityPlayer) player, 5 + random.nextInt(5)); // adds 5-10 sticky warp
ThaumcraftApiHelper.addWarpToPlayer(
(EntityPlayer) player,
10 + random.nextInt(40),
true); // adds 10-50 temp warp, but this is ultra easy to remove
((EntityPlayer) player)
.addChatMessage(
new ChatComponentText(
EMTTextHelper.PURPLE
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5), false); // adds
// 5-10
// perm
// warp
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5)); // adds
// 5-10
// sticky
// warp
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 10 + random.nextInt(40), true); // adds
// 10-50
// temp
// warp,
// but
// this
// is
// ultra
// easy
// to
// remove
((EntityPlayer) player).addChatMessage(
new ChatComponentText(
EMTTextHelper.PURPLE
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
}
}
}
@@ -216,11 +233,9 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
public void onEquipped(ItemStack stack, EntityLivingBase player) {
// This purges all corruption once the ring is put on / a second ring is equipped?
/*
NBTTagCompound tag = new NBTTagCompound();
((EntityPlayer) player).writeToNBT(tag);
tag.getCompoundTag( NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0);
((EntityPlayer) player).readFromNBT(tag);
*/
* NBTTagCompound tag = new NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); tag.getCompoundTag(
* NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0); ((EntityPlayer) player).readFromNBT(tag);
*/
}
@Override
@@ -229,11 +244,10 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
if (!((EntityPlayer) player).capabilities.isCreativeMode)
((EntityPlayer) player).capabilities.disableDamage = false;
/* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt!
((EntityPlayer) player).writeToNBT(tag);
tag.removeTag( NBT_TAG_FORGE_DATA );
((EntityPlayer) player).readFromNBT(tag);
*/
/*
* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt! ((EntityPlayer)
* player).writeToNBT(tag); tag.removeTag( NBT_TAG_FORGE_DATA ); ((EntityPlayer) player).readFromNBT(tag);
*/
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false));
}
@@ -253,13 +267,12 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
boolean tRet = false;
if (random.nextInt(5) == 0) {
tRet = true;
((EntityPlayer) player)
.addChatMessage(new ChatComponentText(EMTTextHelper.GREEN
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
} else
((EntityPlayer) player)
.addChatMessage(new ChatComponentText(
EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
((EntityPlayer) player).addChatMessage(
new ChatComponentText(
EMTTextHelper.GREEN
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
} else((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
return tRet;
}
@@ -1,15 +1,7 @@
package emt.item.armor.boots;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -25,19 +17,36 @@ import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.items.armor.Hover;
import thaumicboots.api.IBoots;
@Interface(iface = "thaumicboots.api.IBoots", modid = "thaumicboots")
public class ItemElectricBootsTraveller extends ItemArmor
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor, IBoots {
public int maxCharge = 100000;
public int energyPerDamage = 1000;
public int visDiscount = 2;
public float speedBonus = 0.055F;
public float jumpBonus = 0.3F;
// constant from Thaumcraft's EventHandlerEntity#playerJumps for basic Traveller Boots
public float jumpBonus = 0.2750000059604645F;
public double transferLimit = 100;
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
@@ -45,11 +54,11 @@ public class ItemElectricBootsTraveller extends ItemArmor
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setCreativeTab(EMT.TAB);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -68,15 +77,15 @@ public class ItemElectricBootsTraveller extends ItemArmor
}
@Override
public ArmorProperties getProperties(
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit =
energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
}
}
@@ -103,9 +112,8 @@ public class ItemElectricBootsTraveller extends ItemArmor
return 0.15D;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
}
@@ -117,31 +125,66 @@ public class ItemElectricBootsTraveller extends ItemArmor
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(
Integer.valueOf(player.getEntityId()))) {
Thaumcraft.instance.entityEventHandler.prevStep.put(
Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
if (getIntertialState(itemStack) && player.moveForward == 0
&& player.moveStrafing == 0
&& player.capabilities.isFlying) {
player.motionX *= 0.5;
player.motionZ *= 0.5;
}
boolean omniMode = false;
if (EMT.isBootsActive) {
omniMode = isOmniEnabled(itemStack);
if ((player.moveForward == 0F && player.moveStrafing == 0F && omniMode)
|| (player.moveForward <= 0F && !omniMode)) {
return;
}
}
if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) {
if (player.worldObj.isRemote && !player.isSneaking()) {
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight);
}
player.stepHeight = 1.0F;
}
float speedMod = (float) getSpeedModifier(itemStack);
if (player.onGround || player.isOnLadder() || player.capabilities.isFlying) {
float bonus = speedBonus;
if (player.isInWater()) {
bonus /= 4.0F;
}
if (((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) {
player.moveFlying(0F, 1F, speedBonus);
player.jumpMovementFactor = jumpBonus;
if (player.isSneaking()) {
bonus /= 2.0F;
}
bonus *= speedMod;
if (EMT.isBootsActive) {
applyOmniState(player, bonus, itemStack);
} else if (player.moveForward > 0.0) {
player.moveFlying(0.0F, player.moveForward, bonus);
}
} else if (Hover.getHover(player.getEntityId())) {
// Base ItemBootsTraveller jumpBonus equals to jumpBonus of Electric Boots,
// so any other boots factor can be calculated via proportion method
player.jumpMovementFactor = 0.03F
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
* jumpBonus
* speedMod;
} else {
player.jumpMovementFactor = 0.05F
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
* jumpBonus
* speedMod;
}
}
}
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null
&& player.getCurrentArmor(0).getItem() == this;
if (hasArmor) player.motionY += jumpBonus;
@Optional.Method(modid = "thaumicboots")
public void applyOmniState(EntityPlayer player, float bonus, ItemStack itemStack) {
if (player.moveForward != 0.0) {
player.moveFlying(0.0F, player.moveForward, bonus);
}
if (player.moveStrafing != 0.0 && getOmniState(itemStack)) {
player.moveFlying(player.moveStrafing, 0.0F, bonus);
}
}
@@ -154,38 +197,6 @@ public class ItemElectricBootsTraveller extends ItemArmor
return 4.0f;
}
@SubscribeEvent
public void onLivingFall(LivingFallEvent event) {
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer entity = (EntityPlayer) event.entity;
if ((entity.inventory.armorInventory[0] != null)
&& (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
ItemElectricBootsTraveller tUsedBoots =
(ItemElectricBootsTraveller) entity.inventory.armorInventory[0].getItem();
ItemStack stack = entity.inventory.armorInventory[0];
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
if (tUsedBoots.getMinimumDropDist() > event.distance) {
event.setCanceled(true);
} else {
float tEnergyDemand = tUsedBoots.energyPerDamage
* (((event.distance > tUsedBoots.getMaxHealthyDropDist())
? event.distance * 3
: event.distance)
- 4.0F);
if (tEnergyDemand <= ElectricItem.manager.getCharge(stack)) {
// EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance,
// tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() ));
ElectricItem.manager.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true);
}
}
}
}
}
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/electricboots.png";
@@ -259,4 +270,79 @@ public class ItemElectricBootsTraveller extends ItemArmor
public int getRunicCharge(ItemStack itemStack) {
return 0;
}
// Avoid NSM Exception when ThaumicBoots is not present.
public double getSpeedModifier(ItemStack stack) {
if (stack.stackTagCompound != null) {
return stack.stackTagCompound.getDouble("speed");
}
return 1.0;
}
public double getJumpModifier(ItemStack stack) {
if (stack.stackTagCompound != null) {
return stack.stackTagCompound.getDouble("jump");
}
return 1.0;
}
public boolean getOmniState(ItemStack stack) {
if (stack.stackTagCompound != null) {
return stack.stackTagCompound.getBoolean("omni");
}
return false;
}
public boolean getIntertialState(ItemStack stack) {
if (stack.stackTagCompound != null) {
return stack.stackTagCompound.getBoolean("inertiacanceling");
}
return false;
}
public class EventHandler {
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
ItemStack boots = player.getCurrentArmor(0);
boolean hasArmor = boots != null && boots.getItem() == ItemElectricBootsTraveller.this;
if (hasArmor) player.motionY += jumpBonus * (float) getJumpModifier(boots);
}
}
@SubscribeEvent
public void onLivingFall(LivingFallEvent event) {
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer entity = (EntityPlayer) event.entity;
if ((entity.inventory.armorInventory[0] != null)
&& (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0]
.getItem();
ItemStack stack = entity.inventory.armorInventory[0];
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
if (tUsedBoots.getMinimumDropDist() > event.distance) {
event.setCanceled(true);
} else {
float tEnergyDemand = tUsedBoots.energyPerDamage
* (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3
: event.distance) - 4.0F);
if (tEnergyDemand <= ElectricItem.manager.getCharge(stack)) {
// EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance,
// tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() ));
ElectricItem.manager
.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true);
}
}
}
}
}
}
}
}
@@ -1,14 +1,19 @@
package emt.item.armor.boots;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import gregtech.api.hazards.Hazard;
import gregtech.api.hazards.IHazardProtector;
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller implements IHazardProtector {
public ItemNanoBootsTraveller(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
@@ -50,4 +55,10 @@ public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/nanobootstravel.png";
}
@Override
@Optional.Method(modid = "gregtech_nh")
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;
}
}
@@ -1,14 +1,19 @@
package emt.item.armor.boots;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import gregtech.api.hazards.Hazard;
import gregtech.api.hazards.IHazardProtector;
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller implements IHazardProtector {
public ItemQuantumBootsTraveller(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
@@ -50,4 +55,10 @@ public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/quantumbootstravel.png";
}
@Override
@Optional.Method(modid = "gregtech_nh")
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;
}
}
@@ -1,23 +1,9 @@
package emt.item.armor.chestplate;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelSpecialArmor;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.audio.AudioSource;
import ic2.core.audio.PositionSpec;
import ic2.core.init.InternalName;
import ic2.core.item.armor.ItemArmorElectric;
import ic2.core.util.StackUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -34,9 +20,29 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelSpecialArmor;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import gregtech.api.hazards.Hazard;
import gregtech.api.hazards.IHazardProtector;
import ic2.api.item.ElectricItem;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.audio.AudioSource;
import ic2.core.audio.PositionSpec;
import ic2.core.init.InternalName;
import ic2.core.item.armor.ItemArmorElectric;
import ic2.core.util.StackUtil;
import thaumcraft.api.IRunicArmor;
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor {
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor, IHazardProtector {
public static AudioSource audioSource;
protected static ArrayList<Integer> potionRemovalCost = new ArrayList<Integer>();
@@ -54,7 +60,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
super(internalName, InternalName.quantum, armorType, 20000000D, 18000.0D, 4);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
this.setCreativeTab(EMT.TAB);
}
@@ -77,24 +83,6 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
}
@SubscribeEvent
public void onEntityLivingFallEvent(LivingFallEvent event) {
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
EntityLivingBase entity = (EntityLivingBase) event.entity;
ItemStack armor = entity.getEquipmentInSlot(1);
if ((armor != null) && (armor.getItem() == this)) {
int fallDamage = Math.max((int) event.distance - 10, 0);
double energyCost = getEnergyPerDamage() * fallDamage;
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true);
}
}
}
}
@Override
public double getDamageAbsorptionRatio() {
return 1.1D;
@@ -173,11 +161,13 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
nbt.setByte("wing", JETPACK);
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
// if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack),
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack),
// player);
// }
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack))*/));
nbt.setInteger(
"jetpackCharge",
(int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack)) */));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
} else if (currentItem == EMTItems.thaumiumWing) {
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
@@ -188,26 +178,29 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
nbt.setByte("wing", NANO);
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
// if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge -
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge -
// ElectricItem.manager.getCharge(currentStack), player);
// }
nbt.setInteger(
"NWCharge",
(int)
(ElectricItem.manager.getCharge(
player.inventory
.getCurrentItem()) /* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
(int) (ElectricItem.manager.getCharge(
player.inventory.getCurrentItem()) /*
* + charge - (int)
* ElectricItem.manager.getCharge(itemStack)
*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
} else if (currentItem == EMTItems.quantumWing) {
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
nbt.setByte("wing", QUANTUM);
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
// if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge -
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge -
// ElectricItem.manager.getCharge(currentStack), player);
// }
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
nbt.setInteger(
"QWCharge",
(int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack) */));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
@@ -218,8 +211,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
if (wing == JETPACK) {
IC2.platform.messagePlayer(player, "Jetpack disabled.", new Object[0]);
nbt.setByte("wing", NONE);
ItemStack charged =
new ItemStack(IC2Items.getItem("electricJetpack").getItem());
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
if (nbt.getInteger("jetpackCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
else ElectricItem.manager.charge(charged, 0, 1, true, false);
@@ -230,7 +222,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]);
nbt.setByte("wing", NONE);
player.inventory.setInventorySlotContents(
player.inventory.currentItem, new ItemStack(EMTItems.thaumiumWing));
player.inventory.currentItem,
new ItemStack(EMTItems.thaumiumWing));
}
if (wing == NANO) {
@@ -383,27 +376,29 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
try {
if (entity instanceof EntityPlayer) {
byte wing = stack.stackTagCompound.getByte("wing");
if (wing == JETPACK) {
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 1);
return mbm;
} else if (wing != 0) {
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 2);
mbm.isJumping = stack.stackTagCompound.getBoolean("isJumping");
return mbm;
if (entity instanceof EntityPlayer && stack != null && stack.stackTagCompound != null) {
byte wing = stack.stackTagCompound.getByte("wing");
if (wing == JETPACK) {
ModelSpecialArmor.getInstance().type = 1;
} else if (wing != 0) {
ModelSpecialArmor.getInstance().type = 2;
if (stack.stackTagCompound.hasKey("isJumping")) {
ModelSpecialArmor.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
}
} else {
ModelSpecialArmor.getInstance().type = 0;
}
} catch (NullPointerException e) {
new ModelSpecialArmor(1, 0);
} else {
ModelSpecialArmor.getInstance().type = 0;
}
return new ModelSpecialArmor(1, 0);
return ModelSpecialArmor.getInstance();
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") List list,
boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -417,8 +412,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
}
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
power = (float)
(power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) * dropPercentage);
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge)
* dropPercentage);
}
if (IC2.keyboard.isForwardKeyDown(player)) {
@@ -475,15 +470,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
return true;
}
void useWings(
EntityPlayer player,
ItemStack stack,
World world,
float motionY,
float motionXZ,
float f1,
int amount,
boolean isElectric) {
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
int amount, boolean isElectric) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
nbt.setBoolean("isJumping", isJumping);
@@ -532,6 +520,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
if (isJumping && !player.onGround && player.motionY < 0) {
player.motionY *= f1;
player.fallDistance = 0;
}
if (player.isInWater() && !player.capabilities.isCreativeMode) {
@@ -553,9 +542,6 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
player.motionY *= 0.6;
}
if (player.fallDistance > 0.0F) {
player.fallDistance = 0;
}
}
@@ -564,4 +550,31 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
public int getRunicCharge(ItemStack itemStack) {
return 0;
}
@Override
@Optional.Method(modid = "gregtech_nh")
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;
}
public class EventHandler {
@SubscribeEvent
public void onEntityLivingFallEvent(LivingFallEvent event) {
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
EntityLivingBase entity = (EntityLivingBase) event.entity;
ItemStack armor = entity.getEquipmentInSlot(1);
if ((armor != null) && (armor.getItem() == ItemInfusedQuantumChestplate.this)) {
int fallDamage = Math.max((int) event.distance - 10, 0);
double energyCost = getEnergyPerDamage() * fallDamage;
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true);
}
}
}
}
}
}
@@ -1,14 +1,7 @@
package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -21,6 +14,15 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IVisDiscountGear;
@@ -56,7 +58,7 @@ public class ItemElectricGoggles extends ItemArmor
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -112,15 +114,15 @@ public class ItemElectricGoggles extends ItemArmor
}
@Override
public ArmorProperties getProperties(
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit =
energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
}
}
@@ -134,9 +136,8 @@ public class ItemElectricGoggles extends ItemArmor
}
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
}
@@ -1,16 +1,21 @@
package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.IC2Items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemNanoGoggles extends ItemElectricGoggles {
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import gregtech.api.hazards.Hazard;
import gregtech.api.hazards.IHazardProtector;
import ic2.api.item.IC2Items;
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
public class ItemNanoGoggles extends ItemElectricGoggles implements IHazardProtector {
public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
@@ -49,4 +54,10 @@ public class ItemNanoGoggles extends ItemElectricGoggles {
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
IC2Items.getItem("nightvisionGoggles").getItem().onArmorTick(world, player, itemStack);
}
@Override
@Optional.Method(modid = "gregtech_nh")
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;
}
}
@@ -1,15 +1,10 @@
package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.util.Keyboard;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,9 +12,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.util.Keyboard;
public class ItemQuantumGoggles extends ItemNanoGoggles {
private static final Map<Integer, Integer> potionCost = new HashMap();
private static final Map<Integer, Integer> potionCost = new HashMap<>();
public ItemQuantumGoggles(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
@@ -65,13 +67,14 @@ public class ItemQuantumGoggles extends ItemNanoGoggles {
Field f;
f = Keyboard.class.getDeclaredField("playerKeys");
f.setAccessible(true);
Map<EntityPlayer, Set<Enum>> playerKeys = (Map<EntityPlayer, Set<Enum>>) f.get(IC2.keyboard);
@SuppressWarnings("unchecked")
Map<EntityPlayer, Set<Enum<?>>> playerKeys = (Map<EntityPlayer, Set<Enum<?>>>) f.get(IC2.keyboard);
Enum hub = null;
Set<Enum> set = playerKeys.get(player);
Enum<?> hub = null;
Set<Enum<?>> set = playerKeys.get(player);
if (set != null) {
for (Enum e : set) {
for (Enum<?> e : set) {
if (e.ordinal() == 6) {
hub = e;
}
@@ -1,12 +1,8 @@
package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -14,19 +10,22 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
private static final Map potionCost = new HashMap();
/*private int ticker;
private int generating;
private boolean sunIsUp;
private boolean skyIsVisible;
private boolean noSunWorld;
private boolean dampPlace;*/
private static final Map<Integer, Integer> potionCost = new HashMap<>();
/*
* private int ticker; private int generating; private boolean sunIsUp; private boolean skyIsVisible; private
* boolean noSunWorld; private boolean dampPlace;
*/
private int genDay;
private int genNight;
@SuppressWarnings("unchecked")
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setMaxDamage(27);
@@ -83,8 +82,8 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
if (enerj > 0) {
if ((player.inventory.armorInventory[i] != null)
&& (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket =
ElectricItem.manager.charge(player.inventory.armorInventory[i], enerj, 4, false, false);
double sentPacket = ElectricItem.manager
.charge(player.inventory.armorInventory[i], enerj, 4, false, false);
enerj -= sentPacket;
}
} else {
@@ -95,8 +94,8 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
if (enerj > 0) {
if ((player.inventory.mainInventory[j] != null)
&& (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket =
ElectricItem.manager.charge(player.inventory.mainInventory[j], enerj, 4, false, false);
double sentPacket = ElectricItem.manager
.charge(player.inventory.mainInventory[j], enerj, 4, false, false);
enerj -= sentPacket;
}
} else {
@@ -1,13 +1,5 @@
package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelWings;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -17,9 +9,19 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelWings;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import thaumcraft.api.IRunicArmor;
public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
public int visDiscount = 0;
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
@@ -49,16 +51,13 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
try {
if (entity instanceof EntityPlayer) {
ModelWings mw = new ModelWings();
mw.isJumping = stack.stackTagCompound.getBoolean("isJumping");
return mw;
}
} catch (NullPointerException e) {
return new ModelWings();
if (entity instanceof EntityPlayer && stack != null
&& stack.stackTagCompound != null
&& stack.stackTagCompound.hasKey("isJumping")) {
ModelWings.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
}
return new ModelWings();
return ModelWings.getInstance();
}
@Override
@@ -66,16 +65,16 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0);
}
public void useWings(
EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
int amount) {
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
boolean isJmuping = nbtData.getBoolean("isJumping");
boolean isJumping = nbtData.getBoolean("isJumping");
boolean isHolding = nbtData.getBoolean("isHolding");
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
if (isJmuping) {
if (isJumping) {
byte f = nbtData.getByte("f");
nbtData.setBoolean("isHolding", true);
if (IC2.keyboard.isSneakKeyDown(player)) nbtData.setByte("f", (byte) (0));
@@ -106,8 +105,9 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
nbtData.setByte("f", (byte) 0);
}
if (isJmuping && !player.onGround && player.motionY < 0) {
if (isJumping && !player.onGround && player.motionY < 0) {
player.motionY *= f1;
player.fallDistance = 0;
}
if (player.isInWater() && !player.capabilities.isCreativeMode) {
@@ -125,6 +125,7 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
player.motionY *= 0.6;
player.fallDistance = 0;
}
}
@@ -1,13 +1,7 @@
package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -20,7 +14,20 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import gregtech.api.hazards.Hazard;
import gregtech.api.hazards.IHazardProtector;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
public class ItemNanoWing extends ItemThaumiumReinforcedWing
implements IElectricItem, ISpecialArmor, IMetalArmor, IHazardProtector {
public static int maxCharge = 1000000;
public int tier = 3;
@@ -47,7 +54,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -103,15 +110,15 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
}
@Override
public ArmorProperties getProperties(
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit =
energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
}
}
@@ -130,9 +137,8 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -175,4 +181,10 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
@Optional.Method(modid = "gregtech_nh")
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;
}
}
@@ -1,15 +1,17 @@
package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
public class ItemQuantumWing extends ItemNanoWing {
public static int maxCharge = 10000000;
public int tier = 4;
@@ -1,15 +1,17 @@
package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
@@ -47,9 +49,8 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
return EMT.TEXTURE_PATH + ":textures/models/thaumiumwing.png";
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
}
@@ -1,7 +1,5 @@
package emt.item.block;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock;
@@ -9,6 +7,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import emt.EMT;
import emt.util.EMTTextHelper;
public class ItemBlockElectricCloud extends ItemBlock {
public IIcon icon;
@@ -29,8 +30,7 @@ public class ItemBlockElectricCloud extends ItemBlock {
@Override
public String getItemStackDisplayName(ItemStack stack) {
return EMTTextHelper.PURPLE
+ EMTTextHelper.BOLD
return EMTTextHelper.PURPLE + EMTTextHelper.BOLD
+ StatCollector.translateToLocal(getUnlocalizedName() + ".name");
}
}
@@ -1,16 +1,18 @@
package emt.item.block;
import emt.util.EMTConfigHandler;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import gregtech.api.enums.GT_Values;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import emt.util.EMTConfigHandler;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import thaumcraft.api.aspects.Aspect;
public class ItemBlockEssentiaGenerators extends ItemBlock {
@@ -54,103 +56,153 @@ public class ItemBlockEssentiaGenerators extends ItemBlock {
}
private long getOutputAmperage(double EU) {
return (long) (1L + (EU / 20.0D / 20.0D / GT_Values.V[2]));
return 1L + (long) (EU * 1.953125e-5); // EU/(20 * 20 * 128)
}
@Override
public void addInformation(ItemStack is, EntityPlayer player, List list, boolean flag) {
public void addInformation(ItemStack is, EntityPlayer player, List<String> list, boolean flag) {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
switch (is.getItemDamage()) {
case 0:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())))
+ " EU");
break;
case 1:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
+ " EU");
break;
case 2:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())))
+ " EU");
break;
case 3:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
+ " EU");
break;
case 4:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())))
+ " EU");
break;
case 5:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()) / 20 / 20))
+ " EU/t");
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY + "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())) + " A");
list.add(EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))) + " EU");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
+ EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())))
+ " EU");
break;
default:
break;
}
list.add(EMTTextHelper.YELLOW + StatCollector.translateToLocal("emt.Storage") + EMTTextHelper.LIGHT_GRAY
+ Double.toString(EMTConfigHandler.EssentiaGeneratorStorage) + " EU");
list.add(
EMTTextHelper.YELLOW + StatCollector.translateToLocal("emt.Storage")
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString(EMTConfigHandler.EssentiaGeneratorStorage)
+ " EU");
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
}
}
@@ -1,6 +1,7 @@
package emt.item.block;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
@@ -45,7 +46,8 @@ public class ItemBlockMachines extends ItemBlock {
}
@Override
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List<String> p_77624_3_,
boolean p_77624_4_) {
switch (p_77624_1_.getItemDamage()) {
case 2: {
p_77624_3_.add("Connects between Essentia Hatches and the Pipe Network");
+503 -189
View File
@@ -1,6 +1,20 @@
package emt.item.block;
import static emt.util.EMTTextHelper.localize;
import static gregtech.api.util.GTUtility.formatNumbers;
import java.io.StringReader;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringTranslate;
import org.apache.commons.io.input.ReaderInputStream;
import org.lwjgl.input.Keyboard;
import emt.EMT;
import emt.block.BlockBaseContainer;
@@ -8,16 +22,6 @@ import emt.tile.solar.Solars;
import emt.tile.solar.TileEntitySolarBase;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import java.io.StringReader;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringTranslate;
import org.apache.commons.io.input.ReaderInputStream;
import org.lwjgl.input.Keyboard;
public class ItemBlockSolars extends ItemBlock {
@@ -32,8 +36,9 @@ public class ItemBlockSolars extends ItemBlock {
@Override
public String getUnlocalizedName(ItemStack itemstack) {
final String solarName = Solars.getNameFromSolar(this.instance, itemstack.getItemDamage());
final String unlocalizedName =
"tile." + EMT.MOD_ID + "." + Solars.getUnlocalizedName(this.instance, itemstack.getItemDamage());
final String unlocalizedName = "tile." + EMT.MOD_ID
+ "."
+ Solars.getUnlocalizedName(this.instance, itemstack.getItemDamage());
final String unlocalizedKey = unlocalizedName + ".name";
if (!StatCollector.canTranslate(unlocalizedKey))
StringTranslate.inject(new ReaderInputStream(new StringReader(unlocalizedKey + "=" + solarName)));
@@ -46,166 +51,354 @@ public class ItemBlockSolars extends ItemBlock {
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advancedItemTooltips) {
public void addInformation(ItemStack itemstack, EntityPlayer player, List<String> list,
boolean advancedItemTooltips) {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
TileEntitySolarBase te = Solars.getTileEntitySolarBase(instance, itemstack.getItemDamage());
if (instance == 0) {
switch (itemstack.getItemDamage()) {
case 0: {
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
list.add(
formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break;
}
case 1: {
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
list.add(
formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break;
}
case 2: {
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
list.add(
formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break;
}
case 3: { // aqua
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break;
}
case 4: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break;
}
case 5: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break;
}
case 6: { // dark
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 7: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 8: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 9: { // ordo
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 10: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 11: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
}
case 12: { // fire
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " "
+ localize("tooltip.EMT.output.double.nether"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break;
}
case 13: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " "
+ localize("tooltip.EMT.output.double.nether"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break;
}
case 14: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " "
+ localize("tooltip.EMT.output.double.nether"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break;
}
case 15: { // aer
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break;
}
default: {
@@ -216,43 +409,78 @@ public class ItemBlockSolars extends ItemBlock {
} else if (instance == 1) {
switch (itemstack.getItemDamage()) {
case 0: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break;
}
case 1: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break;
}
case 2: { // terra
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break;
}
case 3: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break;
}
case 4: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
+ localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break;
}
default: {
@@ -263,65 +491,151 @@ public class ItemBlockSolars extends ItemBlock {
} else {
switch (te.aspect) {
case 1:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick")
+ " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * te.output) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
case 2:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + (0.75F * te.output) + " "
+ localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick")
+ " " + localize("tooltip.EMT.night"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break;
case 3:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break;
case 4:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break;
case 5:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick")
+ " " + localize("tooltip.EMT.underwater"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (3F * te.output) + " " + localize("tooltip.EMT.euPerTick")
+ " " + localize("tooltip.EMT.raining"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + (6F * te.output) + " " + localize("tooltip.EMT.euPerTick")
+ " " + localize("tooltip.EMT.thunder"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break;
case 6:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
+ EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " "
+ localize("tooltip.EMT.output.double.nether"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break;
default:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
break;
}
}
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.OutputMax") + " "
+ EMTTextHelper.LIGHT_GRAY + te.calculateMaxVoltAmp()[0] + "EU/t @ " + te.calculateMaxVoltAmp()[1]
+ "A");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.OutputMax")
+ " "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.calculateMaxVoltAmp()[0])
+ "EU/t @ "
+ formatNumbers(te.calculateMaxVoltAmp()[1])
+ "A");
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
}
}
@@ -1,18 +1,16 @@
package emt.item.focus;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.ItemFocusBasic;
@@ -36,20 +34,6 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
this.icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "focus_" + textureName);
}
boolean hasDepth() {
return false;
}
@Override
public int getFocusColor(ItemStack stack) {
return 0;
}
@Override
public boolean isItemTool(ItemStack par1ItemStack) {
return true;
}
@Override
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.rare;
@@ -65,21 +49,10 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
return new AspectList();
}
public boolean isUseItem(ItemStack stack) {
return isVisCostPerTick(stack);
}
public boolean isVisCostPerTick() {
return false;
}
@Override
public ItemStack onFocusRightClick(
ItemStack paramItemStack,
World paramWorld,
EntityPlayer paramEntityPlayer,
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer,
MovingObjectPosition paramMovingObjectPosition) {
if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
if (isVisCostPerTick(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
return paramItemStack;
}
@@ -89,30 +62,9 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
@Override
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "00";
}
@Override
public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
return false;
}
@Override
public int getItemEnchantability() {
return 5;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
AspectList cost = getVisCost(stack);
if (cost != null && cost.size() > 0) {
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
for (Aspect aspect : cost.getAspectsSorted()) {
float amount = cost.getAmount(aspect) / 100.0F;
list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
}
}
}
}
@@ -1,13 +1,17 @@
package emt.item.focus;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
@@ -15,13 +19,8 @@ import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemChargeFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList()
.add(Aspect.FIRE, 10)
.add(Aspect.WATER, 10)
.add(Aspect.AIR, 10)
.add(Aspect.EARTH, 10)
.add(Aspect.ORDER, 10)
.add(Aspect.ENTROPY, 10);
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10)
.add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemChargeFocus() {
super("charge");
@@ -35,41 +34,36 @@ public class ItemChargeFocus extends ItemBaseFocus {
@Override
public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet())
actualCost.add(
e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost;
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
e.getKey(),
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return actualCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "WANDCHARGING";
return "WANDCHARGING" + super.getSortingHelper(itemstack);
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] {FocusUpgradeType.potency, FocusUpgradeType.frugal};
}
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
@Override
public ItemStack onFocusRightClick(
ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
if (!world.isRemote) {
int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
int energyLeft = getChargeRate(itemstack);
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null)
&& (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
player.inventory.armorInventory[i], energyLeft, 4, false, false);
double sentPacket = ElectricItem.manager
.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else {
@@ -80,8 +74,8 @@ public class ItemChargeFocus extends ItemBaseFocus {
if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null)
&& (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
player.inventory.mainInventory[j], energyLeft, 4, false, false);
double sentPacket = ElectricItem.manager
.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else {
@@ -92,4 +86,16 @@ public class ItemChargeFocus extends ItemBaseFocus {
}
return itemstack;
}
private int getChargeRate(ItemStack itemstack) {
return (int) (EMTConfigHandler.chargeFocusProduction
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.once", getChargeRate(stack)));
super.addInformation(stack, player, list, par4);
}
}
@@ -5,14 +5,15 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemChristmasFocus extends ItemBaseFocus {
private static final AspectList visCost =
new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
public ItemChristmasFocus() {
super("christmas");
@@ -30,19 +31,24 @@ public class ItemChristmasFocus extends ItemBaseFocus {
@Override
public String getSortingHelper(ItemStack itemstack) {
return "CHRISTMAS";
return "CHRISTMAS" + super.getSortingHelper(itemstack);
}
@Override
public ItemStack onFocusRightClick(
ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
}
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition mop) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
int x = mop.blockX;
int y = mop.blockY + 1;
int z = mop.blockZ;
if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
if (!world.isRemote) {
EntitySnowman snowman;
snowman = new EntitySnowman(world);
@@ -1,13 +1,18 @@
package emt.item.focus;
import emt.entity.EntityEnergyBall;
import ic2.api.item.ElectricItem;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import emt.entity.EntityEnergyBall;
import ic2.api.item.ElectricItem;
import thaumcraft.api.wands.FocusUpgradeType;
public class ItemEnergyBallFocus extends ItemBaseFocus {
public ItemEnergyBallFocus() {
@@ -21,7 +26,12 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
@Override
public String getSortingHelper(ItemStack itemstack) {
return "ENERGYBALL";
return "ENERGYBALL" + super.getSortingHelper(itemstack);
}
@Override
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
}
@Override
@@ -35,21 +45,34 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
return stack;
}
double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false);
int cost = getCost(stack);
double val = ElectricItem.manager.discharge(armor, cost, 4, true, false, false);
if (val < 5120) {
if (val < cost) {
return stack;
}
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI)
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI))
* 100;
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI))
* 100;
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
return stack;
}
/**
* Base cost of 5120 with a 10% discount per level of frugal.
*/
private int getCost(ItemStack stack) {
return (int) (5120 * (1.0 - (0.1 * getUpgradeLevel(stack, FocusUpgradeType.frugal))));
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.once", getCost(stack)));
this.addFocusInformation(stack, player, list, par4);
}
}
@@ -1,18 +1,19 @@
package emt.item.focus;
import emt.entity.EntityLaser;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import emt.entity.EntityLaser;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemExplosionFocus extends ItemBaseFocus {
private static final AspectList visCost =
new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
public ItemExplosionFocus() {
super("explosion");
@@ -30,15 +31,15 @@ public class ItemExplosionFocus extends ItemBaseFocus {
@Override
public String getSortingHelper(ItemStack itemstack) {
return "EXPLOSION";
return "EXPLOSION" + super.getSortingHelper(itemstack);
}
@Override
public ItemStack onFocusRightClick(
ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
if (!world.isRemote) {
EntityLaser laser;
laser = new EntityLaser(world, player, 1);
@@ -50,14 +51,7 @@ public class ItemExplosionFocus extends ItemBaseFocus {
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] {FocusUpgradeType.potency, FocusUpgradeType.frugal};
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
/**
* Use this method to define custom logic about which upgrades can be applied. This can be used to set up upgrade "trees"
* that make certain upgrades available only when others are unlocked first, when certain research is completed, or similar logic.
*/
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
}
}
@@ -0,0 +1,85 @@
package emt.item.focus;
import static emt.EMT.RESOURCE_PATH;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.implementations.MTEHatchMaintenance;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemMaintenanceFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 2500).add(Aspect.EARTH, 2500)
.add(Aspect.ORDER, 2500);
private static final ResourceLocation focusMaintenanceSound = new ResourceLocation(
RESOURCE_PATH,
"maintenance.MaintenanceWandFocus");
public ItemMaintenanceFocus() {
super("maintenance");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0xC0C0C0;
}
@Override
public AspectList getVisCost(ItemStack focusstack) {
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "MAINTENANCE" + super.getSortingHelper(itemstack);
}
@Override
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
}
@Override
public ItemStack onFocusRightClick(ItemStack itemStack, World world, EntityPlayer player,
MovingObjectPosition mop) {
if (mop == null) return itemStack;
ItemWandCasting wand = (ItemWandCasting) itemStack.getItem();
if (!world.isRemote) {
if (!player.isSneaking()) {
return itemStack;
}
TileEntity hatchCandidateTile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
if (hatchCandidateTile instanceof BaseMetaTileEntity) {
IMetaTileEntity hatchCandidateMetaTile = ((BaseMetaTileEntity) hatchCandidateTile).getMetaTileEntity();
if (hatchCandidateMetaTile instanceof MTEHatchMaintenance) {
MTEHatchMaintenance hatch = (MTEHatchMaintenance) hatchCandidateMetaTile;
if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemStack, player, getVisCost(itemStack), true, false)) {
hatch.mCrowbar = true;
hatch.mScrewdriver = true;
hatch.mHardHammer = true;
hatch.mSolderingTool = true;
hatch.mWrench = true;
hatch.mSoftMallet = true;
hatch.setMaintenanceSound(focusMaintenanceSound, 1.0F, 1.0F);
}
}
}
}
player.swingItem();
return itemStack;
}
}
@@ -1,20 +1,25 @@
package emt.item.focus;
import emt.entity.EntityShield;
import ic2.core.IC2;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import emt.entity.EntityShield;
import ic2.core.IC2;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemShieldFocus extends ItemBaseFocus {
private static final AspectList visCost =
new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.AIR, 5);
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5)
.add(Aspect.AIR, 5);
public ItemShieldFocus() {
super("shield");
@@ -32,34 +37,39 @@ public class ItemShieldFocus extends ItemBaseFocus {
@Override
public String getSortingHelper(ItemStack itemstack) {
return "SHIELD";
return "SHIELD" + super.getSortingHelper(itemstack);
}
@Override
public boolean isUseItem(ItemStack stack) {
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
}
@Override
public boolean isVisCostPerTick(ItemStack stack) {
return true;
}
@Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) {
List<PotionEffect> potionEffects = new ArrayList<>(player.getActivePotionEffects());
for (PotionEffect effect : potionEffects) {
IC2.platform.removePotion(player, effect.getPotionID());
}
if (!player.capabilities.isCreativeMode
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
player.stopUsingItem();
}
}
@Override
public ItemStack onFocusRightClick(
ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition paramMovingObjectPosition) {
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition paramMovingObjectPosition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
player.setItemInUse(itemstack, Integer.MAX_VALUE);
if (!world.isRemote
&& (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) {
if (!world.isRemote && (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false))) {
EntityShield shield = new EntityShield(world, player);
world.spawnEntityInWorld(shield);
}
@@ -1,10 +1,14 @@
package emt.item.focus;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
@@ -12,13 +16,8 @@ import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemWandChargingFocus extends ItemBaseFocus {
AspectList visCost = new AspectList()
.add(Aspect.FIRE, 10)
.add(Aspect.WATER, 10)
.add(Aspect.AIR, 10)
.add(Aspect.EARTH, 10)
.add(Aspect.ORDER, 10)
.add(Aspect.ENTROPY, 10);
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10)
.add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemWandChargingFocus() {
super("chargeWand");
@@ -31,7 +30,7 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
@Override
public String getSortingHelper(ItemStack itemstack) {
return "ELECTRICCHARGING";
return "ELECTRICCHARGING" + super.getSortingHelper(itemstack);
}
@Override
@@ -42,18 +41,14 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
@Override
public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet())
actualCost.add(
e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost;
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
e.getKey(),
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return actualCost;
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] {FocusUpgradeType.potency, FocusUpgradeType.frugal};
}
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
@Override
@@ -61,22 +56,51 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
if (!player.worldObj.isRemote) {
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
if (wandIsFull(itemstack, wandItem)) {
return;
}
ItemStack armor = player.inventory.armorInventory[1];
if (armor != null) {
if ((ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)))) {
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
int cost = getCost(itemstack) / 4;
for (ItemStack stack : player.inventory.armorInventory) {
if (stack == null || ElectricItem.manager.getCharge(stack) < cost) {
return;
}
}
for (ItemStack stack : player.inventory.armorInventory) {
ElectricItem.manager.use(stack, cost, player);
}
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
}
}
private boolean wandIsFull(ItemStack itemstack, ItemWandCasting wandItem) {
int size = wandItem.getMaxVis(itemstack);
for (Aspect a : Aspect.getPrimalAspects()) {
if (wandItem.getVis(itemstack, a) < size) {
return false;
}
}
return true;
}
/**
* Base cost from config with a 10% discount per level of frugal.
*/
private int getCost(ItemStack stack) {
return (int) (EMTConfigHandler.wandChargeFocusCost
* (1.0 - (0.1 * getUpgradeLevel(stack, FocusUpgradeType.frugal))));
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.tick", getCost(stack)));
super.addInformation(stack, player, list, par4);
}
}
@@ -1,11 +1,7 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -16,6 +12,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.blocks.BlockCustomPlant;
import thaumcraft.common.config.ConfigBlocks;
@@ -41,7 +43,7 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -64,17 +66,8 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int par7,
float par8,
float par9,
float par10) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
float par8, float par9, float par10) {
if (stack.hasTagCompound()) {
stack.stackTagCompound.setBoolean("Unbreakable", true);
}
@@ -111,7 +104,12 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
}
if (did) {
world.playSoundEffect(
x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F);
x + 0.5D,
y + 0.5D,
z + 0.5D,
"thaumcraft:wand",
0.75F,
0.9F + world.rand.nextFloat() * 0.2F);
}
}
if (stack.hasTagCompound()) {
@@ -120,9 +118,8 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
return did;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -1,14 +1,7 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@@ -23,6 +16,15 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
private final int hitCost = 5000;
@@ -42,9 +44,8 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/electricthorhammer");
}
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -64,12 +65,12 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
return false;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.electric")
.replace("%player%", player.getCommandSenderName()));
list.add(
EMTTextHelper.localize("tooltip.EMT.hammer.electric")
.replace("%player%", player.getCommandSenderName()));
}
@Override
@@ -1,10 +1,7 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -18,6 +15,11 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable;
public class ItemThorHammer extends ItemSword implements IRepairable {
@@ -44,8 +46,8 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
float f6 = MathHelper.sin(-f1 * 0.01745329F);
float f7 = f4 * f5;
@@ -85,7 +87,7 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
}
}
@@ -1,10 +1,7 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,7 +9,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable;
import thaumcraft.common.entities.projectile.EntityAlumentum;
@@ -54,7 +57,7 @@ public class ItemThorHammerBroken extends ItemSword implements IRepairable {
}
@Override
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List<String> list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.thor"));
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.danger"));
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
@@ -1,16 +1,9 @@
package emt.item.tool.chainsaw;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTorch;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -34,6 +27,15 @@ import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
import net.minecraftforge.event.ForgeEventFactory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
public int maxCharge = 50000;
@@ -56,16 +58,15 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack)
|| Items.diamond_sword.canHarvestBlock(block, stack)
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack)
|| Items.shears.canHarvestBlock(block, stack);
}
@@ -92,7 +93,7 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -105,17 +106,8 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float xOffset,
float yOffset,
float zOffset) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null) {
@@ -198,7 +190,11 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
double yOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double zOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(
player.worldObj, (double) x + xOffset, (double) y + yOffset, (double) z + zOffset, stack);
player.worldObj,
(double) x + xOffset,
(double) y + yOffset,
(double) z + zOffset,
stack);
entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
}
@@ -221,8 +217,8 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
}
if (entity instanceof IShearable) {
IShearable target = (IShearable) entity;
if (target.isShearable(
itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
if (target
.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
ArrayList<ItemStack> drops = target.onSheared(
itemstack,
entity.worldObj,
@@ -274,9 +270,8 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
return EMTConfigHandler.enchanting;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -1,18 +1,20 @@
package emt.item.tool.chainsaw;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import java.awt.*;
import java.awt.Color;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
import thaumcraft.common.lib.utils.BlockUtils;
@@ -20,7 +22,7 @@ import thaumcraft.common.lib.utils.Utils;
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
public static ArrayList oreDictLogs = new ArrayList();
public static ArrayList<?> oreDictLogs = new ArrayList<>();
boolean alternateServer;
boolean alternateClient;
@@ -49,20 +51,10 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
}
@Override
public boolean onItemUse(
ItemStack itemstack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int par7,
float par8,
float par9,
float par10) {
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7,
float par8, float par9, float par10) {
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking())
&& (Utils.isWoodLog(world, x, y, z))
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))
&& ElectricItem.manager.getCharge(itemstack) > cost) {
if (!world.isRemote) {
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
@@ -1,9 +1,5 @@
package emt.item.tool.chainsaw;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -12,6 +8,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
public ItemThaumiumChainsaw() {
@@ -31,8 +32,8 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@@ -1,15 +1,10 @@
package emt.item.tool.drill;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
@@ -26,47 +21,25 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.ForgeEventFactory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.entities.EntityFollowingItem;
import thaumcraft.common.lib.utils.BlockUtils;
public class ItemRockbreakerDrill extends ItemThaumiumDrill {
private static final Block[] isEffective = {
Blocks.nether_brick,
Blocks.netherrack,
Blocks.glowstone,
Blocks.iron_block,
Blocks.gold_block,
Blocks.diamond_block,
Blocks.lapis_block,
Blocks.redstone_block,
Blocks.redstone_ore,
Blocks.emerald_ore,
Blocks.emerald_block,
Blocks.stonebrick,
Blocks.glass,
Blocks.stone,
Blocks.gold_ore,
Blocks.iron_ore,
Blocks.coal_ore,
Blocks.cobblestone,
Blocks.diamond_ore,
Blocks.lapis_ore,
Blocks.dirt,
Blocks.gravel,
Blocks.sand,
Blocks.sandstone,
Blocks.soul_sand,
Blocks.clay,
Blocks.grass,
Blocks.snow_layer,
Blocks.snow,
Blocks.farmland,
Blocks.hardened_clay,
Blocks.stained_hardened_clay,
Blocks.mossy_cobblestone
};
private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone,
Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block,
Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass,
Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore,
Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay,
Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay,
Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
public int searchCost = 1000;
public int hitCost = 400;
int side;
@@ -103,8 +76,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
MovingObjectPosition movingobjectposition =
BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
MovingObjectPosition movingobjectposition = BlockUtils
.getTargetBlock(((Entity) (player)).worldObj, player, true);
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
side = movingobjectposition.sideHit;
}
@@ -112,8 +85,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z,
EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) {
cost = 350;
} else {
@@ -152,7 +125,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
}
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
world.setBlockToAir(x + xx, y + yy, z + zz);
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
ArrayList<ItemStack> ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
boolean creative = false;
if ((entityLiving instanceof EntityPlayer)
&& ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
@@ -162,9 +135,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
continue;
}
ItemStack is;
for (Iterator i$ = ret.iterator();
i$.hasNext();
world.spawnEntityInWorld(new EntityFollowingItem(
for (Iterator<ItemStack> i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(
new EntityFollowingItem(
world,
(double) x + (double) xx + 0.5D,
(double) y + (double) yy + 0.5D,
@@ -172,7 +144,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
is,
entityLiving,
3))) {
is = (ItemStack) i$.next();
is = i$.next();
}
}
}
@@ -181,25 +153,12 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float xOffset,
float yOffset,
float zOffset) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
if (!player.isSneaking()) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null
|| !torchStack
.getUnlocalizedName()
.toLowerCase(Locale.US)
.contains("torch")) {
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
continue;
}
Item item = torchStack.getItem();
@@ -208,8 +167,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
}
int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize;
boolean result =
torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
boolean result = torchStack
.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize;
@@ -233,7 +192,6 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
0.2F + world.rand.nextFloat() * 0.2F);
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
}
Minecraft mc = Minecraft.getMinecraft();
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
player.swingItem();
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
@@ -244,8 +202,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if (!((Entity) (player)).worldObj.isRemote
&& (!(entity instanceof EntityPlayer)
|| MinecraftServer.getServer().isPVPEnabled())) {
&& (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
entity.setFire(2);
}
return super.onLeftClickEntity(stack, player, entity);
@@ -1,12 +1,7 @@
package emt.item.tool.drill;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -19,6 +14,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
public int maxCharge = 100000;
@@ -45,7 +47,7 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -58,8 +60,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) {
cost = 250;
} else {
@@ -113,9 +115,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
return EMTConfigHandler.enchanting;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -1,10 +1,5 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -13,6 +8,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
public ItemOmnitoolDiamond() {
@@ -36,8 +37,8 @@ public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) {
cost = 200;
} else {
@@ -1,13 +1,8 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -23,6 +18,13 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
public int maxCharge = 50000;
@@ -48,7 +50,7 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
@@ -61,8 +63,8 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) {
cost = 100;
} else {
@@ -74,8 +76,7 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_axe.canHarvestBlock(block, stack)
|| Items.iron_sword.canHarvestBlock(block, stack)
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack)
|| Items.iron_pickaxe.canHarvestBlock(block, stack)
|| Items.iron_shovel.canHarvestBlock(block, stack)
|| Items.shears.canHarvestBlock(block, stack);
@@ -107,21 +108,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float xOffset,
float yOffset,
float zOffset) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null
|| !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
continue;
}
Item item = torchStack.getItem();
@@ -165,9 +156,8 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
return EMTConfigHandler.enchanting;
}
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
}
@@ -1,10 +1,5 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -13,6 +8,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
public ItemOmnitoolThaumium() {
@@ -36,8 +37,8 @@ public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
}
@Override
public boolean onBlockDestroyed(
ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) {
cost = 300;
} else {
Loaded 100 of 154 files, more files were not shown because too many files have changed in this diff. Show more