Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef5a92448c | ||
|
|
d21ba33277 | ||
|
|
ab58fc5890 | ||
|
|
6ee77f5da4 | ||
|
|
d798f5df68 | ||
|
|
f3de9f25a5 | ||
|
|
a26415bf6e | ||
|
|
93ba5763f6 | ||
|
|
4f43009e93 |
No files matched your search
@@ -0,0 +1,35 @@
|
||||
* text eol=lf
|
||||
|
||||
*.jar binary
|
||||
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.tif binary
|
||||
*.tiff binary
|
||||
*.ico binary
|
||||
*.svg text
|
||||
*.eps binary
|
||||
|
||||
*.kar binary
|
||||
*.m4a binary
|
||||
*.mid binary
|
||||
*.midi binary
|
||||
*.mp3 binary
|
||||
*.ogg binary
|
||||
*.ra binary
|
||||
|
||||
*.7z binary
|
||||
*.gz binary
|
||||
*.tar binary
|
||||
*.tgz binary
|
||||
*.zip binary
|
||||
|
||||
*.patch -text
|
||||
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
*.ps1 text eol=crlf
|
||||
|
||||
*autogenerated binary
|
||||
@@ -1,13 +1,17 @@
|
||||
//version: 1660899027
|
||||
//version: 1670512927
|
||||
/*
|
||||
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.
|
||||
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates.
|
||||
*/
|
||||
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.matthewprenger.cursegradle.CurseArtifact
|
||||
import com.matthewprenger.cursegradle.CurseRelation
|
||||
import com.modrinth.minotaur.dependencies.ModDependency
|
||||
import com.modrinth.minotaur.dependencies.VersionDependency
|
||||
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
|
||||
@@ -26,6 +30,11 @@ buildscript {
|
||||
name 'forge'
|
||||
url 'https://maven.minecraftforge.net'
|
||||
}
|
||||
maven {
|
||||
// GTNH ForgeGradle Fork
|
||||
name = "GTNH Maven"
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
@@ -34,13 +43,9 @@ buildscript {
|
||||
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'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11'
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
@@ -49,17 +54,22 @@ plugins {
|
||||
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 '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
|
||||
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
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
}
|
||||
verifySettingsGradle()
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
if (settingsupdated)
|
||||
throw new GradleException("Settings has been updated, please re-run task.")
|
||||
|
||||
dependencies {
|
||||
implementation 'com.diffplug:blowdryer:1.6.0'
|
||||
@@ -98,7 +108,7 @@ if (!disableSpotless) {
|
||||
apply from: Blowdryer.file('spotless.gradle')
|
||||
}
|
||||
|
||||
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
||||
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
||||
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
|
||||
}
|
||||
|
||||
@@ -123,65 +133,79 @@ 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'
|
||||
propertyDefaultIfUnset("noPublishedSources", false)
|
||||
propertyDefaultIfUnset("usesMixinDebug", project.usesMixins)
|
||||
propertyDefaultIfUnset("forceEnableMixins", false)
|
||||
propertyDefaultIfUnset("channel", "stable")
|
||||
propertyDefaultIfUnset("mappingsVersion", "12")
|
||||
propertyDefaultIfUnset("modrinthProjectId", "")
|
||||
propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
propertyDefaultIfUnset("curseForgeRelations", "")
|
||||
|
||||
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())) {
|
||||
|
||||
final String modGroupPath = modGroup.toString().replaceAll("\\.", "/")
|
||||
final String apiPackagePath = apiPackage.toString().replaceAll("\\.", "/")
|
||||
|
||||
String targetPackageJava = javaSourceDir + modGroupPath
|
||||
String targetPackageScala = scalaSourceDir + modGroupPath
|
||||
String targetPackageKotlin = kotlinSourceDir + modGroupPath
|
||||
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())) {
|
||||
if (apiPackage) {
|
||||
targetPackageJava = javaSourceDir + modGroupPath + "/" + apiPackagePath
|
||||
targetPackageScala = scalaSourceDir + modGroupPath + "/" + apiPackagePath
|
||||
targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + apiPackagePath
|
||||
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) {
|
||||
if (accessTransformersFile) {
|
||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
||||
if(!getFile(targetFile).exists()) {
|
||||
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!")
|
||||
if (usesMixins.toBoolean()) {
|
||||
if (mixinsPackage.isEmpty()) {
|
||||
throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!")
|
||||
}
|
||||
final String mixinPackagePath = mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
final String mixinPluginPath = mixinPlugin.toString().replaceAll("\\.", "/")
|
||||
|
||||
targetPackageJava = javaSourceDir + modGroupPath + "/" + mixinPackagePath
|
||||
targetPackageScala = scalaSourceDir + modGroupPath + "/" + mixinPackagePath
|
||||
targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPackagePath
|
||||
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)
|
||||
}
|
||||
|
||||
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 (!mixinPlugin.isEmpty()) {
|
||||
String targetFileJava = javaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java"
|
||||
String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPluginPath + ".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())) {
|
||||
if (coreModClass) {
|
||||
final String coreModPath = coreModClass.toString().replaceAll("\\.", "/")
|
||||
String targetFileJava = javaSourceDir + modGroupPath + "/" + coreModPath + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroupPath + "/" + coreModPath + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + coreModPath + ".java"
|
||||
String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + coreModPath + ".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)
|
||||
}
|
||||
}
|
||||
@@ -222,22 +246,21 @@ ext {
|
||||
modVersion = identifiedVersion
|
||||
}
|
||||
|
||||
if(identifiedVersion == versionOverride) {
|
||||
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) {
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
archivesBaseName = modId
|
||||
}
|
||||
|
||||
def arguments = []
|
||||
def jvmArguments = []
|
||||
|
||||
if (usesMixins.toBoolean() || forceEnableMixins) {
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
@@ -256,16 +279,16 @@ minecraft {
|
||||
|
||||
if (replaceGradleTokenInFile) {
|
||||
replaceIn replaceGradleTokenInFile
|
||||
if(gradleTokenModId) {
|
||||
if (gradleTokenModId) {
|
||||
replace gradleTokenModId, modId
|
||||
}
|
||||
if(gradleTokenModName) {
|
||||
if (gradleTokenModName) {
|
||||
replace gradleTokenModName, modName
|
||||
}
|
||||
if(gradleTokenVersion) {
|
||||
if (gradleTokenVersion) {
|
||||
replace gradleTokenVersion, modVersion
|
||||
}
|
||||
if(gradleTokenGroupName) {
|
||||
if (gradleTokenGroupName) {
|
||||
replace gradleTokenGroupName, modGroup
|
||||
}
|
||||
}
|
||||
@@ -274,7 +297,7 @@ minecraft {
|
||||
args(arguments)
|
||||
jvmArgs(jvmArguments)
|
||||
|
||||
if(developmentEnvironmentUserName) {
|
||||
if (developmentEnvironmentUserName) {
|
||||
args("--username", developmentEnvironmentUserName)
|
||||
}
|
||||
}
|
||||
@@ -285,7 +308,7 @@ minecraft {
|
||||
}
|
||||
}
|
||||
|
||||
if(file('addon.gradle').exists()) {
|
||||
if (file('addon.gradle').exists()) {
|
||||
apply from: 'addon.gradle'
|
||||
}
|
||||
|
||||
@@ -302,35 +325,23 @@ repositories {
|
||||
name 'Overmind forge repo mirror'
|
||||
url 'https://gregtech.overminddl1.com/'
|
||||
}
|
||||
if(usesMixins.toBoolean() || forceEnableMixins) {
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
maven {
|
||||
name 'sponge'
|
||||
url 'https://repo.spongepowered.org/repository/maven-public'
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
name = "GTNH Maven"
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
if(usesMixins.toBoolean()) {
|
||||
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')
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.2:processor')
|
||||
}
|
||||
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')
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
compile('com.gtnewhorizon:gtnhmixins:2.1.2')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,13 +353,18 @@ def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
|
||||
|
||||
task generateAssets {
|
||||
if (usesMixins.toBoolean()) {
|
||||
def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json");
|
||||
def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json")
|
||||
if (!mixinConfigFile.exists()) {
|
||||
def mixinPluginLine = ""
|
||||
if(!mixinPlugin.isEmpty()) {
|
||||
// We might not have a mixin plugin if we're using early/late mixins
|
||||
mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """
|
||||
}
|
||||
|
||||
mixinConfigFile.text = """{
|
||||
"required": true,
|
||||
"minVersion": "0.7.11",
|
||||
"package": "${modGroup}.${mixinsPackage}",
|
||||
"plugin": "${modGroup}.${mixinPlugin}",
|
||||
"minVersion": "0.8.5-GTNH",
|
||||
"package": "${modGroup}.${mixinsPackage}",${mixinPluginLine}
|
||||
"refmap": "${mixingConfigRefMap}",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
@@ -396,20 +412,20 @@ jar {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
if (usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
reobf {
|
||||
if(usesMixins.toBoolean() && file(mixinSrg).exists()) {
|
||||
if (usesMixins.toBoolean()) {
|
||||
addExtraSrgFile mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if(usesMixins.toBoolean()) {
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
||||
@@ -424,7 +440,7 @@ afterEvaluate {
|
||||
}
|
||||
|
||||
runClient {
|
||||
if(developmentEnvironmentUserName) {
|
||||
if (developmentEnvironmentUserName) {
|
||||
arguments += [
|
||||
"--username",
|
||||
developmentEnvironmentUserName
|
||||
@@ -465,7 +481,7 @@ processResources {
|
||||
"modName": modName
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
if (usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
}
|
||||
|
||||
@@ -478,31 +494,31 @@ processResources {
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
|
||||
if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
|
||||
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
|
||||
if (accessTransformersFile) {
|
||||
manifestAttributes += ["FMLAT": accessTransformersFile.toString()]
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
if (coreModClass) {
|
||||
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
if (usesMixins.toBoolean()) {
|
||||
manifestAttributes += [
|
||||
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
|
||||
"MixinConfigs" : "mixins." + modId + ".json",
|
||||
"ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean()
|
||||
"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"))
|
||||
from(sourceSets.main.allSource)
|
||||
from(file("$projectDir/LICENSE"))
|
||||
getArchiveClassifier().set('sources')
|
||||
}
|
||||
|
||||
@@ -552,22 +568,22 @@ task devJar(type: Jar) {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
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.allSource) {
|
||||
include modGroupPath + "/" + apiPackagePath + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.output) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
from(sourceSets.main.output) {
|
||||
include modGroupPath + "/" + apiPackagePath + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.resources.srcDirs) {
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include("LICENSE")
|
||||
}
|
||||
|
||||
@@ -575,11 +591,11 @@ task apiJar(type: Jar) {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
if(!noPublishedSources) {
|
||||
if (!noPublishedSources) {
|
||||
archives sourcesJar
|
||||
}
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
if (apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
@@ -597,10 +613,10 @@ publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
if (usesShadowedDependencies.toBoolean()) {
|
||||
artifact source: shadowJar, classifier: ""
|
||||
}
|
||||
if(!noPublishedSources) {
|
||||
if (!noPublishedSources) {
|
||||
artifact source: sourcesJar, classifier: "sources"
|
||||
}
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
|
||||
@@ -615,7 +631,7 @@ publishing {
|
||||
|
||||
// remove extra garbage from minecraft and minecraftDeps configuration
|
||||
pom.withXml {
|
||||
def badArtifacts = [:].withDefault {[] as Set<String>}
|
||||
def badArtifacts = [:].withDefault { [] as Set<String> }
|
||||
for (configuration in [
|
||||
projectConfigs.minecraft,
|
||||
projectConfigs.minecraftDeps
|
||||
@@ -648,6 +664,124 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) {
|
||||
apply plugin: 'com.modrinth.minotaur'
|
||||
|
||||
File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md")
|
||||
|
||||
modrinth {
|
||||
token = System.getenv("MODRINTH_TOKEN")
|
||||
projectId = modrinthProjectId
|
||||
versionNumber = identifiedVersion
|
||||
versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release"
|
||||
changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : ""
|
||||
uploadFile = jar
|
||||
additionalFiles = getSecondaryArtifacts()
|
||||
gameVersions = [minecraftVersion]
|
||||
loaders = ["forge"]
|
||||
debugMode = false
|
||||
}
|
||||
|
||||
if (modrinthRelations.size() != 0) {
|
||||
String[] deps = modrinthRelations.split(";")
|
||||
deps.each { dep ->
|
||||
if (dep.size() == 0) {
|
||||
return
|
||||
}
|
||||
String[] parts = dep.split(":")
|
||||
String[] qual = parts[0].split("-")
|
||||
addModrinthDep(qual[0], qual[1], parts[1])
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addModrinthDep("required", "version", "gtnhmixins")
|
||||
}
|
||||
tasks.modrinth.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.modrinth)
|
||||
}
|
||||
|
||||
if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null) {
|
||||
apply plugin: 'com.matthewprenger.cursegradle'
|
||||
|
||||
File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md")
|
||||
|
||||
curseforge {
|
||||
apiKey = System.getenv("CURSEFORGE_TOKEN")
|
||||
project {
|
||||
id = curseForgeProjectId
|
||||
if (changelogFile.exists()) {
|
||||
changelogType = "markdown"
|
||||
changelog = changelogFile
|
||||
}
|
||||
releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release"
|
||||
addGameVersion minecraftVersion
|
||||
addGameVersion "Forge"
|
||||
mainArtifact jar
|
||||
for (artifact in getSecondaryArtifacts()) addArtifact artifact
|
||||
}
|
||||
|
||||
options {
|
||||
javaIntegration = false
|
||||
forgeGradleIntegration = false
|
||||
debug = false
|
||||
}
|
||||
}
|
||||
|
||||
if (curseForgeRelations.size() != 0) {
|
||||
String[] deps = curseForgeRelations.split(";")
|
||||
deps.each { dep ->
|
||||
if (dep.size() == 0) {
|
||||
return
|
||||
}
|
||||
String[] parts = dep.split(":")
|
||||
addCurseForgeRelation(parts[0], parts[1])
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
addCurseForgeRelation("requiredDependency", "gtnhmixins")
|
||||
}
|
||||
tasks.curseforge.dependsOn(build)
|
||||
tasks.publish.dependsOn(tasks.curseforge)
|
||||
}
|
||||
|
||||
def addModrinthDep(scope, type, name) {
|
||||
com.modrinth.minotaur.dependencies.Dependency dep;
|
||||
if (!(scope in [
|
||||
"required",
|
||||
"optional",
|
||||
"incompatible",
|
||||
"embedded"
|
||||
])) {
|
||||
throw new Exception("Invalid modrinth dependency scope: " + scope)
|
||||
}
|
||||
switch (type) {
|
||||
case "project":
|
||||
dep = new ModDependency(name, scope)
|
||||
break
|
||||
case "version":
|
||||
dep = new VersionDependency(name, scope)
|
||||
break
|
||||
default:
|
||||
throw new Exception("Invalid modrinth dependency type: " + type)
|
||||
}
|
||||
project.modrinth.dependencies.add(dep)
|
||||
}
|
||||
|
||||
def addCurseForgeRelation(type, name) {
|
||||
if (!(type in [
|
||||
"requiredDependency",
|
||||
"embeddedLibrary",
|
||||
"optionalDependency",
|
||||
"tool",
|
||||
"incompatible"
|
||||
])) {
|
||||
throw new Exception("Invalid CurseForge relation type: " + type)
|
||||
}
|
||||
CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact
|
||||
CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation()))
|
||||
rel."$type"(name)
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
@@ -666,20 +800,40 @@ if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAv
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle")
|
||||
}
|
||||
|
||||
static URL exampleSettingsGradleUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/settings.gradle.example")
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/settings.gradle.example")
|
||||
}
|
||||
|
||||
static URL exampleGitAttributesUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/.gitattributes")
|
||||
}
|
||||
|
||||
|
||||
def verifySettingsGradle() {
|
||||
boolean verifyGitAttributes() {
|
||||
def gitattributesFile = getFile(".gitattributes")
|
||||
if (!gitattributesFile.exists()) {
|
||||
println("Downloading default .gitattributes")
|
||||
exampleGitAttributesUrl().withInputStream { i -> gitattributesFile.withOutputStream { it << i } }
|
||||
exec {
|
||||
workingDir '.'
|
||||
commandLine 'git', 'add', '--renormalize', '.'
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
boolean 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.")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
boolean performBuildScriptUpdate(String projectDir) {
|
||||
@@ -687,7 +841,10 @@ boolean performBuildScriptUpdate(String 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()
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
if (settingsupdated)
|
||||
throw new GradleException("Settings has been updated, please re-run task.")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -707,7 +864,7 @@ boolean isNewBuildScriptVersionAvailable(String projectDir) {
|
||||
|
||||
static String getVersionHash(String buildScriptContent) {
|
||||
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
|
||||
if(versionLine != null) {
|
||||
if (versionLine != null) {
|
||||
return versionLine.split(": ").last()
|
||||
}
|
||||
return ""
|
||||
@@ -733,16 +890,16 @@ task deobfParams {
|
||||
overwrite false
|
||||
}
|
||||
|
||||
if(!file(paramsCSV).exists()) {
|
||||
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 ->
|
||||
Files.lines(Paths.get(paramsCSV)).forEach { line ->
|
||||
String[] cells = line.split(",")
|
||||
if(cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) {
|
||||
if (cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) {
|
||||
params.put(cells[0], cells[1])
|
||||
}
|
||||
}
|
||||
@@ -755,8 +912,8 @@ task deobfParams {
|
||||
static int replaceParams(File file, Map<String, String> params) {
|
||||
int fileCount = 0
|
||||
|
||||
if(file.isDirectory()) {
|
||||
for(File f : file.listFiles()) {
|
||||
if (file.isDirectory()) {
|
||||
for (File f : file.listFiles()) {
|
||||
fileCount += replaceParams(f, params)
|
||||
}
|
||||
return fileCount
|
||||
@@ -765,14 +922,14 @@ println("Visiting ${file.getName()} ...")
|
||||
try {
|
||||
String content = new String(Files.readAllBytes(file.toPath()))
|
||||
int hash = content.hashCode()
|
||||
params.forEach{key, value ->
|
||||
params.forEach { key, value ->
|
||||
content = content.replaceAll(key, value)
|
||||
}
|
||||
if(hash != content.hashCode()) {
|
||||
if (hash != content.hashCode()) {
|
||||
Files.write(file.toPath(), content.getBytes("UTF-8"))
|
||||
return 1
|
||||
}
|
||||
} catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return 0
|
||||
@@ -823,16 +980,16 @@ try {
|
||||
|
||||
//get rid of directories:
|
||||
int lastSlash = fileName.lastIndexOf("/")
|
||||
if(lastSlash > 0) {
|
||||
if (lastSlash > 0) {
|
||||
fileName = fileName.substring(lastSlash + 1)
|
||||
}
|
||||
//get rid of extension:
|
||||
if(fileName.endsWith(".jar") || fileName.endsWith(".litemod")) {
|
||||
if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) {
|
||||
fileName = fileName.substring(0, fileName.lastIndexOf("."))
|
||||
}
|
||||
|
||||
String hostName = url.getHost()
|
||||
if(hostName.startsWith("www.")) {
|
||||
if (hostName.startsWith("www.")) {
|
||||
hostName = hostName.substring(4)
|
||||
}
|
||||
List parts = Arrays.asList(hostName.split("\\."))
|
||||
@@ -840,7 +997,7 @@ try {
|
||||
hostName = String.join(".", parts)
|
||||
|
||||
return deobf(sourceURL, "$hostName/$fileName")
|
||||
} catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
return deobf(sourceURL, "deobf/${sourceURL.hashCode()}")
|
||||
}
|
||||
}
|
||||
@@ -855,13 +1012,13 @@ 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()) {
|
||||
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) {
|
||||
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"
|
||||
|
||||
@@ -897,7 +1054,7 @@ return files(deobfFile)
|
||||
|
||||
def zipMappings(String zipPath, String url, String bon2Dir) {
|
||||
File zipFile = new File(zipPath)
|
||||
if(zipFile.exists()) {
|
||||
if (zipFile.exists()) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -937,6 +1094,21 @@ if (!project.hasProperty(propertyName)) {
|
||||
}
|
||||
}
|
||||
|
||||
def propertyDefaultIfUnset(String propertyName, defaultValue) {
|
||||
if (!project.hasProperty(propertyName) || project.property(propertyName) == "") {
|
||||
project.ext.setProperty(propertyName, defaultValue)
|
||||
}
|
||||
}
|
||||
|
||||
def getFile(String relativePath) {
|
||||
return new File(projectDir, relativePath)
|
||||
}
|
||||
|
||||
def getSecondaryArtifacts() {
|
||||
// Because noPublishedSources from the beginning of the script is somehow not visible here...
|
||||
boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
||||
def secondaryArtifacts = [devJar]
|
||||
if (!noPublishedSources) secondaryArtifacts += [sourcesJar]
|
||||
if (apiPackage) secondaryArtifacts += [apiJar]
|
||||
return secondaryArtifacts
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.41.01:dev'
|
||||
compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.41.161:dev'
|
||||
compile 'com.github.GTNewHorizons:Baubles:1.0.1.14:dev'
|
||||
|
||||
compile 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
|
||||
|
||||
@@ -82,7 +82,6 @@ public class EMT {
|
||||
}
|
||||
EMTDungeonChestGenerator.generateLoot();
|
||||
EMTEntities.registerEMTEntities();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
|
||||
NEI_Config.Init();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.block;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
@@ -45,6 +46,7 @@ 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) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
@@ -60,6 +62,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,6 +78,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
}
|
||||
}
|
||||
|
||||
@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()) {
|
||||
@@ -85,7 +89,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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.block;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
@@ -78,10 +79,11 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
@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);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.block;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
@@ -145,7 +146,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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ 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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -47,21 +47,15 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,18 +140,22 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFluidInputAllowed(FluidStack aFluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class EMT_GT_Loader implements Runnable {
|
||||
|
||||
public static final int TIERS = GT_Values.VN.length;
|
||||
public static int aIDoffset = 13000 - TIERS - 1;
|
||||
public static final int TIERS = GT_Values.VN.length - 1;
|
||||
public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
|
||||
public static ItemStack[] EHatch = new ItemStack[TIERS];
|
||||
public static ItemStack LEG;
|
||||
public static ItemStack DECC;
|
||||
@@ -41,7 +41,8 @@ public class EMT_GT_Loader implements Runnable {
|
||||
.getStackForm(1L);
|
||||
}
|
||||
|
||||
LEG = new EMT_Large_Essentia_Gen(aIDoffset + TIERS + 1, "Large Essentia Generator", "Large Essentia Generator")
|
||||
LEG = new EMT_Large_Essentia_Gen(
|
||||
aIDoffset + GT_Values.VN.length + 1, "Large Essentia Generator", "Large Essentia Generator")
|
||||
.getStackForm(1L);
|
||||
|
||||
// Dragonblood recipe for magics haters
|
||||
@@ -200,7 +201,7 @@ public class EMT_GT_Loader implements Runnable {
|
||||
}
|
||||
|
||||
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(
|
||||
aIDoffset + TIERS + 2, "Research Completer", "Research Completer")
|
||||
aIDoffset + GT_Values.VN.length + 2, "Research Completer", "Research Completer")
|
||||
.getStackForm(1L);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ 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.client.gui.EMT_UITextures;
|
||||
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;
|
||||
@@ -18,21 +21,22 @@ 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/Default",
|
||||
6,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
"Tier Casing: ",
|
||||
1,
|
||||
E,
|
||||
false,
|
||||
false);
|
||||
new HashSet<>(16),
|
||||
"emt.recipe.fusioncrafting",
|
||||
"Draconic Evolution Fusion Crafter",
|
||||
null,
|
||||
RES_PATH_GUI + "basicmachines/FusionCrafter",
|
||||
9,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
"Tier Casing: ",
|
||||
1,
|
||||
E,
|
||||
false,
|
||||
false)
|
||||
.setSlotOverlay(false, false, EMT_UITextures.OVERLAY_SLOT_FUSION_CRAFTING);
|
||||
|
||||
public static void addFusionCraftingRecipe(
|
||||
ItemStack[] inputs,
|
||||
@@ -86,55 +90,79 @@ public class EMT_RecipeAdder {
|
||||
|
||||
// CORES
|
||||
|
||||
addFusionCraftingRecipe(
|
||||
addFusionCraftingRecipeNonOptimized(
|
||||
new ItemStack[] {
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmiridium, 4),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Ichorium, 1),
|
||||
GT_OreDictUnificator.get(OrePrefixes.gem, Materials.EnderEye, 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,
|
||||
30720,
|
||||
500000,
|
||||
1);
|
||||
|
||||
addFusionCraftingRecipe(
|
||||
addFusionCraftingRecipeNonOptimized(
|
||||
new ItemStack[] {
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 6),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4),
|
||||
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 4, 0),
|
||||
GT_OreDictUnificator.get(OrePrefixes.gem, Materials.NetherStar, 1),
|
||||
new ItemStack(EMTItems.itemEMTItems, 0, 17)
|
||||
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,
|
||||
65536,
|
||||
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);
|
||||
}
|
||||
|
||||
addFusionCraftingRecipe(
|
||||
addFusionCraftingRecipeNonOptimized(
|
||||
new ItemStack[] {
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 8),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 4),
|
||||
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 4, 0),
|
||||
GT_ModHandler.getModItem("dreamcraft", "ManyullynCrystal", 1, 0),
|
||||
new ItemStack(EMTItems.itemEMTItems, 0, 18)
|
||||
},
|
||||
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 1, 0),
|
||||
1600,
|
||||
122880,
|
||||
3);
|
||||
|
||||
addFusionCraftingRecipe(
|
||||
new ItemStack[] {
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 12),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 6),
|
||||
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", "chaosShard", 1, 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,
|
||||
500000,
|
||||
24000000,
|
||||
4);
|
||||
|
||||
// ENERGY CORES
|
||||
@@ -142,14 +170,14 @@ public class EMT_RecipeAdder {
|
||||
addFusionCraftingRecipe(
|
||||
new ItemStack[] {
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.RedstoneAlloy, 4),
|
||||
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,
|
||||
65536,
|
||||
500000,
|
||||
2);
|
||||
|
||||
addFusionCraftingRecipe(
|
||||
@@ -162,7 +190,7 @@ public class EMT_RecipeAdder {
|
||||
},
|
||||
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 1, 1),
|
||||
2000,
|
||||
122880,
|
||||
2000000,
|
||||
3);
|
||||
|
||||
// Dragon Blood
|
||||
|
||||
@@ -14,11 +14,8 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
@@ -107,6 +104,15 @@ public class ItemMaterials extends Item {
|
||||
return "item." + EMT.MOD_ID + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean advanced) {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 16:
|
||||
result.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.EMT.draconicSchematic"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package emt.item.block;
|
||||
|
||||
import static emt.util.EMTTextHelper.localize;
|
||||
import static gregtech.api.util.GT_Utility.formatNumbers;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.block.BlockBaseContainer;
|
||||
@@ -52,121 +53,147 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
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 + " "
|
||||
+ EMTTextHelper.LIGHT_GRAY + formatNumbers(EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ 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 + (3F * EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ 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 + (6F * EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ 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 + " "
|
||||
+ EMTTextHelper.LIGHT_GRAY + formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||
+ " "
|
||||
+ localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
|
||||
+ 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 + (3F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
|
||||
+ 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 + (6F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
|
||||
+ 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 + " "
|
||||
+ EMTTextHelper.LIGHT_GRAY + formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||
+ " "
|
||||
+ localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
|
||||
+ 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 + (3F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
|
||||
+ 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 + (6F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
|
||||
+ 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) + " "
|
||||
+ 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 + (2F * EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ 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)
|
||||
+ 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 + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " "
|
||||
+ 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)
|
||||
+ 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 + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " "
|
||||
+ 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) + " "
|
||||
+ 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 + (0.75F * EMTConfigHandler.compressedSolarOutput) + " "
|
||||
+ 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) + " "
|
||||
+ 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 + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||
+ 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) + " "
|
||||
+ 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 + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||
+ 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 + " "
|
||||
+ 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") + " "
|
||||
@@ -178,7 +205,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 13: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
|
||||
+ 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") + " "
|
||||
@@ -190,7 +218,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 14: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
|
||||
+ 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") + " "
|
||||
@@ -202,7 +231,7 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 15: { // aer
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -217,7 +246,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -225,7 +255,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -233,7 +264,7 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 2: { // terra
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -241,7 +272,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -249,7 +281,8 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " "
|
||||
+ 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"));
|
||||
@@ -264,48 +297,57 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
switch (te.aspect) {
|
||||
case 1:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick")
|
||||
+ 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 + (0.75F * te.output) + " "
|
||||
+ 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) + " "
|
||||
+ 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 + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick")
|
||||
+ 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"));
|
||||
+ 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"));
|
||||
+ 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"));
|
||||
+ EMTTextHelper.LIGHT_GRAY + formatNumbers(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")
|
||||
+ 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 + (3F * te.output) + " " + localize("tooltip.EMT.euPerTick")
|
||||
+ 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 + (6F * te.output) + " " + localize("tooltip.EMT.euPerTick")
|
||||
+ 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"));
|
||||
+ 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"));
|
||||
@@ -315,12 +357,14 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
break;
|
||||
default:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": "
|
||||
+ EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick"));
|
||||
+ 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]
|
||||
+ EMTTextHelper.LIGHT_GRAY + formatNumbers(te.calculateMaxVoltAmp()[0]) + "EU/t @ "
|
||||
+ formatNumbers(te.calculateMaxVoltAmp()[1])
|
||||
+ "A");
|
||||
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
|
||||
}
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
package emt.proxy;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import emt.client.gui.GuiEtherealMacerator;
|
||||
import emt.client.gui.GuiGenerator;
|
||||
import emt.client.gui.GuiIndustrialWandRecharger;
|
||||
import emt.client.gui.GuiSolar;
|
||||
import emt.client.gui.container.ConainerGenerator;
|
||||
import emt.client.gui.container.ContainerEtheralMacerator;
|
||||
import emt.client.gui.container.ContainerIndustrialWandRecharge;
|
||||
import emt.client.gui.container.ContainerSolars;
|
||||
import emt.tile.TileEntityEtherealMacerator;
|
||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
public class CommonProxy {
|
||||
|
||||
public void load() {
|
||||
registerRenders();
|
||||
@@ -26,49 +9,4 @@ public class CommonProxy implements IGuiHandler {
|
||||
public void registerRenders() {
|
||||
/* Empty in base proxy */
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
|
||||
switch (ID) {
|
||||
case 0:
|
||||
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
|
||||
return new ContainerIndustrialWandRecharge(
|
||||
player.inventory, (TileEntityIndustrialWandRecharge) entity);
|
||||
}
|
||||
case 1:
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
|
||||
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
} else if (entity != null && entity instanceof TileEntityBaseGenerator) {
|
||||
return new ConainerGenerator(player.inventory, (TileEntityBaseGenerator) entity);
|
||||
} else if (entity != null && entity instanceof TileEntitySolarBase) {
|
||||
return new ContainerSolars(player.inventory, (TileEntitySolarBase) entity);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
|
||||
switch (ID) {
|
||||
case 0:
|
||||
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
|
||||
return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity);
|
||||
}
|
||||
case 1:
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
|
||||
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
} else if (entity != null && entity instanceof TileEntityBaseGenerator) {
|
||||
return new GuiGenerator(player.inventory, (TileEntityBaseGenerator) entity);
|
||||
} else if (entity != null && entity instanceof TileEntitySolarBase) {
|
||||
return new GuiSolar(player.inventory, (TileEntitySolarBase) entity);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,17 @@
|
||||
package emt.tile;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.forge.InvWrapper;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
|
||||
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
|
||||
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
|
||||
import com.gtnewhorizons.modularui.common.widget.TextWidget;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.gui.modularui.GT_UITextures;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@@ -12,7 +22,8 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class TileEntityEtherealMacerator extends TileEntityEMT implements ISidedInventory, IWrenchable {
|
||||
public class TileEntityEtherealMacerator extends TileEntityEMT
|
||||
implements ISidedInventory, IWrenchable, ITileWithModularUI {
|
||||
|
||||
private static final int[] slots_top = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {2, 1};
|
||||
@@ -21,14 +32,17 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
public int cookTime;
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack;
|
||||
@@ -51,6 +65,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
@@ -61,6 +76,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
|
||||
@@ -69,14 +85,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
}
|
||||
}
|
||||
|
||||
public String getInvName() {
|
||||
return "Ethereal Processor";
|
||||
}
|
||||
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
NBTTagList nbttaglist = tagCompound.getTagList("Items", 10);
|
||||
@@ -93,6 +102,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
this.cookTime = tagCompound.getShort("CookTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
@@ -109,12 +119,14 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
tagCompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (this.canSmelt() && !isOverLimit(1) && !isOverLimit(2) && isAllowed()) {
|
||||
if (this.canSmelt() && !isOverLimit(1) && !isOverLimit(2) && isAllowed(this.slots[0])) {
|
||||
++this.cookTime;
|
||||
this.isOn = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
@@ -177,6 +189,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this
|
||||
? false
|
||||
@@ -185,10 +198,6 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
<= 64.0D;
|
||||
}
|
||||
|
||||
public void openChest() {}
|
||||
|
||||
public void closeChest() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot != 0) return false;
|
||||
@@ -196,14 +205,17 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int par1) {
|
||||
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return this.isItemValidForSlot(par1, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return true;
|
||||
}
|
||||
@@ -218,9 +230,9 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAllowed() {
|
||||
|
||||
int[] oreDictIDs = OreDictionary.getOreIDs(this.slots[0]);
|
||||
public boolean isAllowed(ItemStack stack) {
|
||||
if (stack == null) return false;
|
||||
int[] oreDictIDs = OreDictionary.getOreIDs(stack);
|
||||
for (int oreDictID : oreDictIDs) {
|
||||
String tName = OreDictionary.getOreName(oreDictID);
|
||||
for (String allowed : EMTConfigHandler.etherealMaceratorWhiteList) {
|
||||
@@ -273,4 +285,30 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public ModularWindow createWindow(UIBuildContext buildContext) {
|
||||
ModularWindow.Builder builder = ModularWindow.builder(176, 166);
|
||||
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
|
||||
builder.bindPlayerInventory(buildContext.getPlayer());
|
||||
InvWrapper invWrapper = new InvWrapper(this);
|
||||
|
||||
builder.widget(new SlotWidget(invWrapper, 0)
|
||||
.setFilter(stack ->
|
||||
isAllowed(stack) && FurnaceRecipes.smelting().getSmeltingResult(stack) != null)
|
||||
.setPos(55, 25))
|
||||
.widget(new SlotWidget(invWrapper, 2)
|
||||
.setAccess(true, false)
|
||||
.setBackground(ModularUITextures.ITEM_SLOT.withFixedSize(26, 26, -4, -4))
|
||||
.setPos(115, 25))
|
||||
.widget(new SlotWidget(invWrapper, 1).setAccess(true, false).setPos(115, 52))
|
||||
.widget(new ProgressBar()
|
||||
.setTexture(GT_UITextures.PROGRESSBAR_MACERATE, 20)
|
||||
.setProgress(() -> (float) cookTime / maceratingSpeed)
|
||||
.setPos(81, 36)
|
||||
.setSize(20, 18))
|
||||
.widget(new TextWidget(EMTTextHelper.localize("gui.EMT.etherealMacerator.title")).setPos(6, 6));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,75 @@
|
||||
package emt.tile;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.forge.InvWrapper;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
|
||||
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
|
||||
import com.gtnewhorizons.modularui.common.widget.TextWidget;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.client.gui.EMT_UITextures;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.energy.prefab.BasicSink;
|
||||
import emt.util.EMTTextHelper;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements IInventory, IWrenchable {
|
||||
public class TileEntityIndustrialWandRecharge extends TileEntityEMT
|
||||
implements IInventory, IWrenchable, IEnergySink, ITileWithModularUI {
|
||||
private static final int capacity = 1000000;
|
||||
private static final int tier = 4;
|
||||
private double energyStored = 0;
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDemandedEnergy() {
|
||||
return Math.max(0.0D, (double) capacity - this.energyStored);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) {
|
||||
if (this.getDemandedEnergy() > 0) {
|
||||
this.energyStored += amount;
|
||||
return 0.0D;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSinkTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
private boolean canUseEnergy(double amount) {
|
||||
return this.energyStored >= amount;
|
||||
}
|
||||
|
||||
private boolean useEnergy(double amount) {
|
||||
if (this.canUseEnergy(amount)
|
||||
&& !FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
this.energyStored -= amount;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack ItemStacks[];
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
|
||||
public TileEntityIndustrialWandRecharge() {
|
||||
ItemStacks = new ItemStack[1];
|
||||
@@ -66,23 +120,21 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (getStackInSlot(0) != null) {
|
||||
if (this.worldObj.isRemote || getStackInSlot(0) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
if (ic2EnergySink.useEnergy(EMTConfigHandler.wandChargerConsumption)
|
||||
&& wandItem.getAspectsWithRoom(wand) != null) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
AspectList aspects = wandItem.getAspectsWithRoom((wand));
|
||||
if (aspects != null && aspects.size() != 0 && this.useEnergy(EMTConfigHandler.wandChargerConsumption)) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -97,6 +149,7 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
@@ -110,8 +163,13 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.energyStored == 0) {
|
||||
this.energyStored = p_145839_1_.getDouble("Energy");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
@@ -126,6 +184,7 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
}
|
||||
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
p_145841_1_.setDouble("Energy", this.energyStored);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,17 +206,6 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
@@ -201,4 +249,18 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements I
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtMachines, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModularWindow createWindow(UIBuildContext buildContext) {
|
||||
ModularWindow.Builder builder = ModularWindow.builder(176, 166);
|
||||
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
|
||||
builder.bindPlayerInventory(buildContext.getPlayer());
|
||||
|
||||
builder.widget(new SlotWidget(new InvWrapper(this), 0)
|
||||
.setBackground(ModularUITextures.ITEM_SLOT, EMT_UITextures.OVERLAY_SLOT_WAND)
|
||||
.setPos(79, 34))
|
||||
.widget(new TextWidget(EMTTextHelper.localize("gui.EMT.wandRecharge.title")).setPos(6, 6));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,20 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.drawable.Text;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
|
||||
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
|
||||
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
|
||||
import com.gtnewhorizons.modularui.common.widget.TextWidget;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import emt.client.gui.EMT_UITextures;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
import gregtech.api.interfaces.tileentity.IEnergyConnected;
|
||||
@@ -34,7 +44,8 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
IEssentiaTransport,
|
||||
IHasWorldObjectAndCoords,
|
||||
IEnergyConnected,
|
||||
IBasicEnergyContainer {
|
||||
IBasicEnergyContainer,
|
||||
ITileWithModularUI {
|
||||
public DefinitelyNotAIC2Source energySource = new DefinitelyNotAIC2Source(this, 100000L, 2);
|
||||
public Aspect aspect;
|
||||
public double generating;
|
||||
@@ -86,6 +97,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
this.color = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
this.side = !this.worldObj.isRemote;
|
||||
this.dead = false;
|
||||
@@ -158,6 +170,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return StatCollector.translateToLocal("tile.EMT.essentia." + this.aspect.getTag() + ".name");
|
||||
}
|
||||
@@ -188,6 +201,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
this.energySource.setEnergyStored(tag.getLong("estore"));
|
||||
@@ -200,6 +214,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
tag.setInteger("fuel", this.fuel);
|
||||
@@ -207,38 +222,48 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
if (aspect != null) tag.setString("aspect", this.aspect.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
public int gaugeEnergyScaled(int i) {
|
||||
@@ -249,20 +274,25 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return this.fuel * i / this.maxfuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack Stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return new AspectList().add(this.aspect, this.fuel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAspects(AspectList aspects) {}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect tag) {
|
||||
return tag.equals(this.aspect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addToContainer(Aspect tag, int amount) {
|
||||
if ((!tag.equals(this.aspect)) || (amount < 0)) {
|
||||
return amount;
|
||||
@@ -275,52 +305,65 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return amount - (this.maxfuel - this.fuel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect tag, int amount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(AspectList ot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect tag, int amount) {
|
||||
return (tag.equals(this.aspect)) && (amount <= this.fuel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContain(AspectList ot) {
|
||||
return ot.aspects.containsKey(this.aspect) && ot.aspects.get(this.aspect) == this.fuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int containerContains(Aspect tag) {
|
||||
return tag == this.aspect ? this.fuel : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection face) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuction(Aspect aspect, int amount) {}
|
||||
|
||||
@Override
|
||||
public Aspect getSuctionType(ForgeDirection face) {
|
||||
return this.aspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection face) {
|
||||
return this.fuel == this.maxfuel ? 0 : 128;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int takeEssentia(Aspect aspect, int amount, ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int amount, ForgeDirection face) {
|
||||
if (amount < this.maxfuel - this.fuel) {
|
||||
return amount;
|
||||
@@ -328,18 +371,22 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return this.maxfuel - addToContainer(aspect, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Aspect getEssentiaType(ForgeDirection face) {
|
||||
return this.aspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection face) {
|
||||
return this.fuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumSuction() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderExtendedTube() {
|
||||
return true;
|
||||
}
|
||||
@@ -353,27 +400,33 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getColorization() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte setColorization(byte aColor) {
|
||||
this.color = aColor;
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUniversalEnergyStored(long aEnergyAmount) {
|
||||
return aEnergyAmount < this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUniversalEnergyStored() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUniversalEnergyCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputAmperage() {
|
||||
if (this.generating / 20.0D / 20.0D <= GT_Values.V[this.energySource.getSourceTier()]) {
|
||||
return 1L;
|
||||
@@ -384,18 +437,22 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return (long) (1L + (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputVoltage() {
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInputAmperage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInputVoltage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
|
||||
if (this.energySource.getEnergyStored() > aEnergy) {
|
||||
this.energySource.drawEnergy(aEnergy);
|
||||
@@ -405,51 +462,63 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return decreaseStoredEnergyUnits(
|
||||
aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAverageElectricInput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAverageElectricOutput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStoredEU() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEUCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStoredSteam() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSteamCapacity() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(byte aSide) {
|
||||
return true;
|
||||
}
|
||||
@@ -458,42 +527,52 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return this.worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXCoord() {
|
||||
return this.xCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getYCoord() {
|
||||
return (short) this.yCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZCoord() {
|
||||
return this.zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isServerSide() {
|
||||
return !worldObj.isRemote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClientSide() {
|
||||
return worldObj.isRemote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRandomNumber(int aRange) {
|
||||
return this.worldObj.rand.nextInt(aRange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
@@ -504,6 +583,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return this.worldObj.getTileEntity(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getTileEntityAtSide(aSide);
|
||||
@@ -511,38 +591,47 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventory(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainer(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {
|
||||
TileEntity tTileEntity = getTileEntity(aX, aY, aZ);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -551,10 +640,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(aSide);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -563,6 +654,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -571,14 +663,17 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockOffset(int aX, int aY, int aZ) {
|
||||
return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
@@ -589,6 +684,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return this.worldObj.getBlock(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getBlockAtSide(aSide);
|
||||
@@ -596,14 +692,17 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaID(int aX, int aY, int aZ) {
|
||||
return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDAtSide(byte aSide) {
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
@@ -611,6 +710,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getMetaIDAtSide(aSide);
|
||||
@@ -618,38 +718,47 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevel(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelOffset(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSide(byte aSide) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacity(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityOffset(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSky(int aX, int aY, int aZ) {
|
||||
boolean sky = true;
|
||||
do {
|
||||
@@ -660,58 +769,72 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
return sky;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyOffset(int aX, int aY, int aZ) {
|
||||
return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAir(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirOffset(int aX, int aY, int aZ) {
|
||||
return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSide(byte aSide) {
|
||||
return getAirAtSideAndDistance(aSide, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome(int aX, int aZ) {
|
||||
return this.worldObj.getBiomeGenForCoords(aX, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetX(byte aSide, int aMultiplier) {
|
||||
return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getOffsetY(byte aSide, int aMultiplier) {
|
||||
return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetZ(byte aSide, int aMultiplier) {
|
||||
return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDead() {
|
||||
return this.dead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBlockEvent(byte aID, byte aValue) {
|
||||
GT_Values.NW.sendPacketToAllPlayersInRange(
|
||||
this.worldObj,
|
||||
@@ -720,29 +843,75 @@ public class TileEntityBaseGenerator extends TileEntityEMT
|
||||
this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimer() {
|
||||
return this.timer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLightValue(byte aLightValue) {}
|
||||
|
||||
@Override
|
||||
public boolean isInvalidTileEntity() {
|
||||
return this.tileEntityInvalid;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer, int aID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(byte b, boolean b1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(byte b, boolean b1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModularWindow createWindow(UIBuildContext buildContext) {
|
||||
ModularWindow.Builder builder = ModularWindow.builder(176, 107);
|
||||
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
|
||||
|
||||
builder.widget(new TextWidget(
|
||||
new Text(getInventoryName()).color(0x64fc06).shadow())
|
||||
.setPos(9, 9))
|
||||
.widget(new ProgressBar()
|
||||
.setTexture(EMT_UITextures.PICTURE_GAUGE_EMPTY_25, EMT_UITextures.PICTURE_GAUGE_GENERATOR, 25)
|
||||
.setProgress(() -> (float) storage / this.maxstorage)
|
||||
.setSynced(false, false)
|
||||
.setPos(9, 24)
|
||||
.setSize(25, 11))
|
||||
.widget(new ProgressBar()
|
||||
.setTexture(EMT_UITextures.PICTURE_GAUGE_EMPTY_25, EMT_UITextures.PICTURE_GAUGE_GENERATOR, 25)
|
||||
.setProgress(() -> (float) fuel / this.maxfuel)
|
||||
.setSynced(false, false)
|
||||
.setPos(9, 43)
|
||||
.setSize(25, 11))
|
||||
.widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("emt.Storage")
|
||||
+ EMTTextHelper.formatNumber(storage) + "/"
|
||||
+ EMTTextHelper.formatNumber(maxstorage) + "EU")
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 22))
|
||||
.widget(new FakeSyncWidget.IntegerSyncer(() -> storage, val -> storage = val))
|
||||
.widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("emt.Generating")
|
||||
+ (isActive ? generating / 20 / 20 : 0) + " EU/t")
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 35))
|
||||
.widget(new FakeSyncWidget.DoubleSyncer(() -> generating, val -> generating = val))
|
||||
.widget(new FakeSyncWidget.BooleanSyncer(() -> isActive, val -> isActive = val))
|
||||
.widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("emt.Fuel") + ": " + fuel)
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 48))
|
||||
.widget(new FakeSyncWidget.ByteSyncer(() -> fuel, val -> fuel = val))
|
||||
.widget(TextWidget.dynamicString(() ->
|
||||
StatCollector.translateToLocal("emt.remaining_second") + ((fuel * 20 * 20) - tick) / 20)
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 63))
|
||||
.widget(new FakeSyncWidget.IntegerSyncer(() -> tick, val -> tick = val));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
package emt.tile.solar;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.drawable.Text;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
|
||||
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
|
||||
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
|
||||
import com.gtnewhorizons.modularui.common.widget.TextWidget;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.client.gui.EMT_UITextures;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
import gregtech.api.interfaces.tileentity.IEnergyConnected;
|
||||
@@ -19,6 +29,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -27,7 +38,12 @@ import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
public class TileEntitySolarBase extends TileEntityEMT
|
||||
implements IInventory, IWrenchable, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer {
|
||||
implements IInventory,
|
||||
IWrenchable,
|
||||
IHasWorldObjectAndCoords,
|
||||
IEnergyConnected,
|
||||
IBasicEnergyContainer,
|
||||
ITileWithModularUI {
|
||||
|
||||
private static final byte NOTHING = 0;
|
||||
private static final byte ORDO = 1;
|
||||
@@ -98,6 +114,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
this.side = !this.worldObj.isRemote
|
||||
? FMLCommonHandler.instance().getEffectiveSide().isServer()
|
||||
: FMLCommonHandler.instance().getSide().isServer();
|
||||
if (!side) return;
|
||||
this.dead = false;
|
||||
this.timer = +1L;
|
||||
inputintoGTnet();
|
||||
@@ -284,42 +301,53 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
this.mp_storage = this.storage / 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return guiname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
public int gaugeEnergyScaled(long i) {
|
||||
@@ -368,23 +396,28 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getColorization() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte setColorization(byte aColor) {
|
||||
this.color = aColor;
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUniversalEnergyStored(long aEnergyAmount) {
|
||||
return aEnergyAmount < this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUniversalEnergyStored() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUniversalEnergyCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
@@ -401,6 +434,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return voltAmp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputAmperage() {
|
||||
return calculateMaxVoltAmp()[1];
|
||||
// long ret;
|
||||
@@ -424,18 +458,22 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
// return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputVoltage() {
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInputAmperage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInputVoltage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
|
||||
if (this.energySource.getEnergyStored() > aEnergy) {
|
||||
this.energySource.drawEnergy(aEnergy);
|
||||
@@ -445,51 +483,63 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return decreaseStoredEnergyUnits(
|
||||
aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAverageElectricInput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAverageElectricOutput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStoredEU() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEUCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStoredSteam() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSteamCapacity() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(byte aSide) {
|
||||
return true;
|
||||
}
|
||||
@@ -498,42 +548,52 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return this.worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXCoord() {
|
||||
return this.xCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getYCoord() {
|
||||
return (short) this.yCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZCoord() {
|
||||
return this.zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isServerSide() {
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClientSide() {
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRandomNumber(int aRange) {
|
||||
return this.worldObj.rand.nextInt(aRange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
@@ -544,6 +604,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return this.worldObj.getTileEntity(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getTileEntityAtSide(aSide);
|
||||
@@ -551,38 +612,47 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventory(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainer(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {
|
||||
TileEntity tTileEntity = getTileEntity(aX, aY, aZ);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -591,10 +661,12 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(aSide);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -603,6 +675,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
@@ -611,14 +684,17 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockOffset(int aX, int aY, int aZ) {
|
||||
return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
@@ -629,6 +705,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return this.worldObj.getBlock(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getBlockAtSide(aSide);
|
||||
@@ -636,14 +713,17 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaID(int aX, int aY, int aZ) {
|
||||
return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDAtSide(byte aSide) {
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
@@ -651,6 +731,7 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getMetaIDAtSide(aSide);
|
||||
@@ -658,38 +739,47 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevel(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelOffset(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSide(byte aSide) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacity(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityOffset(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSky(int aX, int aY, int aZ) {
|
||||
boolean sky = true;
|
||||
do {
|
||||
@@ -700,58 +790,72 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
return sky;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyOffset(int aX, int aY, int aZ) {
|
||||
return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAir(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirOffset(int aX, int aY, int aZ) {
|
||||
return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSide(byte aSide) {
|
||||
return getAirAtSideAndDistance(aSide, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome(int aX, int aZ) {
|
||||
return this.worldObj.getBiomeGenForCoords(aX, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetX(byte aSide, int aMultiplier) {
|
||||
return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getOffsetY(byte aSide, int aMultiplier) {
|
||||
return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetZ(byte aSide, int aMultiplier) {
|
||||
return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDead() {
|
||||
return this.dead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBlockEvent(byte aID, byte aValue) {
|
||||
GT_Values.NW.sendPacketToAllPlayersInRange(
|
||||
this.worldObj,
|
||||
@@ -760,29 +864,63 @@ public class TileEntitySolarBase extends TileEntityEMT
|
||||
this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimer() {
|
||||
return this.timer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLightValue(byte aLightValue) {}
|
||||
|
||||
@Override
|
||||
public boolean isInvalidTileEntity() {
|
||||
return this.tileEntityInvalid;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer, int aID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(byte b, boolean b1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(byte b, boolean b1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModularWindow createWindow(UIBuildContext buildContext) {
|
||||
ModularWindow.Builder builder = ModularWindow.builder(176, 107);
|
||||
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
|
||||
|
||||
builder.widget(new TextWidget(
|
||||
new Text(getInventoryName()).color(0x64fc06).shadow())
|
||||
.setPos(9, 9))
|
||||
.widget(new ProgressBar()
|
||||
.setTexture(EMT_UITextures.PICTURE_GAUGE_EMPTY_25, EMT_UITextures.PICTURE_GAUGE_SOLAR, 25)
|
||||
.setProgress(() -> (float) storage / this.maxstorage)
|
||||
.setSynced(false, false)
|
||||
.setPos(9, 24)
|
||||
.setSize(25, 11))
|
||||
.widget(new ProgressBar()
|
||||
.setTexture(EMT_UITextures.PICTURE_GAUGE_EMPTY_11, EMT_UITextures.PICTURE_SOLAR_INDICATOR, 11)
|
||||
.setProgress(() -> generating > 9 ? 1f : 0f)
|
||||
.setSynced(false, false)
|
||||
.setPos(9, 43)
|
||||
.setSize(11, 11))
|
||||
.widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("emt.Storage")
|
||||
+ EMTTextHelper.formatNumber(storage) + "/"
|
||||
+ EMTTextHelper.formatNumber(maxstorage) + "EU")
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 22))
|
||||
.widget(new FakeSyncWidget.LongSyncer(() -> storage, val -> storage = val))
|
||||
.widget(TextWidget.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.Generating") + generating + " EU/t")
|
||||
.setSynced(false)
|
||||
.setDefaultColor(0)
|
||||
.setPos(36, 35))
|
||||
.widget(new FakeSyncWidget.DoubleSyncer(() -> generating, val -> generating = val));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,10 @@ public class EMTCreativeTab extends CreativeTabs {
|
||||
|
||||
public EMTCreativeTab(String tabLabel) {
|
||||
super(tabLabel);
|
||||
// setBackgroundImageName("emt.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return EMTItems.electricThorHammer;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public boolean hasSearchBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSearchbarWidth() {
|
||||
return 60;
|
||||
}*/
|
||||
}
|
||||
@@ -42,4 +42,16 @@ public class EMTTextHelper {
|
||||
public static String localize(String key) {
|
||||
return StatCollector.translateToLocal(key);
|
||||
}
|
||||
|
||||
public static String formatNumber(long number) {
|
||||
if (number < 10_000) {
|
||||
return String.valueOf(number);
|
||||
} else if (number < 10_000_000) {
|
||||
return (number / 1000) + "k";
|
||||
} else if (number < 1_000_000_000) {
|
||||
return (number / 1_000_000) + "M";
|
||||
} else {
|
||||
return (number / 1_000_000_000) + "G";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ tooltip.EMT.output.double.nether=wenn es im Nether steht
|
||||
tooltip.EMT.output.double.lava=wenn mit Ignis Centivis befüllt
|
||||
tooltip.EMT.output.double.half.height=höhere Leistung in Höhen (x1 bei y=5, x3 bei y=220)
|
||||
tooltip.EMT.output.double.half.low=höhere Leistung in Tiefen (x1 bei y=220, x3 bei y=5)
|
||||
tooltip.EMT.draconicSchematic=Diesen Bauplan kann man in Pluto Dungeons finden
|
||||
|
||||
#=============Entity Names=============
|
||||
entity.EMT.laser.name=Laser
|
||||
|
||||
@@ -18,6 +18,7 @@ emt.PressShift=<Press SHIFT>
|
||||
emt.Generating=Generating:
|
||||
emt.Fuel=Fuel
|
||||
emt.OutputMax=Output at Max:
|
||||
emt.remaining_second=Remaining seconds:
|
||||
|
||||
#=============Tooltips=============
|
||||
#This comes after a player name. The 's is depicting ownership.
|
||||
@@ -43,6 +44,7 @@ tooltip.EMT.output.double.nether=when located in the Nether
|
||||
tooltip.EMT.output.double.lava=when fed with Ignis Centivis
|
||||
tooltip.EMT.output.double.half.height=Higher output at heights (x1 at y = 5, x3 at y=220)
|
||||
tooltip.EMT.output.double.half.low=Higher output at depths (x1 at y = 220, x3 at y=5)
|
||||
tooltip.EMT.draconicSchematic=This Schematic can be found in Pluto Dungeons
|
||||
|
||||
#=============Entity Names=============
|
||||
entity.EMT.laser.name=Laser
|
||||
|
||||
@@ -12,12 +12,12 @@ gui.EMT.inventory=物品栏
|
||||
gui.EMT.book.aspect.output.eu.title=源质发电机
|
||||
gui.EMT.book.aspect.output.essentia.eu=源质发电功率
|
||||
gui.EMT.key.unequip=卸下装备
|
||||
emt.Output=输出:
|
||||
emt.Storage=存储:
|
||||
emt.Output=输出:
|
||||
emt.Storage=存储:
|
||||
emt.PressShift=<按下Shift>
|
||||
emt.Generating=发电:
|
||||
emt.Generating=发电:
|
||||
emt.Fuel=燃料
|
||||
emt.OutputMax=最大输出:
|
||||
emt.OutputMax=最大输出:
|
||||
|
||||
#=============Tooltips=============
|
||||
#This comes after a player name. The 's is depicting ownership.
|
||||
@@ -43,6 +43,7 @@ tooltip.EMT.output.double.nether=处于下界时发电量
|
||||
tooltip.EMT.output.double.lava=每秒供给0.01vis火之要素时发电量
|
||||
tooltip.EMT.output.double.half.height=位置越高发电量越高(y=5时1倍,y=220时3倍)
|
||||
tooltip.EMT.output.double.half.low=位置越低发电量越高(y=220时1倍,y=5时3倍)
|
||||
tooltip.EMT.draconicSchematic=可在冥王星地牢找到相关图纸
|
||||
|
||||
#=============Entity Names=============
|
||||
entity.EMT.laser.name=镭射器
|
||||
@@ -67,6 +68,10 @@ item.EMT.denseIronSheet.name=致密铁片
|
||||
item.EMT.taintedFeather.name=腐化羽毛
|
||||
item.EMT.thaumiumWing.name=神秘增强羽翼
|
||||
item.EMT.uumatterDrop.name=结晶UU物质液滴
|
||||
item.EMT.draconicSchematic.name=龙芯图纸
|
||||
item.EMT.wyvernSchematic.name=双足飞龙核心图纸
|
||||
item.EMT.awakenedSchematic.name=觉醒核心图纸
|
||||
item.EMT.chaoticSchematic.name=混沌核心图纸
|
||||
item.EMT.bauble.euMaker.armor.name=装备充电指环
|
||||
item.EMT.bauble.euMaker.inventory.name=物品充能指环
|
||||
item.EMT.bauble.oneRing.name=魔戒
|
||||
@@ -180,6 +185,12 @@ EMT_GTBLOCK_CASEING.2.name=铱锇魔法框架
|
||||
EMT_GTBLOCK_CASEING.3.name=铟钨魔法框架
|
||||
EMT_GTBLOCK_CASEING.4.name=源质扩散单元半成品
|
||||
EMT_GTBLOCK_CASEING.5.name=魔法机械方块半成品
|
||||
EMT_GTBLOCK_CASEING.7.name=硅岩合金聚合机械方块
|
||||
EMT_GTBLOCK_CASEING.8.name=血腥灵宝聚合机械方块
|
||||
EMT_GTBLOCK_CASEING.9.name=龙锭聚合机械方块
|
||||
EMT_GTBLOCK_CASEING.10.name=双足飞龙聚合机械方块
|
||||
EMT_GTBLOCK_CASEING.11.name=觉醒龙聚合机械方块
|
||||
EMT_GTBLOCK_CASEING.12.name=混沌聚合机械方块
|
||||
|
||||
#=============Thaumonomicon Texts=============
|
||||
emt.rsname.Electric Magic Tools=电力魔法工具
|
||||
@@ -417,4 +428,4 @@ emt.text.Infused Quantum Armor=你已经无事可做,但是你决定做一些有
|
||||
|
||||
emt.rsname.ResearchCompleter=自动化研究
|
||||
emt.tag.ResearchCompleter=再也不用担心秩序危机了
|
||||
emt.text.ResearchCompleter=连连看一开始很有趣,但你已经决定寻找一种更好的方法解决所有的研究.最终,你结合科技与魔法,制造出了一台多方块机器,可以自动完成研究笔记.<BR><BR>需要将灵气节点放在机器内部才能使其正常运行,而且在运行过程中,机器会缓慢摧毁这些节点.节点稳定器不是必须品,但为了让这么多节点不互相打架,我们还是推荐使用节点稳定器.
|
||||
emt.text.ResearchCompleter=连连看一开始很有趣,但你已经决定寻找一种更好的方法解决所有的研究.最终,你结合科技与魔法,制造出了一台多方块机器,可以自动完成研究笔记.<BR><BR>需要将灵气节点放在机器内部才能使其正常运行,而且在运行过程中,机器会缓慢摧毁这些节点.节点稳定器不是必须品,但为了让这么多节点不互相打架,我们还是推荐使用节点稳定器.
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 164 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 504 B |
|
After Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB |