mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23a5484ee8 | ||
|
|
4b5837cac2 | ||
|
|
1251427388 | ||
|
|
3e7d69f460 | ||
|
|
88725a144d | ||
|
|
123f22f20e | ||
|
|
0b0f7a4f1a | ||
|
|
b00c5996f7 | ||
|
|
83f52d15c7 | ||
|
|
287c4498d2 | ||
|
|
2470e81f0e | ||
|
|
1af6fcae0b | ||
|
|
f44111da96 | ||
|
|
4ae9ff2d77 | ||
|
|
71f79536a7 | ||
|
|
0920bf28d6 | ||
|
|
8e4107d11e | ||
|
|
349bcc0926 | ||
|
|
070660efe4 | ||
|
|
0dd56b62ab | ||
|
|
54d61f5251 | ||
|
|
ebcbef851a | ||
|
|
1717d38632 | ||
|
|
5fdd24293a | ||
|
|
2629076937 | ||
|
|
63cbe6e562 | ||
|
|
3194ecf6e8 |
No files matched your search
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUNDIR="run"
|
||||
CRASH="crash-reports"
|
||||
SERVERLOG="server.log"
|
||||
|
||||
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $RUNDIR/$CRASH/crash*.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
|
||||
echo "Fatal errors detected:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
|
||||
+258
-197
@@ -1,4 +1,4 @@
|
||||
//version: 1680120787
|
||||
//version: 1702141377
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -6,53 +6,34 @@
|
||||
*/
|
||||
|
||||
|
||||
import com.diffplug.blowdryer.Blowdryer
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute
|
||||
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
|
||||
import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask
|
||||
import com.gtnewhorizons.retrofuturagradle.util.Distribution
|
||||
import com.matthewprenger.cursegradle.CurseArtifact
|
||||
import com.matthewprenger.cursegradle.CurseRelation
|
||||
import com.modrinth.minotaur.dependencies.ModDependency
|
||||
import com.modrinth.minotaur.dependencies.VersionDependency
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import org.gradle.api.tasks.options.Option;
|
||||
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
import org.gradle.internal.xml.XmlTransformer
|
||||
import org.jetbrains.gradle.ext.*
|
||||
import org.jetbrains.gradle.ext.Application
|
||||
import org.jetbrains.gradle.ext.Gradle
|
||||
|
||||
import javax.inject.Inject
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipOutputStream
|
||||
import javax.inject.Inject
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name 'forge'
|
||||
url 'https://maven.minecraftforge.net'
|
||||
}
|
||||
maven {
|
||||
// GTNH RetroFuturaGradle and ASM Fork
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
maven {
|
||||
name 'Scala CI dependencies'
|
||||
url 'https://repo1.maven.org/maven2/'
|
||||
}
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
@@ -66,21 +47,25 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
|
||||
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
|
||||
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
|
||||
id 'de.undercouch.download' version '5.3.0'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
id 'com.palantir.git-version' version '3.0.0' apply false
|
||||
id 'de.undercouch.download' version '5.4.0'
|
||||
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
|
||||
id 'com.diffplug.spotless' version '6.7.2' apply false
|
||||
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.4'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26'
|
||||
}
|
||||
|
||||
print("You might want to check out './gradlew :faq' if your build fails.\n")
|
||||
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
if (settingsupdated)
|
||||
throw new GradleException("Settings has been updated, please re-run task.")
|
||||
|
||||
if (project.file('.git/HEAD').isFile()) {
|
||||
// In submodules, .git is a file pointing to the real git dir
|
||||
if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) {
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
}
|
||||
|
||||
@@ -89,6 +74,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
|
||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
|
||||
boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false
|
||||
|
||||
final String CHECKSTYLE_CONFIG = """
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
<module name="TreeWalker">
|
||||
<!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
|
||||
<module name="SuppressionCommentFilter"/>
|
||||
<module name="AvoidStarImport">
|
||||
<!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
|
||||
<property name="allowStaticMemberImports" value="true"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
"""
|
||||
|
||||
checkPropertyExists("modName")
|
||||
checkPropertyExists("modId")
|
||||
@@ -115,6 +117,8 @@ propertyDefaultIfUnset("usesMixinDebug", project.usesMixins)
|
||||
propertyDefaultIfUnset("forceEnableMixins", false)
|
||||
propertyDefaultIfUnset("channel", "stable")
|
||||
propertyDefaultIfUnset("mappingsVersion", "12")
|
||||
propertyDefaultIfUnset("usesMavenPublishing", true)
|
||||
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
|
||||
propertyDefaultIfUnset("modrinthProjectId", "")
|
||||
propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
@@ -132,12 +136,23 @@ propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new
|
||||
// this is meant to be set using the user wide property file. by default we do nothing.
|
||||
propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea"
|
||||
|
||||
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
|
||||
project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts
|
||||
if (!disableSpotless) {
|
||||
apply plugin: 'com.diffplug.spotless'
|
||||
apply from: Blowdryer.file('spotless.gradle')
|
||||
}
|
||||
|
||||
if (!disableCheckstyle) {
|
||||
apply plugin: 'checkstyle'
|
||||
tasks.named("checkstylePatchedMc") { enabled = false }
|
||||
tasks.named("checkstyleMcLauncher") { enabled = false }
|
||||
tasks.named("checkstyleIdeVirtualMain") { enabled = false }
|
||||
tasks.named("checkstyleInjectedTags") { enabled = false }
|
||||
checkstyle {
|
||||
config = resources.text.fromString(CHECKSTYLE_CONFIG)
|
||||
}
|
||||
}
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
String kotlinSourceDir = "src/main/kotlin/"
|
||||
@@ -201,6 +216,14 @@ configurations {
|
||||
canBeConsumed = false
|
||||
canBeResolved = false
|
||||
}
|
||||
|
||||
create("devOnlyNonPublishable") {
|
||||
description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)"
|
||||
canBeConsumed = false
|
||||
canBeResolved = false
|
||||
}
|
||||
compileOnly.extendsFrom(devOnlyNonPublishable)
|
||||
runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable)
|
||||
}
|
||||
|
||||
if (enableModernJavaSyntax.toBoolean()) {
|
||||
@@ -214,6 +237,8 @@ if (enableModernJavaSyntax.toBoolean()) {
|
||||
|
||||
dependencies {
|
||||
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
|
||||
// workaround for https://github.com/bsideup/jabel/issues/174
|
||||
annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0'
|
||||
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
|
||||
transitive = false // We only care about the 1 annotation class
|
||||
}
|
||||
@@ -262,7 +287,7 @@ if (apiPackage) {
|
||||
}
|
||||
|
||||
if (accessTransformersFile) {
|
||||
for (atFile in accessTransformersFile.split(",")) {
|
||||
for (atFile in accessTransformersFile.split(" ")) {
|
||||
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
|
||||
if (!getFile(targetFile).exists()) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
@@ -347,7 +372,27 @@ catch (Exception ignored) {
|
||||
String identifiedVersion
|
||||
String versionOverride = System.getenv("VERSION") ?: null
|
||||
try {
|
||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
||||
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
|
||||
if (versionOverride == null) {
|
||||
def gitDetails = versionDetails()
|
||||
def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning
|
||||
String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git')
|
||||
if (branchName.startsWith('origin/')) {
|
||||
branchName = branchName.minus('origin/')
|
||||
}
|
||||
branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver
|
||||
identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}'
|
||||
if (gitDetails.commitDistance > 0) {
|
||||
identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}"
|
||||
if (isDirty) {
|
||||
identifiedVersion += "-dirty"
|
||||
}
|
||||
} else if (isDirty) {
|
||||
identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty"
|
||||
}
|
||||
} else {
|
||||
identifiedVersion = versionOverride
|
||||
}
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
out.style(Style.Failure).text(
|
||||
@@ -369,9 +414,13 @@ if (identifiedVersion == versionOverride) {
|
||||
|
||||
group = "com.github.GTNewHorizons"
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
base {
|
||||
archivesName = customArchiveBaseName
|
||||
}
|
||||
} else {
|
||||
archivesBaseName = modId
|
||||
base {
|
||||
archivesName = modId
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -399,7 +448,7 @@ minecraft {
|
||||
|
||||
username = developmentEnvironmentUserName.toString()
|
||||
|
||||
lwjgl3Version = "3.3.2-SNAPSHOT"
|
||||
lwjgl3Version = "3.3.2"
|
||||
|
||||
// Enable assertions in the current mod
|
||||
extraRunJvmArguments.add("-ea:${modGroup}")
|
||||
@@ -455,10 +504,19 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
if (file('addon.gradle').exists()) {
|
||||
if (file('addon.gradle.kts').exists()) {
|
||||
apply from: 'addon.gradle.kts'
|
||||
} else if (file('addon.gradle').exists()) {
|
||||
apply from: 'addon.gradle'
|
||||
}
|
||||
|
||||
// File for local tweaks not commited to Git
|
||||
if (file('addon.local.gradle.kts').exists()) {
|
||||
apply from: 'addon.local.gradle.kts'
|
||||
} else if (file('addon.local.gradle').exists()) {
|
||||
apply from: 'addon.local.gradle'
|
||||
}
|
||||
|
||||
// Allow unsafe repos but warn
|
||||
repositories.configureEach { repo ->
|
||||
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
|
||||
@@ -469,7 +527,14 @@ repositories.configureEach { repo ->
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
if (file('repositories.gradle.kts').exists()) {
|
||||
apply from: 'repositories.gradle.kts'
|
||||
} else if (file('repositories.gradle').exists()) {
|
||||
apply from: 'repositories.gradle'
|
||||
} else {
|
||||
logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.")
|
||||
throw new RuntimeException("Missing repositories.gradle[.kts]")
|
||||
}
|
||||
|
||||
configurations {
|
||||
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
|
||||
@@ -510,9 +575,6 @@ repositories {
|
||||
maven {
|
||||
name 'Overmind forge repo mirror'
|
||||
url 'https://gregtech.overminddl1.com/'
|
||||
mavenContent {
|
||||
excludeGroup("net.minecraftforge") // missing the `universal` artefact
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "GTNH Maven"
|
||||
@@ -527,24 +589,34 @@ repositories {
|
||||
}
|
||||
}
|
||||
if (includeWellKnownRepositories.toBoolean()) {
|
||||
maven {
|
||||
name "CurseMaven"
|
||||
url "https://cursemaven.com"
|
||||
content {
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name "CurseMaven"
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup "curse.maven"
|
||||
}
|
||||
}
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup "maven.modrinth"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = "https://maven.ic2.player.to/"
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
|
||||
content {
|
||||
includeGroup "net.industrial-craft"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "ic2-mirror"
|
||||
url = "https://maven2.ic2.player.to/"
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
@@ -559,9 +631,12 @@ repositories {
|
||||
|
||||
def mixinProviderGroup = "io.github.legacymoddingmc"
|
||||
def mixinProviderModule = "unimixins"
|
||||
def mixinProviderVersion = "0.1.6"
|
||||
def mixinProviderVersion = "0.1.13"
|
||||
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
|
||||
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
|
||||
ext.mixinProviderSpec = mixinProviderSpec
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
|
||||
dependencies {
|
||||
if (usesMixins.toBoolean()) {
|
||||
@@ -574,7 +649,7 @@ dependencies {
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean()) {
|
||||
implementation(mixinProviderSpec)
|
||||
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
|
||||
} else if (forceEnableMixins.toBoolean()) {
|
||||
runtimeOnlyNonPublishable(mixinProviderSpec)
|
||||
}
|
||||
@@ -597,15 +672,37 @@ configurations.all {
|
||||
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
|
||||
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
|
||||
|
||||
substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
dependencies {
|
||||
constraints {
|
||||
def minGtnhLibVersion = "0.0.13"
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") {
|
||||
because("fixes duplicate mod errors in java 17 configurations using old gtnhlib")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
|
||||
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap
|
||||
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"
|
||||
if (file('dependencies.gradle.kts').exists()) {
|
||||
apply from: 'dependencies.gradle.kts'
|
||||
} else if (file('dependencies.gradle').exists()) {
|
||||
apply from: 'dependencies.gradle'
|
||||
} else {
|
||||
logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.")
|
||||
throw new RuntimeException("Missing dependencies.gradle[.kts]")
|
||||
}
|
||||
|
||||
tasks.register('generateAssets') {
|
||||
group = "GTNH Buildscript"
|
||||
@@ -637,46 +734,17 @@ tasks.register('generateAssets') {
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.named("reobfJar", ReobfuscatedJar).configure {
|
||||
extraSrgFiles.from(mixinSrg)
|
||||
}
|
||||
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn("generateAssets")
|
||||
}
|
||||
|
||||
tasks.named("compileJava", JavaCompile).configure {
|
||||
doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}",
|
||||
"-AoutSrgFile=${mixinSrg}",
|
||||
"-AoutRefMapFile=${refMap}",
|
||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
||||
"-XDenableSunApiLintControl",
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
javacOptions {
|
||||
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
|
||||
option("-AoutSrgFile=$mixinSrg")
|
||||
option("-AoutRefMapFile=$refMap")
|
||||
}
|
||||
}
|
||||
tasks.configureEach { task ->
|
||||
if (task.name == "kaptKotlin") {
|
||||
task.doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.named("processResources", ProcessResources).configure {
|
||||
@@ -694,7 +762,6 @@ tasks.named("processResources", ProcessResources).configure {
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
dependsOn("compileJava", "compileScala")
|
||||
}
|
||||
}
|
||||
@@ -713,23 +780,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.3.3'
|
||||
def asmVersion = '9.4'
|
||||
def lwjgl3ifyVersion = '1.5.7'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
|
||||
}
|
||||
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
|
||||
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
|
||||
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
|
||||
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
|
||||
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
|
||||
}
|
||||
|
||||
@@ -793,7 +851,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
|
||||
|
||||
@Inject
|
||||
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
|
||||
public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) {
|
||||
super(side, gradle)
|
||||
|
||||
this.lwjglVersion = 3
|
||||
@@ -802,7 +860,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
|
||||
|
||||
this.classpath(project.java17PatchDependenciesCfg)
|
||||
if (side == Side.CLIENT) {
|
||||
if (side == Distribution.CLIENT) {
|
||||
this.classpath(project.minecraftTasks.lwjgl3Configuration)
|
||||
}
|
||||
// Use a raw provider instead of map to not create a dependency on the task
|
||||
@@ -812,9 +870,21 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
}
|
||||
|
||||
public void setup(Project project) {
|
||||
super.setup(project)
|
||||
if (project.usesMixins.toBoolean()) {
|
||||
this.extraJvmArgs.addAll(project.provider(() -> {
|
||||
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec))
|
||||
mixinCfg.canBeConsumed = false
|
||||
mixinCfg.transitive = false
|
||||
enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : []
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient")
|
||||
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
|
||||
runClient17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
@@ -825,7 +895,7 @@ runClient17Task.configure {
|
||||
userUUID = minecraft.userUUID
|
||||
}
|
||||
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer")
|
||||
runServer17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
@@ -866,11 +936,6 @@ tasks.named("jar", Jar).configure {
|
||||
}
|
||||
|
||||
if (usesShadowedDependencies.toBoolean()) {
|
||||
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
enabled = relocateShadowedDependencies.toBoolean()
|
||||
}
|
||||
tasks.named("shadowJar", ShadowJar).configure {
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
@@ -886,7 +951,8 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
]
|
||||
archiveClassifier.set('dev')
|
||||
if (relocateShadowedDependencies.toBoolean()) {
|
||||
dependsOn(relocateShadowJar)
|
||||
relocationPrefix = modGroup + ".shadow"
|
||||
enableRelocation = true
|
||||
}
|
||||
}
|
||||
configurations.runtimeElements.outgoing.artifacts.clear()
|
||||
@@ -960,6 +1026,9 @@ idea {
|
||||
}
|
||||
}
|
||||
runConfigurations {
|
||||
"0. Build and Test"(Gradle) {
|
||||
taskNames = ["build"]
|
||||
}
|
||||
"1. Run Client"(Gradle) {
|
||||
taskNames = ["runClient"]
|
||||
}
|
||||
@@ -1079,6 +1148,14 @@ tasks.named("processIdeaSettings").configure {
|
||||
dependsOn("injectTags")
|
||||
}
|
||||
|
||||
tasks.named("ideVirtualMainClasses").configure {
|
||||
// Make IntelliJ "Build project" build the mod jars
|
||||
dependsOn("jar", "reobfJar")
|
||||
if (!disableSpotless) {
|
||||
dependsOn("spotlessCheck")
|
||||
}
|
||||
}
|
||||
|
||||
// workaround variable hiding in pom processing
|
||||
def projectConfigs = project.configurations
|
||||
|
||||
@@ -1097,14 +1174,15 @@ publishing {
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
||||
allowInsecureProtocol = true
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
|
||||
maven {
|
||||
url = mavenPublishUrl
|
||||
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1219,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) {
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.0.2"
|
||||
def buildscriptGradleVersion = "8.5"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
@@ -1251,6 +1329,23 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
|
||||
}
|
||||
}
|
||||
|
||||
// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large
|
||||
tasks.register('faq') {
|
||||
group = 'GTNH Buildscript'
|
||||
description = 'Prints frequently asked questions about building a project'
|
||||
|
||||
doLast {
|
||||
print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
|
||||
"Or you can manually check if the versions are still on the distributing sites - " +
|
||||
"the links can be found in repositories.gradle and build.gradle:repositories, " +
|
||||
"but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" +
|
||||
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
|
||||
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " +
|
||||
"However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " +
|
||||
"Java 9 or later.")
|
||||
}
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle")
|
||||
}
|
||||
@@ -1308,8 +1403,14 @@ boolean isNewBuildScriptVersionAvailable() {
|
||||
|
||||
String currentBuildScript = getFile("build.gradle").getText()
|
||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
String availableBuildScriptHash
|
||||
try {
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
} catch (IOException e) {
|
||||
logger.warn("Could not check for buildscript update availability: {}", e.message)
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
||||
return !isUpToDate
|
||||
@@ -1388,7 +1489,7 @@ static int replaceParams(File file, Map<String, String> params) {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Dependency Deobfuscation
|
||||
// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle)
|
||||
|
||||
def deobf(String sourceURL) {
|
||||
try {
|
||||
@@ -1430,11 +1531,7 @@ def deobfMaven(String repoURL, String mavenDep) {
|
||||
}
|
||||
|
||||
def deobfCurse(String curseDep) {
|
||||
try {
|
||||
return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep")
|
||||
} catch (Exception ignored) {
|
||||
out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.")
|
||||
}
|
||||
return dependencies.rfg.deobf("curse.maven:$curseDep")
|
||||
}
|
||||
|
||||
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
|
||||
@@ -1442,34 +1539,7 @@ def deobf(String sourceURL, String rawFileName) {
|
||||
String bon2Version = "2.5.1"
|
||||
String fileName = URLDecoder.decode(rawFileName, "UTF-8")
|
||||
String cacheDir = "$project.gradle.gradleUserHomeDir/caches"
|
||||
String bon2Dir = "$cacheDir/forge_gradle/deobf"
|
||||
String bon2File = "$bon2Dir/BON2-${bon2Version}.jar"
|
||||
String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar"
|
||||
String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar"
|
||||
|
||||
if (file(deobfFile).exists()) {
|
||||
return files(deobfFile)
|
||||
}
|
||||
|
||||
String mappingsVer
|
||||
String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/'
|
||||
if (remoteMappings) {
|
||||
String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion"
|
||||
String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip"
|
||||
|
||||
zipMappings(mappingsZIP, remoteMappings, bon2Dir)
|
||||
|
||||
mappingsVer = "snapshot_$id"
|
||||
} else {
|
||||
mappingsVer = "${channel}_$mappingsVersion"
|
||||
}
|
||||
|
||||
download.run {
|
||||
src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar"
|
||||
dest bon2File
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
download.run {
|
||||
src sourceURL
|
||||
@@ -1477,50 +1547,8 @@ def deobf(String sourceURL, String rawFileName) {
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
exec {
|
||||
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
|
||||
workingDir bon2Dir
|
||||
standardOutput = new FileOutputStream("${deobfFile}.log")
|
||||
}
|
||||
|
||||
return files(deobfFile)
|
||||
return dependencies.rfg.deobf(files(obfFile))
|
||||
}
|
||||
|
||||
def zipMappings(String zipPath, String url, String bon2Dir) {
|
||||
File zipFile = new File(zipPath)
|
||||
if (zipFile.exists()) {
|
||||
return
|
||||
}
|
||||
|
||||
String fieldsCache = "$bon2Dir/data/fields.csv"
|
||||
String methodsCache = "$bon2Dir/data/methods.csv"
|
||||
|
||||
download.run {
|
||||
src "${url}fields.csv"
|
||||
dest fieldsCache
|
||||
quiet true
|
||||
}
|
||||
download.run {
|
||||
src "${url}methods.csv"
|
||||
dest methodsCache
|
||||
quiet true
|
||||
}
|
||||
|
||||
zipFile.getParentFile().mkdirs()
|
||||
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
|
||||
|
||||
zos.putNextEntry(new ZipEntry("fields.csv"))
|
||||
Files.copy(Paths.get(fieldsCache), zos)
|
||||
zos.closeEntry()
|
||||
|
||||
zos.putNextEntry(new ZipEntry("methods.csv"))
|
||||
Files.copy(Paths.get(methodsCache), zos)
|
||||
zos.closeEntry()
|
||||
|
||||
zos.close()
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
@@ -1547,3 +1575,36 @@ def getSecondaryArtifacts() {
|
||||
if (apiPackage) secondaryArtifacts += [apiJar]
|
||||
return secondaryArtifacts
|
||||
}
|
||||
|
||||
def getURL(String main, String fallback) {
|
||||
return pingURL(main, 10000) ? main : fallback
|
||||
}
|
||||
|
||||
// credit: https://stackoverflow.com/a/3584332
|
||||
def pingURL(String url, int timeout) {
|
||||
url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
|
||||
try {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
|
||||
connection.setConnectTimeout(timeout)
|
||||
connection.setReadTimeout(timeout)
|
||||
connection.setRequestMethod("HEAD")
|
||||
int responseCode = connection.getResponseCode()
|
||||
return 200 <= responseCode && responseCode <= 399
|
||||
} catch (IOException ignored) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// For easier scripting of things that require variables defined earlier in the buildscript
|
||||
if (file('addon.late.gradle.kts').exists()) {
|
||||
apply from: 'addon.late.gradle.kts'
|
||||
} else if (file('addon.late.gradle').exists()) {
|
||||
apply from: 'addon.late.gradle'
|
||||
}
|
||||
|
||||
// File for local tweaks not commited to Git
|
||||
if (file('addon.late.local.gradle.kts').exists()) {
|
||||
apply from: 'addon.late.local.gradle.kts'
|
||||
} else if (file('addon.late.local.gradle').exists()) {
|
||||
apply from: 'addon.late.local.gradle'
|
||||
}
|
||||
+15
-14
@@ -1,25 +1,26 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.6.5:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.18:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.7.0:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev')
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:0.0.13:dev")
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.33:dev')
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.38:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.24:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-195-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.14.1:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.10.17-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.6.5:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-291-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.106:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.2:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.1-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.12.3-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
compileOnly(deobf('https://media.forgecdn.net/files/2269/339/ComputerCraft1.75.jar')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
|
||||
compileOnly(deobf('https://media.forgecdn.net/files/2426/270/Mekanism-1.7.10-9.1.0.281.jar')) // https://aidancbrady.com/mekanism/download/
|
||||
compileOnly(deobf('https://immibis.com/mcmoddl/files/immibis-microblocks-59.1.2.jar'))
|
||||
compileOnly(rfg.deobf('curse.maven:computercraft-67504:2269339')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -85,9 +85,6 @@ done
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -133,10 +130,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
|
||||
@@ -207,6 +207,7 @@ public class EnderIO {
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi_post");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -787,7 +788,7 @@ public class EnderIO {
|
||||
@EventHandler
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
processImc(FMLInterModComms.fetchRuntimeMessages(this)); // Some mods send IMCs during PostInit, so we catch
|
||||
// them here.
|
||||
// them here.
|
||||
}
|
||||
|
||||
private static String getXPJuiceName() {
|
||||
|
||||
@@ -2,10 +2,13 @@ package crazypants.enderio;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.Marker;
|
||||
import org.apache.logging.log4j.MarkerManager;
|
||||
|
||||
public final class Log {
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(EnderIO.MODID);
|
||||
public static final Marker securityMarker = MarkerManager.getMarker("SuspiciousPackets");
|
||||
|
||||
public static void warn(String msg) {
|
||||
LOGGER.warn(msg);
|
||||
|
||||
@@ -4,10 +4,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public interface IItemOfTravel extends IEnergyContainerItem {
|
||||
|
||||
boolean isActive(EntityPlayer ep, ItemStack equipped);
|
||||
|
||||
void extractInternal(ItemStack equipped, int power);
|
||||
|
||||
/**
|
||||
* @param equipped player who is currently holding this item. caller will ensure the item held has your Item as item
|
||||
* type
|
||||
* @return -1 if method not supported, or max(can extract, power), e.g. 0 if item is empty.
|
||||
*/
|
||||
default int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Config.strictTPItemChecking ? 0 : -1;
|
||||
}
|
||||
}
|
||||
@@ -94,11 +94,10 @@ public interface ITelePad extends ITravelAccessable {
|
||||
/**
|
||||
* Util method to set all coords using a {@link BlockCoord} object.
|
||||
*
|
||||
* @param coords The coords to set this telepad to.
|
||||
* @see #setX(int)
|
||||
* @see #setY(int)
|
||||
* @see #setZ(int)
|
||||
*
|
||||
* @param coords The coords to set this telepad to.
|
||||
*/
|
||||
void setCoords(BlockCoord coords);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.util.UserIdent;
|
||||
|
||||
public interface ITravelAccessable {
|
||||
|
||||
@@ -14,9 +14,8 @@ import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
* <li>Staff of travelling</li>
|
||||
* <li>Telepad</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* As well as any externally added teleports, assuming they fire this event manually.
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
public class TeleportEntityEvent extends EntityEvent {
|
||||
|
||||
@@ -9,11 +9,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -52,6 +47,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduitNetwork;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
@@ -89,7 +88,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
* If this is true, it will trigger a reconnection on the next Tick.
|
||||
* <p>
|
||||
* Use the method needUpdateConnections() instead of setting this to true.
|
||||
*
|
||||
*
|
||||
* @see needUpdateConnections()
|
||||
*/
|
||||
private boolean needUpdateConnections = false;
|
||||
|
||||
@@ -2,11 +2,6 @@ package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -29,6 +24,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
@@ -31,9 +28,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
@@ -53,7 +47,13 @@ import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.gui.*;
|
||||
import crazypants.enderio.conduit.gui.ExternalConnectionContainer;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnectionSelector;
|
||||
import crazypants.enderio.conduit.gui.PacketFluidChannel;
|
||||
import crazypants.enderio.conduit.gui.PacketFluidFilter;
|
||||
import crazypants.enderio.conduit.gui.PacketOpenConduitUI;
|
||||
import crazypants.enderio.conduit.gui.PacketSlotVisibility;
|
||||
import crazypants.enderio.conduit.gui.item.PacketExistingItemFilterSnapshot;
|
||||
import crazypants.enderio.conduit.gui.item.PacketModItemFilter;
|
||||
import crazypants.enderio.conduit.liquid.PacketFluidLevel;
|
||||
@@ -73,6 +73,10 @@ import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Interface(
|
||||
@@ -637,8 +641,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (!player.isSneaking() || equipped == null || equipped.getItem() != EnderIO.itemYetaWench) {
|
||||
ITool tool = ToolUtil.getEquippedTool(player);
|
||||
if (!player.isSneaking() || tool == null || !tool.canUse(player.getCurrentEquippedItem(), player, x, y, z)) {
|
||||
return;
|
||||
}
|
||||
ConduitUtil.openConduitGui(world, x, y, z, player);
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.gui.IconEIO.*;
|
||||
import static crazypants.enderio.gui.IconEIO.CROSS;
|
||||
import static crazypants.enderio.gui.IconEIO.TICK;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE_OFF;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -55,11 +64,10 @@ public class ConduitDisplayMode {
|
||||
* Use this constructor if you have custom display logic, it will use {@code IConduit.class} as the conduitType, and
|
||||
* the passed name as the override name.
|
||||
*
|
||||
* @see #ConduitDisplayMode(Class, IWidgetIcon, IWidgetIcon)
|
||||
*
|
||||
* @param name The override name.
|
||||
* @param widgetSelected The widget to render when this type is selected.
|
||||
* @param widgetUnselected The widget to render when this type is unselected.
|
||||
* @see #ConduitDisplayMode(Class, IWidgetIcon, IWidgetIcon)
|
||||
*/
|
||||
public ConduitDisplayMode(String name, IWidgetIcon widgetSelected, IWidgetIcon widgetUnselected) {
|
||||
this(IConduit.class, widgetSelected, widgetUnselected);
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.ModObject.blockPainter;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_GOLD;
|
||||
import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRUDE_STEEL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_PINK_SLIME;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.ENERGETIC_SILVER;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.MELODIC_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ConduitUtil {
|
||||
}
|
||||
}
|
||||
if (con.getNetwork() != null) { // this should have been destroyed when destroying the neighbours network but
|
||||
// lets just make
|
||||
// lets just make
|
||||
// sure
|
||||
con.getNetwork().destroyNetwork();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -16,11 +11,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -29,6 +23,10 @@ import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.power.IInternalPowerHandler;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2"),
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = "MekanismAPI|gas"),
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
|
||||
public interface IExtractor extends IConduit {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
|
||||
public class MicroblocksUtil {
|
||||
|
||||
|
||||
@@ -7,19 +7,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.*;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -37,11 +24,10 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -64,6 +50,17 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
|
||||
public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -23,6 +21,7 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public abstract class AbstractGasConduit extends AbstractConduit implements IGasConduit {
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@ package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -17,6 +14,8 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class AbstractGasTankConduitNetwork<T extends AbstractGasTankConduit>
|
||||
extends AbstractConduitNetwork<IGasConduit, T> {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
|
||||
public class ConduitGasTank extends GasTank {
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ package crazypants.enderio.conduit.gas;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -24,6 +21,8 @@ import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class GasConduit extends AbstractGasTankConduit {
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit> {
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -25,6 +23,7 @@ import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -12,6 +9,8 @@ import cpw.mods.fml.common.ModAPIManager;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public final class GasUtil {
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = GasUtil.API_NAME)
|
||||
public interface IGasConduit extends IConduit, IGasHandler, IExtractor {
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit.geom;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class CollidableComponent {
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class ConduitGeometryUtil {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -24,12 +25,14 @@ import crazypants.enderio.conduit.gui.item.InventoryUpgrades;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.SpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.machine.gui.IContainerWithTileEntity;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrades> {
|
||||
public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrades> implements IContainerWithTileEntity {
|
||||
|
||||
private final IItemConduit itemConduit;
|
||||
private final ForgeDirection direction;
|
||||
private final TileEntity te;
|
||||
|
||||
private int speedUpgradeSlotLimit = 15;
|
||||
|
||||
@@ -52,6 +55,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
super(playerInv, new InventoryUpgrades(bundle.getConduit(IItemConduit.class), dir));
|
||||
this.direction = dir;
|
||||
this.itemConduit = bundle.getConduit(IItemConduit.class);
|
||||
this.te = (TileEntity) bundle;
|
||||
slotLocations.addAll(playerSlotLocations.values());
|
||||
|
||||
int x;
|
||||
@@ -280,6 +284,11 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
return copystack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return te;
|
||||
}
|
||||
|
||||
private class FilterSlot extends Slot {
|
||||
|
||||
public FilterSlot(IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
|
||||
@@ -2,8 +2,6 @@ package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
@@ -22,6 +20,7 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
public class GasSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidChannel message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (!(conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
|
||||
@@ -53,6 +53,7 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (!(conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IIte
|
||||
|
||||
@Override
|
||||
public PacketExistingItemFilterSnapshot onMessage(PacketExistingItemFilterSnapshot message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -58,6 +58,7 @@ public class PacketModItemFilter extends AbstractConduitPacket<IItemConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketModItemFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -5,10 +5,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
|
||||
@@ -18,12 +18,11 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.inventory.IInventoryConnection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.inventory.IInventoryConnection;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
@@ -613,8 +612,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
ItemStack result = new ItemStack(EnderIO.itemItemConduit, 1, metaData);
|
||||
return result;
|
||||
return new ItemStack(EnderIO.itemItemConduit, 1, metaData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface IItemFilter {
|
||||
|
||||
/**
|
||||
* Checks if the given item passes the filter or not.
|
||||
*
|
||||
*
|
||||
* @param inv the attached inventory - or null when used without an inventory (eg for a GUI)
|
||||
* @param item the item to check
|
||||
* @return true if the item is allowed to pass
|
||||
|
||||
@@ -165,7 +165,8 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
}
|
||||
|
||||
private boolean isNBTMatch(ItemStack filter, ItemStack item) {
|
||||
if (filter.stackTagCompound == null && item.stackTagCompound == null) return true;
|
||||
if (filter.stackTagCompound == null && (item.stackTagCompound == null || item.stackTagCompound.hasNoTags()))
|
||||
return true;
|
||||
if (filter.stackTagCompound == null || item.stackTagCompound == null) return false;
|
||||
if (!filter.getTagCompound().hasKey("GEN")) return filter.stackTagCompound.equals(item.stackTagCompound);
|
||||
NBTTagCompound filterTag = (NBTTagCompound) filter.getTagCompound().copy();
|
||||
|
||||
@@ -13,7 +13,6 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author matthias
|
||||
*/
|
||||
public class ItemPowerItemFilter extends Item implements IItemFilterUpgrade, IResourceTooltipProvider {
|
||||
|
||||
@@ -5,11 +5,10 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
@@ -20,7 +19,6 @@ import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author matthias
|
||||
*/
|
||||
public class PowerItemFilter implements IItemFilter {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
@@ -23,6 +24,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
|
||||
public abstract class AbstractLiquidConduit extends AbstractConduit implements ILiquidConduit {
|
||||
|
||||
@@ -54,6 +57,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
if (h == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (EnderIO.hasGT5 && h instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity mte = ((IGregTechTileEntity) h).getMetaTileEntity();
|
||||
return mte != null && mte.getCapacity() > 0;
|
||||
}
|
||||
|
||||
// TODO: This check was added to work around a bug in dynamic tanks, but
|
||||
// it causes issues with not conecting to empty tanks such as dim. trans +
|
||||
// BC fluid pipes, so I am removing it for now.
|
||||
@@ -148,11 +157,11 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || isConditionMetByExternalSignal(dir, mode, col));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && isConditionMetByExternalSignal(dir, mode, col));
|
||||
}
|
||||
return res;
|
||||
@@ -171,7 +180,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
}
|
||||
}
|
||||
|
||||
return mode.isConditionMet(mode, externalSignal);
|
||||
return RedstoneControlMode.isConditionMet(mode, externalSignal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<AdvancedLiquidConduit> {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
|
||||
public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidConduit> {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -19,6 +17,7 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
@@ -96,12 +95,12 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
List<Vertex> corners = component.bound
|
||||
.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (int i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,7 +303,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
float transY = (bound.sizeY() - sizeY) / 2;
|
||||
|
||||
Vector3d translation = new Vector3d(0, transY, 0);
|
||||
setupVertices(bound.translate(translation));
|
||||
CubeRenderer.setupVertices(bound.translate(translation));
|
||||
}
|
||||
|
||||
private void calculateRatios(LiquidConduit conduit) {
|
||||
|
||||
@@ -12,6 +12,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
@@ -19,10 +22,6 @@ import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio.conduit.oc;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -10,6 +7,8 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "li.cil.oc.api.network.Environment", modid = "OpenComputersAPI|Network"),
|
||||
@Interface(iface = "li.cil.oc.api.network.SidedEnvironment", modid = "OpenComputersAPI|Network") })
|
||||
|
||||
@@ -9,11 +9,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -45,6 +40,10 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package crazypants.enderio.conduit.oc;
|
||||
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -13,6 +7,11 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
|
||||
@Interface(iface = "li.cil.oc.api.network.ManagedEnvironment", modid = "OpenComputersAPI|Network")
|
||||
public class OCConduitNetwork extends AbstractConduitNetwork<IOCConduit, IOCConduit> implements ManagedEnvironment {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class AbstractConduitPacket<T extends IConduit> extends AbstractConduitBundlePacket {
|
||||
@@ -50,4 +51,12 @@ public class AbstractConduitPacket<T extends IConduit> extends AbstractConduitBu
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
return (T) bundle.getConduit(getConType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if TileEntity received from client is actually the one player is interacting with. It prevents
|
||||
* malicious user disturbing random machine settings etc.
|
||||
*/
|
||||
protected static boolean isInvalidPacketForGui(AbstractConduitPacket<?> message, MessageContext ctx) {
|
||||
return PacketUtil.isInvalidPacketForGui(ctx, message.getTileEntity(message.getWorld(ctx)), message.getClass());
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ public class PacketConnectionMode extends AbstractConduitPacket<IConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketConnectionMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class PacketExtractMode extends AbstractConduitPacket<IExtractor>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketExtractMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setExtractionRedstoneMode(message.mode, message.dir);
|
||||
message.getTileCasted(ctx).setExtractionSignalColor(message.dir, message.color);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
|
||||
@@ -68,6 +68,7 @@ public class PacketItemConduitFilter extends AbstractConduitPacket<IItemConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketItemConduitFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
conduit.setSelfFeedEnabled(message.dir, message.loopMode);
|
||||
conduit.setRoundRobinEnabled(message.dir, message.roundRobin);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class PacketOCConduitSignalColor extends AbstractConduitPacket<IOCConduit
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketOCConduitSignalColor message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setSignalColor(message.dir, message.col);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
return null;
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ public class PacketRedstoneConduitOutputStrength extends AbstractConduitPacket<I
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRedstoneConduitOutputStrength message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IInsulatedRedstoneConduit tile = message.getTileCasted(ctx);
|
||||
if (tile != null) {
|
||||
tile.setOutputStrength(message.dir, message.isStrong);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class PacketRedstoneConduitSignalColor extends AbstractConduitPacket<IIns
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRedstoneConduitSignalColor message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setSignalColor(message.dir, message.col);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
return null;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRoundRobinMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
final ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit instanceof AbstractEnderLiquidConduit) {
|
||||
((AbstractEnderLiquidConduit) conduit).setRoundRobin(message.dir, message.roundRobin);
|
||||
|
||||
@@ -68,17 +68,21 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
public static void initIcons() {
|
||||
initIcons(POSTFIX, ICONS);
|
||||
}
|
||||
|
||||
protected static void initIcons(String[] postfix, Map<String, IIcon> icons) {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
for (String pf : postfix) {
|
||||
icons.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
icons.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
icons.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
icons.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
icons.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,6 +123,10 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
this.subtype = meta;
|
||||
}
|
||||
|
||||
protected int getSubtype() {
|
||||
return subtype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
|
||||
@@ -2,51 +2,20 @@ package crazypants.enderio.conduit.power.endergy;
|
||||
|
||||
import static crazypants.enderio.config.Config.powerConduitEndergyTiers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketConduitProbe;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IPowerInterface;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
public class PowerConduitEndergy extends PowerConduit {
|
||||
|
||||
@@ -76,487 +45,51 @@ public class PowerConduitEndergy extends PowerConduit {
|
||||
}
|
||||
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureType() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
initIcons(POSTFIX, ICONS);
|
||||
}
|
||||
|
||||
public static final float WIDTH = 0.075f;
|
||||
public static final float HEIGHT = 0.075f;
|
||||
|
||||
public static final Vector3d MIN = new Vector3d(0.5f - WIDTH, 0.5 - HEIGHT, 0.5 - WIDTH);
|
||||
public static final Vector3d MAX = new Vector3d(MIN.x + WIDTH, MIN.y + HEIGHT, MIN.z + WIDTH);
|
||||
|
||||
public static final BoundingBox BOUNDS = new BoundingBox(MIN, MAX);
|
||||
|
||||
protected PowerConduitNetwork network;
|
||||
|
||||
private int energyStoredRF;
|
||||
|
||||
private int subtype;
|
||||
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> rsModes = new EnumMap<ForgeDirection, RedstoneControlMode>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> rsColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected EnumMap<ForgeDirection, Long> recievedTicks;
|
||||
|
||||
private final Map<ForgeDirection, Integer> externalRedstoneSignals = new HashMap<ForgeDirection, Integer>();
|
||||
|
||||
private boolean redstoneStateDirty = true;
|
||||
|
||||
public PowerConduitEndergy() {}
|
||||
public PowerConduitEndergy() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PowerConduitEndergy(int meta) {
|
||||
this.subtype = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
if (ConduitUtil.isProbeEquipped(player)) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if (col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
setExtractionSignalColor(res.component.dir, col);
|
||||
return true;
|
||||
} else if (ToolUtil.isToolEquipped(player)) {
|
||||
if (!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
if (res != null && res.component != null) {
|
||||
ForgeDirection connDir = res.component.dir;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
if (connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
if (getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
return true;
|
||||
}
|
||||
// Attempt to join networks
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if (externalConnections.contains(connDir)) {
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
return true;
|
||||
} else if (containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isColorBandRendered(ForgeDirection dir) {
|
||||
return getConnectionMode(dir) != ConnectionMode.DISABLED
|
||||
&& getExtractionRedstoneMode(dir) != RedstoneControlMode.IGNORE;
|
||||
super(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return getCapacitors()[subtype];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
rsModes.put(dir, mode);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getExtractionRedstoneMode(ForgeDirection dir) {
|
||||
RedstoneControlMode res = rsModes.get(dir);
|
||||
if (res == null) {
|
||||
res = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionSignalColor(ForgeDirection dir, DyeColor col) {
|
||||
rsColors.put(dir, col);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DyeColor getExtractionSignalColor(ForgeDirection dir) {
|
||||
DyeColor res = rsColors.get(dir);
|
||||
if (res == null) {
|
||||
res = DyeColor.RED;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal());
|
||||
dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setShort("subtype", (short) subtype);
|
||||
nbtRoot.setInteger("energyStoredRF", energyStoredRF);
|
||||
|
||||
for (Entry<ForgeDirection, RedstoneControlMode> entry : rsModes.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsMode." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
|
||||
for (Entry<ForgeDirection, DyeColor> entry : rsColors.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsCol." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
subtype = nbtRoot.getShort("subtype");
|
||||
|
||||
if (nbtRoot.hasKey("energyStored")) {
|
||||
nbtRoot.setInteger("energyStoredRF", (int) (nbtRoot.getFloat("energyStored") * 10));
|
||||
}
|
||||
setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "pRsMode." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
rsModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
}
|
||||
}
|
||||
key = "pRsCol." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
rsColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
return energyStoredRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(int energyStored) {
|
||||
energyStoredRF = MathHelper.clamp_int(energyStored, 0, getMaxEnergyStored());
|
||||
}
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if (mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
}
|
||||
if (mode == RedstoneControlMode.IGNORE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DyeColor col = getExtractionSignalColor(dir);
|
||||
int signal = ConduitUtil.getInternalSignalForColor(getBundle(), col);
|
||||
int exSig = getExternalRedstoneSignalForDir(dir);
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int getExternalRedstoneSignalForDir(ForgeDirection dir) {
|
||||
if (redstoneStateDirty) {
|
||||
externalRedstoneSignals.clear();
|
||||
redstoneStateDirty = false;
|
||||
}
|
||||
Integer cached = externalRedstoneSignals.get(dir);
|
||||
int result;
|
||||
if (cached == null) {
|
||||
TileEntity te = getBundle().getEntity();
|
||||
result = te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord);
|
||||
externalRedstoneSignals.put(dir, result);
|
||||
} else {
|
||||
result = cached;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if (mode == ConnectionMode.OUTPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyExtracted(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if (mode == ConnectionMode.INPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
if (recievedRfThisTick(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyExtracted();
|
||||
}
|
||||
|
||||
private boolean recievedRfThisTick(ForgeDirection dir) {
|
||||
if (recievedTicks == null || dir == null
|
||||
|| recievedTicks.get(dir) == null
|
||||
|| getBundle() == null
|
||||
|| getBundle().getWorld() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long curTick = getBundle().getWorld().getTotalWorldTime();
|
||||
long recT = recievedTicks.get(dir);
|
||||
if (curTick - recT <= 5) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNeighborBlockChange(Block blockId) {
|
||||
redstoneStateDirty = true;
|
||||
if (network != null && network.powerManager != null) {
|
||||
network.powerManager.receptorsChanged();
|
||||
}
|
||||
return super.onNeighborBlockChange(blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
recievedTicks = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
if (getMaxEnergyRecieved(from) == 0 || maxReceive <= 0) {
|
||||
return 0;
|
||||
}
|
||||
int freeSpace = getMaxEnergyStored() - getEnergyStored();
|
||||
int result = (int) Math.min(maxReceive, freeSpace);
|
||||
if (!simulate && result > 0) {
|
||||
setEnergyStored(getEnergyStored() + result);
|
||||
|
||||
if (getBundle() != null) {
|
||||
if (recievedTicks == null) {
|
||||
recievedTicks = new EnumMap<ForgeDirection, Long>(ForgeDirection.class);
|
||||
}
|
||||
recievedTicks.put(from, getBundle().getWorld().getTotalWorldTime());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
this.network = (PowerConduitNetwork) network;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled) {
|
||||
IPowerInterface rec = getExternalPowerReceptor(direction);
|
||||
|
||||
return rec != null && rec.canConduitConnect(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit conduit) {
|
||||
boolean res = super.canConnectToConduit(direction, conduit);
|
||||
if (!res) {
|
||||
return false;
|
||||
}
|
||||
if (Config.powerConduitCanDifferentTiersConnect) {
|
||||
return res;
|
||||
}
|
||||
if (!(conduit instanceof IPowerConduit)) {
|
||||
return false;
|
||||
}
|
||||
IPowerConduit pc = (IPowerConduit) conduit;
|
||||
return pc.getMaxEnergyStored() == getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection direction) {
|
||||
super.externalConnectionAdded(direction);
|
||||
if (network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorAdded(
|
||||
this,
|
||||
direction,
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ,
|
||||
getExternalPowerReceptor(direction));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection direction) {
|
||||
super.externalConnectionRemoved(direction);
|
||||
if (network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorRemoved(
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerInterface getExternalPowerReceptor(ForgeDirection direction) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
World world = te.getWorldObj();
|
||||
if (world == null) {
|
||||
return null;
|
||||
}
|
||||
TileEntity test = world.getTileEntity(
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ);
|
||||
if (test == null) {
|
||||
return null;
|
||||
}
|
||||
if (test instanceof IConduitBundle) {
|
||||
return null;
|
||||
}
|
||||
return PowerHandlerUtil.create(test);
|
||||
return getCapacitors()[getSubtype()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return createItemStackForSubtype(subtype);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
return createItemStackForSubtype(getSubtype());
|
||||
}
|
||||
|
||||
// Rendering
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return ICONS.get(ICON_CORE_KEY + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_CORE_KEY + POSTFIX[getSubtype()]);
|
||||
}
|
||||
if (COLOR_CONTROLLER_ID.equals(component.data)) {
|
||||
return IconUtil.whiteTexture;
|
||||
}
|
||||
return ICONS.get(ICON_KEY + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[subtype]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CollidableComponent> createCollidables(CacheKey key) {
|
||||
Collection<CollidableComponent> baseCollidables = super.createCollidables(key);
|
||||
if (key.dir == ForgeDirection.UNKNOWN) {
|
||||
return baseCollidables;
|
||||
}
|
||||
|
||||
BoundingBox bb = ConduitGeometryUtil.instance.createBoundsForConnectionController(key.dir, key.offset);
|
||||
CollidableComponent cc = new CollidableComponent(IPowerConduit.class, bb, key.dir, COLOR_CONTROLLER_ID);
|
||||
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
result.addAll(baseCollidables);
|
||||
result.add(cc);
|
||||
|
||||
return result;
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return getCapacitors()[subtype].getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displayPower() {
|
||||
return true;
|
||||
return getCapacitors()[getSubtype()].getMaxEnergyStored();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit.redstone;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
|
||||
public interface IInsulatedRedstoneConduit extends IRedstoneConduit {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public interface IRedstoneConduit extends IConduit {
|
||||
|
||||
@@ -21,13 +21,12 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.tileentity.IRedstoneControl;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.tileentity.IRedstoneControl;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOutputNode;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -36,6 +34,7 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOutputNode;
|
||||
|
||||
public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit {
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.enderio.core.api.client.render.VertexTransform;
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.VertexRotation;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class RedstoneSwitchBounds {
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package crazypants.enderio.conduit.render;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
import static com.enderio.core.client.render.CubeRenderer.setupVertices;
|
||||
import static com.enderio.core.client.render.CubeRenderer.verts;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -84,8 +84,6 @@ public final class Config {
|
||||
public static boolean reinforcedObsidianEnabled = true;
|
||||
public static boolean reinforcedObsidianUseDarkSteelBlocks = false;
|
||||
|
||||
public static boolean enforceOfflinePlayerUUID = false;
|
||||
|
||||
public static boolean useAlternateBinderRecipe = false;
|
||||
|
||||
public static boolean useAlternateTesseractModel = false;
|
||||
@@ -323,6 +321,8 @@ public final class Config {
|
||||
public static boolean addFuelTooltipsToAllFluidContainers = true;
|
||||
public static boolean addFurnaceFuelTootip = true;
|
||||
public static boolean addDurabilityTootip = true;
|
||||
public static boolean renderDurabilityBar = true;
|
||||
public static boolean renderChargeBar = true;
|
||||
|
||||
public static int farmContinuousEnergyUseRF = 40;
|
||||
public static int farmActionEnergyUseRF = 500;
|
||||
@@ -563,6 +563,8 @@ public final class Config {
|
||||
public static float inventoryPanelExtractCostPerItem = 12.0f;
|
||||
public static float inventoryPanelExtractCostPerOperation = 32.0f;
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -1033,13 +1035,6 @@ public final class Config {
|
||||
"Enable per tick sampling on individual power inputs and outputs. This allows slightly more detailed messages from the RF Reader but has a negative impact on server performance.")
|
||||
.getBoolean(detailedPowerTrackingEnabled);
|
||||
|
||||
enforceOfflinePlayerUUID = config.get(
|
||||
sectionAdvanced.name,
|
||||
"enforceOfflinePlayerUUID",
|
||||
false,
|
||||
"Enforces to use the players offline UUID. Recommendet to use before creating your world, otherwise it might breaks all secuity related things.")
|
||||
.getBoolean(enforceOfflinePlayerUUID);
|
||||
|
||||
useSneakMouseWheelYetaWrench = config.get(
|
||||
sectionPersonal.name,
|
||||
"useSneakMouseWheelYetaWrench",
|
||||
@@ -1925,6 +1920,16 @@ public final class Config {
|
||||
"addFurnaceFuelTootip",
|
||||
addFuelTooltipsToAllFluidContainers,
|
||||
"If true, adds burn duration tooltips to furnace fuels").getBoolean(addFurnaceFuelTootip);
|
||||
renderChargeBar = config.get(
|
||||
sectionPersonal.name,
|
||||
"renderChargeBar",
|
||||
renderChargeBar,
|
||||
"If true, render the bar when an item has RF").getBoolean(renderChargeBar);
|
||||
renderDurabilityBar = config.get(
|
||||
sectionPersonal.name,
|
||||
"renderDurabilityBar",
|
||||
renderDurabilityBar,
|
||||
"If true, render the bar when an item is damaged").getBoolean(renderDurabilityBar);
|
||||
|
||||
farmContinuousEnergyUseRF = config.get(
|
||||
sectionFarm.name,
|
||||
@@ -2881,6 +2886,12 @@ public final class Config {
|
||||
0.0f,
|
||||
10000.0f,
|
||||
"Internal power used per extract operation (independent of stack size)");
|
||||
strictTPItemChecking = config.get(
|
||||
sectionMisc.name,
|
||||
"strictTPItemChecking",
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.EntityUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class EntityWitherSkeleton extends EntitySkeleton {
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.enderio.core.client.gui.GuiContainerBase;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public abstract class GuiContainerBaseEIO extends GuiContainerBase {
|
||||
|
||||
@@ -12,13 +12,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cofh.api.energy.ItemEnergyContainer;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cofh.api.energy.ItemEnergyContainer;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
@@ -237,4 +236,9 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return Config.renderDurabilityBar && super.showDurabilityBar(stack);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package crazypants.enderio.item;
|
||||
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.SOULARIUM;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@@ -20,11 +20,10 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cofh.api.block.IDismantleable;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
|
||||
import cofh.api.block.IDismantleable;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -27,14 +27,13 @@ import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
@@ -16,15 +16,10 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
@@ -42,6 +37,10 @@ import crazypants.enderio.item.darksteel.upgrade.NaturalistEyeUpgrade;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
|
||||
|
||||
@@ -24,12 +24,11 @@ import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -18,12 +18,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -332,6 +331,11 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
extractEnergy(equipped, power, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Math.min(getEnergyStored(equipped), power);
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,11 @@ import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -24,12 +24,11 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -395,6 +394,11 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
extractEnergy(equipped, power, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Math.min(getEnergyStored(equipped), power);
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,12 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
|
||||
public class PoweredItemRenderer implements IItemRenderer {
|
||||
@@ -44,26 +45,29 @@ public class PoweredItemRenderer implements IItemRenderer {
|
||||
ri.renderItemIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, 0, 0, true);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
if (isJustCrafted(item)) {
|
||||
if (isJustCrafted(item) || (!Config.renderChargeBar && !Config.renderDurabilityBar)) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasEnergyUpgrade = EnergyUpgrade.loadFromItem(item) != null;
|
||||
int y = hasEnergyUpgrade ? 12 : 13;
|
||||
int bgH = hasEnergyUpgrade ? 4 : 2;
|
||||
int y = (Config.renderDurabilityBar ^ Config.renderChargeBar) || !hasEnergyUpgrade ? 13 : 12;
|
||||
int bgH = (Config.renderDurabilityBar ^ Config.renderChargeBar) || !hasEnergyUpgrade ? 2 : 4;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderUtil.renderQuad2D(2, y, 0, 13, bgH, ColorUtil.getRGB(Color.black));
|
||||
|
||||
double maxDam = item.getMaxDamage();
|
||||
double dispDamage = item.getItemDamageForDisplay();
|
||||
y = hasEnergyUpgrade ? 14 : 13;
|
||||
renderBar(y, maxDam, dispDamage, Color.green, Color.red);
|
||||
double maxDam, dispDamage;
|
||||
if (Config.renderDurabilityBar) {
|
||||
maxDam = item.getMaxDamage();
|
||||
dispDamage = item.getItemDamageForDisplay();
|
||||
y = Config.renderChargeBar && hasEnergyUpgrade ? 14 : 13;
|
||||
renderBar(y, maxDam, dispDamage, Color.green, Color.red);
|
||||
}
|
||||
|
||||
if (hasEnergyUpgrade) {
|
||||
if (Config.renderChargeBar && hasEnergyUpgrade) {
|
||||
IEnergyContainerItem armor = (IEnergyContainerItem) item.getItem();
|
||||
maxDam = armor.getMaxEnergyStored(item);
|
||||
dispDamage = armor.getEnergyStored(item);
|
||||
y = 12;
|
||||
y = Config.renderDurabilityBar ? 12 : 13;
|
||||
Color color = new Color(0x2D, 0xCE, 0xFA); // electric blue
|
||||
renderBar2(y, maxDam, maxDam - dispDamage, color, color);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class SoundEntity extends Entity {
|
||||
|
||||
@@ -9,13 +9,13 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
|
||||
@Optional.Interface(iface = "thaumcraft.api.crafting.IInfusionStabiliser", modid = "Thaumcraft")
|
||||
public class BlockEndermanSkull extends BlockEio implements IInfusionStabiliser {
|
||||
|
||||
@@ -489,11 +489,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio
|
||||
if (stack == null || stack.stackTagCompound == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound root = stack.stackTagCompound;
|
||||
if (!root.hasKey("eio.abstractMachine")) {
|
||||
return;
|
||||
}
|
||||
readCommon(root);
|
||||
readCommon(stack.stackTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,9 +41,9 @@ public class AbstractMachineRenderer implements ISimpleBlockRenderingHandler, II
|
||||
private CustomCubeRenderer ccr = new CustomCubeRenderer();
|
||||
|
||||
private PaintedBlockRenderer paintedRenderer = new PaintedBlockRenderer(this.getRenderId(), null); // passthrough
|
||||
// renderer for
|
||||
// paintable
|
||||
// machines
|
||||
// renderer for
|
||||
// paintable
|
||||
// machines
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
@@ -9,7 +9,10 @@ import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.*;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity implements IInternalPoweredTile {
|
||||
|
||||
|
||||
@@ -2,19 +2,25 @@ package crazypants.enderio.machine;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class ContainerNoInv extends Container {
|
||||
import crazypants.enderio.machine.gui.IContainerWithTileEntity;
|
||||
|
||||
private IInventory inv;
|
||||
public class ContainerNoInv extends Container implements IContainerWithTileEntity {
|
||||
|
||||
public ContainerNoInv(IInventory inv) {
|
||||
super();
|
||||
this.inv = inv;
|
||||
private final AbstractMachineEntity tile;
|
||||
|
||||
public ContainerNoInv(AbstractMachineEntity tile) {
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return inv.isUseableByPlayer(player);
|
||||
return tile.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return tile;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import crazypants.enderio.machine.farm.FakeNetHandlerPlayServer;
|
||||
|
||||
public class FakePlayerEIO extends FakePlayer {
|
||||
|
||||
@@ -12,7 +12,6 @@ import crazypants.enderio.machine.recipe.RecipeBonusType;
|
||||
* progress' recipe for a machine is stored to and retrieved from a machines TileEntity soley based on its UID.
|
||||
*
|
||||
* @author cp
|
||||
*
|
||||
*/
|
||||
public interface IMachineRecipe {
|
||||
|
||||
@@ -50,7 +49,7 @@ public interface IMachineRecipe {
|
||||
/**
|
||||
* Returns the output from a single 'cycle' of the recipe (even if the inputs would allow the recipe to be crafted
|
||||
* several times).
|
||||
*
|
||||
* <p>
|
||||
* This method must not return null. If no output is generated an empty array should be returned.
|
||||
*
|
||||
* @param randomChance a random number to be used as a seed for determining whether '% chance' outputs are returned.
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import static crazypants.enderio.EnderIO.itemBasicCapacitor;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.util.RecipeUtil.*;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_GOLD;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_IRON;
|
||||
import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.SOULARIUM;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.ENDER_CRYSTAL;
|
||||
import static crazypants.enderio.material.Material.PULSATING_CYSTAL;
|
||||
import static crazypants.enderio.material.Material.SILICON;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -24,6 +34,7 @@ import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.util.RecipeUtil;
|
||||
|
||||
public class MachineRecipes {
|
||||
|
||||
@@ -62,13 +73,24 @@ public class MachineRecipes {
|
||||
String silicon = SILICON.oreDict;
|
||||
|
||||
if (Config.addPeacefulRecipes) {
|
||||
addShaped(frankenZombie, "gdg", "dzd", "gdg", 'g', "ingotGold", 'd', "gemDiamond", 'z', zombieController);
|
||||
addShaped(sentientEnder, "ddd", "ded", "dgd", 'g', "blockGold", 'd', "gemDiamond", 'e', enderRes);
|
||||
RecipeUtil.addShaped(
|
||||
frankenZombie,
|
||||
"gdg",
|
||||
"dzd",
|
||||
"gdg",
|
||||
'g',
|
||||
"ingotGold",
|
||||
'd',
|
||||
"gemDiamond",
|
||||
'z',
|
||||
zombieController);
|
||||
RecipeUtil
|
||||
.addShaped(sentientEnder, "ddd", "ded", "dgd", 'g', "blockGold", 'd', "gemDiamond", 'e', enderRes);
|
||||
}
|
||||
|
||||
// stirling gen
|
||||
ItemStack stirlingGen = new ItemStack(EnderIO.blockStirlingGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
stirlingGen,
|
||||
"bbb",
|
||||
"bfb",
|
||||
@@ -85,7 +107,7 @@ public class MachineRecipes {
|
||||
// Combustion Gen
|
||||
ItemStack res = new ItemStack(EnderIO.blockTank, 1, 0);
|
||||
ItemStack comGen = new ItemStack(EnderIO.blockCombustionGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
comGen,
|
||||
"eee",
|
||||
"rmr",
|
||||
@@ -103,7 +125,7 @@ public class MachineRecipes {
|
||||
|
||||
// ZombieGen
|
||||
ItemStack zg = new ItemStack(EnderIO.blockZombieGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
zg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -117,7 +139,7 @@ public class MachineRecipes {
|
||||
|
||||
// FrankenzombieGen
|
||||
ItemStack fg = new ItemStack(EnderIO.blockFrankenZombieGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
fg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -131,7 +153,7 @@ public class MachineRecipes {
|
||||
|
||||
// EnderGen
|
||||
ItemStack eg = new ItemStack(EnderIO.blockEnderGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
eg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -145,17 +167,18 @@ public class MachineRecipes {
|
||||
|
||||
// KillerJoe
|
||||
ItemStack kj = new ItemStack(EnderIO.blockKillerJoe, 1, 0);
|
||||
addShaped(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', frankenZombie);
|
||||
RecipeUtil.addShaped(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', frankenZombie);
|
||||
|
||||
// Wireless charger
|
||||
ItemStack wirelessCharger = new ItemStack(EnderIO.blockWirelessCharger);
|
||||
// addShaped(wirelessCharger, "svs", "imi", "scs", 's', electricSteel, 'i', silicon, 'm', machineChassi, 'c',
|
||||
// capacitor3, 'v', vibCry);
|
||||
addShaped(wirelessCharger, "sss", "ses", "scs", 's', electricalSteel, 'c', capacitor3, 'e', enderRes);
|
||||
RecipeUtil
|
||||
.addShaped(wirelessCharger, "sss", "ses", "scs", 's', electricalSteel, 'c', capacitor3, 'e', enderRes);
|
||||
|
||||
// Crafter
|
||||
ItemStack crafter = new ItemStack(EnderIO.blockCrafter, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crafter,
|
||||
"iti",
|
||||
"imi",
|
||||
@@ -177,7 +200,7 @@ public class MachineRecipes {
|
||||
} else {
|
||||
zombieBit = zombieController;
|
||||
}
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredSpawner,
|
||||
"ese",
|
||||
"eme",
|
||||
@@ -202,15 +225,16 @@ public class MachineRecipes {
|
||||
} else {
|
||||
glassSides = "glass";
|
||||
}
|
||||
addShaped(reservoir, "gfg", "gcg", "gfg", 'g', glassSides, 'c', Items.cauldron, 'f', fusedQuartz);
|
||||
RecipeUtil
|
||||
.addShaped(reservoir, "gfg", "gcg", "gfg", 'g', glassSides, 'c', Items.cauldron, 'f', fusedQuartz);
|
||||
}
|
||||
|
||||
// Tanks
|
||||
ItemStack basicTank = new ItemStack(EnderIO.blockTank, 1, 0);
|
||||
addShaped(basicTank, "ibi", "bgb", "ibi", 'g', "glass", 'i', "ingotIron", 'b', Blocks.iron_bars);
|
||||
RecipeUtil.addShaped(basicTank, "ibi", "bgb", "ibi", 'g', "glass", 'i', "ingotIron", 'b', Blocks.iron_bars);
|
||||
|
||||
ItemStack advTank = new ItemStack(EnderIO.blockTank, 1, 1);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advTank,
|
||||
"ibi",
|
||||
"bgb",
|
||||
@@ -225,7 +249,7 @@ public class MachineRecipes {
|
||||
// mill
|
||||
ItemStack crusher = new ItemStack(EnderIO.blockCrusher, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crusher,
|
||||
"ooo",
|
||||
"fmf",
|
||||
@@ -241,7 +265,7 @@ public class MachineRecipes {
|
||||
'o',
|
||||
Blocks.obsidian);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crusher,
|
||||
"fff",
|
||||
"imi",
|
||||
@@ -259,7 +283,7 @@ public class MachineRecipes {
|
||||
// alloy smelter
|
||||
ItemStack alloySmelter = new ItemStack(EnderIO.blockAlloySmelter, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
alloySmelter,
|
||||
"bfb",
|
||||
"fmf",
|
||||
@@ -273,7 +297,7 @@ public class MachineRecipes {
|
||||
'f',
|
||||
Blocks.furnace);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
alloySmelter,
|
||||
"bfb",
|
||||
"fmf",
|
||||
@@ -290,7 +314,7 @@ public class MachineRecipes {
|
||||
|
||||
// Vat
|
||||
ItemStack still = new ItemStack(EnderIO.blockVat, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
still,
|
||||
"eve",
|
||||
"tmt",
|
||||
@@ -310,13 +334,14 @@ public class MachineRecipes {
|
||||
|
||||
ItemStack capBank1 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.SIMPLE), 0);
|
||||
addShaped(capBank1, "bcb", "cmc", "bcb", 'b', "ingotIron", 'c', capacitor, 'm', "blockRedstone");
|
||||
RecipeUtil.addShaped(capBank1, "bcb", "cmc", "bcb", 'b', "ingotIron", 'c', capacitor, 'm', "blockRedstone");
|
||||
ItemStack capBank2 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.ACTIVATED), 0);
|
||||
addShaped(capBank2, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor2, 'm', "blockRedstone");
|
||||
RecipeUtil
|
||||
.addShaped(capBank2, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor2, 'm', "blockRedstone");
|
||||
ItemStack capBank3 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
RecipeUtil.addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
@@ -351,7 +376,7 @@ public class MachineRecipes {
|
||||
// painter
|
||||
ItemStack painter = new ItemStack(EnderIO.blockPainter, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
painter,
|
||||
"qqq",
|
||||
"mdm",
|
||||
@@ -367,7 +392,7 @@ public class MachineRecipes {
|
||||
'd',
|
||||
"gemDiamond");
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
painter,
|
||||
"qdq",
|
||||
"mMm",
|
||||
@@ -391,7 +416,7 @@ public class MachineRecipes {
|
||||
} else {
|
||||
zombieBit = zombieController;
|
||||
}
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
farm,
|
||||
"ehe",
|
||||
"eme",
|
||||
@@ -411,7 +436,7 @@ public class MachineRecipes {
|
||||
// transceiver
|
||||
ItemStack transceiver = new ItemStack(EnderIO.blockTransceiver, 1, 0);
|
||||
if (Config.transceiverUseEasyRecipe) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
transceiver,
|
||||
"oeo",
|
||||
"pdp",
|
||||
@@ -427,7 +452,7 @@ public class MachineRecipes {
|
||||
'd',
|
||||
Items.diamond);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
transceiver,
|
||||
"oeo",
|
||||
"pdp",
|
||||
@@ -442,7 +467,7 @@ public class MachineRecipes {
|
||||
fusedQuartz,
|
||||
'd',
|
||||
endCry);
|
||||
addShapeless(transceiver, new ItemStack(EnderIO.blockHyperCube, 1, 0));
|
||||
RecipeUtil.addShapeless(transceiver, new ItemStack(EnderIO.blockHyperCube, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +479,7 @@ public class MachineRecipes {
|
||||
ItemStack vibSolarPanel = new ItemStack(EnderIO.blockSolarPanel, 1, 2);
|
||||
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
solarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -469,7 +494,7 @@ public class MachineRecipes {
|
||||
energeticAlloy,
|
||||
'p',
|
||||
phasedGold);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -484,7 +509,7 @@ public class MachineRecipes {
|
||||
phasedIron,
|
||||
'p',
|
||||
phasedGold);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
vibSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -500,7 +525,7 @@ public class MachineRecipes {
|
||||
'p',
|
||||
phasedGold);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
solarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -515,7 +540,7 @@ public class MachineRecipes {
|
||||
energeticAlloy,
|
||||
'c',
|
||||
redstoneAlloy);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -530,7 +555,7 @@ public class MachineRecipes {
|
||||
phasedIron,
|
||||
'c',
|
||||
electricalSteel);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
vibSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -553,7 +578,7 @@ public class MachineRecipes {
|
||||
ItemStack powerConduit = new ItemStack(EnderIO.itemPowerConduit, 1, 0);
|
||||
ItemStack redstoneConduit = new ItemStack(EnderIO.itemRedstoneConduit, 1, 2);
|
||||
ItemStack mJMonitor = new ItemStack(EnderIO.blockPowerMonitor, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
mJMonitor,
|
||||
"sms",
|
||||
"sMs",
|
||||
@@ -571,11 +596,11 @@ public class MachineRecipes {
|
||||
|
||||
// Enchanter
|
||||
ItemStack enchanter = new ItemStack(EnderIO.blockEnchanter);
|
||||
addShaped(enchanter, "dbd", "sss", " s ", 'd', "gemDiamond", 'b', Items.book, 's', darkSteel);
|
||||
RecipeUtil.addShaped(enchanter, "dbd", "sss", " s ", 'd', "gemDiamond", 'b', Items.book, 's', darkSteel);
|
||||
|
||||
// Vacuum Chest
|
||||
ItemStack vacuumChest = new ItemStack(EnderIO.blockVacuumChest);
|
||||
addShaped(vacuumChest, "iii", "ici", "ipi", 'i', "ingotIron", 'c', "chestWood", 'p', pulCry);
|
||||
RecipeUtil.addShaped(vacuumChest, "iii", "ici", "ipi", 'i', "ingotIron", 'c', "chestWood", 'p', pulCry);
|
||||
|
||||
// Soul Binder
|
||||
Object enderBit;
|
||||
@@ -588,7 +613,7 @@ public class MachineRecipes {
|
||||
ItemStack zombieSkull = new ItemStack(Items.skull, 1, 4);
|
||||
ItemStack skeletonSkull = new ItemStack(Items.skull, 1, 0);
|
||||
ItemStack soulBinder = new ItemStack(EnderIO.blockSoulFuser);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
soulBinder,
|
||||
"ses",
|
||||
"zmc",
|
||||
@@ -609,7 +634,7 @@ public class MachineRecipes {
|
||||
// Attractor
|
||||
ItemStack attractor = new ItemStack(EnderIO.blockAttractor);
|
||||
ItemStack attractorCrystal = new ItemStack(EnderIO.itemMaterial, 1, Material.ATTRACTOR_CRYSTAL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
attractor,
|
||||
" c ",
|
||||
"ese",
|
||||
@@ -629,7 +654,7 @@ public class MachineRecipes {
|
||||
EnderIO.blockEndermanSkull,
|
||||
1,
|
||||
BlockEndermanSkull.SkullType.TORMENTED.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
aversion,
|
||||
" c ",
|
||||
"ese",
|
||||
@@ -646,12 +671,12 @@ public class MachineRecipes {
|
||||
// Experience
|
||||
ItemStack xp = new ItemStack(EnderIO.blockExperianceOblisk);
|
||||
ItemStack xpItem = new ItemStack(EnderIO.itemXpTransfer);
|
||||
addShaped(xp, " x ", " s ", "sms", 's', soularium, 'm', machineChassi, 'x', xpItem);
|
||||
RecipeUtil.addShaped(xp, " x ", " s ", "sms", 's', soularium, 'm', machineChassi, 'x', xpItem);
|
||||
|
||||
// Weather
|
||||
ItemStack weather = new ItemStack(EnderIO.blockWeatherObelisk);
|
||||
ItemStack weatherItem = new ItemStack(EnderIO.itemMaterial, 1, Material.WEATHER_CRYSTAL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
weather,
|
||||
" x ",
|
||||
"ese",
|
||||
@@ -686,14 +711,14 @@ public class MachineRecipes {
|
||||
EnderIO.blockElectricLight,
|
||||
1,
|
||||
BlockItemElectricLight.Type.WIRELESS_INV.ordinal());
|
||||
addShapeless(wirelessLamp, poweredLamp, enderRes);
|
||||
addShapeless(wirelessLamp, wirelessLampInv, Blocks.redstone_torch);
|
||||
addShapeless(wirelessLampInv, poweredLampInv, enderRes);
|
||||
addShapeless(wirelessLampInv, wirelessLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(wirelessLamp, poweredLamp, enderRes);
|
||||
RecipeUtil.addShapeless(wirelessLamp, wirelessLampInv, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(wirelessLampInv, poweredLampInv, enderRes);
|
||||
RecipeUtil.addShapeless(wirelessLampInv, wirelessLamp, Blocks.redstone_torch);
|
||||
|
||||
// inventory panel
|
||||
ItemStack awareness = new ItemStack(EnderIO.itemFunctionUpgrade, 1, FunctionUpgrade.INVENTORY_PANEL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
awareness,
|
||||
"bsb",
|
||||
"ses",
|
||||
@@ -707,7 +732,7 @@ public class MachineRecipes {
|
||||
'i',
|
||||
electricalSteel);
|
||||
ItemStack invPanel = new ItemStack(EnderIO.blockInventoryPanel);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
invPanel,
|
||||
"dad",
|
||||
"psp",
|
||||
@@ -727,7 +752,7 @@ public class MachineRecipes {
|
||||
|
||||
// powered light
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredLamp,
|
||||
"ggg",
|
||||
"sds",
|
||||
@@ -741,7 +766,7 @@ public class MachineRecipes {
|
||||
'c',
|
||||
capacitor);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredLamp,
|
||||
"ggg",
|
||||
"sds",
|
||||
@@ -756,19 +781,19 @@ public class MachineRecipes {
|
||||
capacitor);
|
||||
}
|
||||
ItemStack invPoweredLamp = new ItemStack(EnderIO.blockElectricLight, 1, 1);
|
||||
addShapeless(invPoweredLamp, poweredLamp, Blocks.redstone_torch);
|
||||
addShapeless(poweredLamp, invPoweredLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(invPoweredLamp, poweredLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(poweredLamp, invPoweredLamp, Blocks.redstone_torch);
|
||||
|
||||
// light
|
||||
ItemStack lamp = new ItemStack(EnderIO.blockElectricLight, 1, 2);
|
||||
addShaped(lamp, " ", "ggg", "isi", 'g', "glass", 's', "glowstone", 'i', "ingotIron");
|
||||
RecipeUtil.addShaped(lamp, " ", "ggg", "isi", 'g', "glass", 's', "glowstone", 'i', "ingotIron");
|
||||
ItemStack invLamp = new ItemStack(EnderIO.blockElectricLight, 1, 3);
|
||||
addShapeless(invLamp, lamp, Blocks.redstone_torch);
|
||||
addShapeless(lamp, invLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(invLamp, lamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(lamp, invLamp, Blocks.redstone_torch);
|
||||
|
||||
// MJ Reader
|
||||
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
mJReader,
|
||||
"epe",
|
||||
"gcg",
|
||||
@@ -788,7 +813,7 @@ public class MachineRecipes {
|
||||
|
||||
// Slice'N'Splice
|
||||
ItemStack sns = new ItemStack(EnderIO.blockSliceAndSplice);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
sns,
|
||||
"iki",
|
||||
"ams",
|
||||
@@ -808,8 +833,28 @@ public class MachineRecipes {
|
||||
ItemStack itemBuffer = Type.getStack(Type.ITEM);
|
||||
ItemStack powerBuffer = Type.getStack(Type.POWER);
|
||||
ItemStack omniBuffer = Type.getStack(Type.OMNI);
|
||||
addShaped(itemBuffer, "isi", "scs", "isi", 'i', "ingotIron", 's', "ingotElectricalSteel", 'c', "chestWood");
|
||||
addShaped(powerBuffer, "isi", "sfs", "isi", 'i', "ingotIron", 's', "ingotElectricalSteel", 'f', machineChassis);
|
||||
addShapeless(omniBuffer, itemBuffer, powerBuffer);
|
||||
RecipeUtil.addShaped(
|
||||
itemBuffer,
|
||||
"isi",
|
||||
"scs",
|
||||
"isi",
|
||||
'i',
|
||||
"ingotIron",
|
||||
's',
|
||||
"ingotElectricalSteel",
|
||||
'c',
|
||||
"chestWood");
|
||||
RecipeUtil.addShaped(
|
||||
powerBuffer,
|
||||
"isi",
|
||||
"sfs",
|
||||
"isi",
|
||||
'i',
|
||||
"ingotIron",
|
||||
's',
|
||||
"ingotElectricalSteel",
|
||||
'f',
|
||||
machineChassis);
|
||||
RecipeUtil.addShapeless(omniBuffer, itemBuffer, powerBuffer);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMessage> {
|
||||
@@ -61,6 +62,7 @@ public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMe
|
||||
public IMessage onMessage(PacketIoMode message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te instanceof IIoConfigurable) {
|
||||
IIoConfigurable me = (IIoConfigurable) te;
|
||||
if (message.face == ForgeDirection.UNKNOWN) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketItemBuffer implements IMessage, IMessageHandler<PacketItemBuffer, IMessage> {
|
||||
@@ -47,6 +48,7 @@ public class PacketItemBuffer implements IMessage, IMessageHandler<PacketItemBuf
|
||||
public IMessage onMessage(PacketItemBuffer message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te instanceof IItemBuffer) {
|
||||
((IItemBuffer) te).setBufferStacks(message.bufferStacks);
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketProgress extends MessageTileEntity<TileEntity> implements IMessageHandler<PacketProgress, IMessage> {
|
||||
|
||||
private float progress;
|
||||
|
||||
public PacketProgress() {}
|
||||
|
||||
public PacketProgress(IProgressTile tile) {
|
||||
super(tile.getTileEntity());
|
||||
progress = tile.getProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeFloat(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
progress = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketProgress message, MessageContext ctx) {
|
||||
TileEntity tile = message.getTileEntity(EnderIO.proxy.getClientWorld());
|
||||
if (tile instanceof IProgressTile) {
|
||||
((IProgressTile) tile).setProgress(message.progress);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketRedstoneMode implements IMessage, IMessageHandler<PacketRedstoneMode, IMessage> {
|
||||
@@ -52,6 +53,7 @@ public class PacketRedstoneMode implements IMessage, IMessageHandler<PacketRedst
|
||||
public IMessage onMessage(PacketRedstoneMode message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te instanceof IRedstoneModeControlable) {
|
||||
IRedstoneModeControlable me = (IRedstoneModeControlable) te;
|
||||
me.setRedstoneControlMode(message.mode);
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.enderio.core.client.render.TechneUtil;
|
||||
import com.enderio.core.client.render.VertexRotationFacing;
|
||||
import com.enderio.core.client.render.VertexTransformComposite;
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public class TechneMachineRenderer<T extends AbstractMachineEntity> extends TechneModelRenderer {
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import crazypants.enderio.machine.gui.AbstractMachineContainer;
|
||||
|
||||
public class ContainerAlloySmelter extends AbstractMachineContainer<TileAlloySmelter> {
|
||||
|
||||
Loaded 100 of 205 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user