Compare commits

..
2 Commits
36 changed files with 221 additions and 372 deletions

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/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
+1 -7
View File
@@ -26,13 +26,7 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*([!.]).json
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+104 -104
View File
@@ -1,4 +1,4 @@
//version: 1704751096
//version: 1689409577
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -28,11 +28,27 @@ import java.util.concurrent.TimeUnit
buildscript {
repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
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()
}
}
@@ -48,12 +64,12 @@ plugins {
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 '8.1.1' apply false
id 'com.palantir.git-version' version '3.0.0' apply false
id 'de.undercouch.download' version '5.5.0'
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.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.3.27'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.19'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -73,23 +89,6 @@ 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")
@@ -117,7 +116,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true)
propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
@@ -141,17 +140,6 @@ if (!disableSpotless) {
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/"
@@ -286,7 +274,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)
@@ -413,13 +401,9 @@ if (identifiedVersion == versionOverride) {
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
base {
archivesName = customArchiveBaseName
}
archivesBaseName = customArchiveBaseName
} else {
base {
archivesName = modId
}
archivesBaseName = modId
}
@@ -571,16 +555,17 @@ afterEvaluate {
}
repositories {
maven {
name = "GTNH Maven"
url = "https://nexus.gtnewhorizons.com/repository/public/"
// Links for convenience:
// Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/
// Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases
}
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
name 'sonatype'
@@ -590,34 +575,24 @@ repositories {
}
}
if (includeWellKnownRepositories.toBoolean()) {
exclusiveContent {
forRepository {
maven {
name "CurseMaven"
url "https://cursemaven.com"
}
}
filter {
maven {
name "CurseMaven"
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven {
name = "ic2"
url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
content {
includeGroup "net.industrial-craft"
url = "https://maven.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
}
}
maven {
name = "ic2-mirror"
url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
@@ -632,13 +607,11 @@ repositories {
def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.13"
def mixinProviderVersion = "0.1.7.1"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
@@ -650,7 +623,7 @@ dependencies {
}
}
if (usesMixins.toBoolean()) {
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
implementation(mixinProviderSpec)
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
@@ -673,8 +646,6 @@ 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')
}
}
@@ -705,6 +676,11 @@ if (file('dependencies.gradle.kts').exists()) {
throw new RuntimeException("Missing dependencies.gradle[.kts]")
}
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"
tasks.register('generateAssets') {
group = "GTNH Buildscript"
description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed"
@@ -735,17 +711,46 @@ 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 {
@@ -763,6 +768,7 @@ tasks.named("processResources", ProcessResources).configure {
}
if (usesMixins.toBoolean()) {
from refMap
dependsOn("compileJava", "compileScala")
}
}
@@ -781,14 +787,23 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.5.7'
def lwjgl3ifyVersion = '1.4.0'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19')
}
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}
}
@@ -961,7 +976,8 @@ if (usesShadowedDependencies.toBoolean()) {
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
tasks.named("jar", Jar) {
archiveClassifier.set('dev-preshadow')
enabled = false
finalizedBy(tasks.shadowJar)
}
tasks.named("reobfJar", ReobfuscatedJar) {
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
@@ -970,6 +986,11 @@ if (usesShadowedDependencies.toBoolean()) {
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
tasks.named(runTask).configure {
dependsOn("shadowJar")
}
}
}
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar
@@ -1145,10 +1166,7 @@ tasks.named("processIdeaSettings").configure {
tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar")
if (!disableSpotless) {
dependsOn("spotlessCheck")
}
dependsOn("jar", "reobfJar", "spotlessCheck")
}
// workaround variable hiding in pom processing
@@ -1169,11 +1187,12 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
}
}
repositories {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
if (usesMavenPublishing.toBoolean()) {
maven {
url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
@@ -1292,7 +1311,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.5"
def buildscriptGradleVersion = "8.1.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
@@ -1571,25 +1590,6 @@ def getSecondaryArtifacts() {
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'
+5 -5
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.1.0:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.12-pre:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.73-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.34:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
compileOnly('curse.maven:cofh-lib-220333:2388748')
}
Binary file not shown.
+1 -2
View File
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+12 -17
View File
@@ -83,8 +83,10 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
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
@@ -131,13 +133,10 @@ location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -145,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=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -153,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=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -198,15 +197,11 @@ 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, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
+22
View File
@@ -1,4 +1,26 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'http://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
maven {
url 'https://jitpack.io'
}
}
+5 -4
View File
@@ -4,9 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
mavenContent {
includeGroupByRegex("com\\.gtnewhorizons\\..+")
includeGroup("com.gtnewhorizons.retrofuturagradle")
}
}
gradlePluginPortal()
@@ -16,8 +17,8 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}
blowdryerSetup {
@@ -88,7 +88,7 @@ public class ItemInsulatedTube extends Item {
enum Material {
Copper(0xe3b78e, "copper"),
Copper(0xe3b78e, "cooper"),
Tin(0xe1eef4, "tin"),
Bronze(0xddc276, "bronze"),
Iron(0xd8d8d8, "iron");
@@ -92,7 +92,6 @@ public enum EnumFlowerColor implements IFlowerColor {
YELLOW("yellow", 0xffff00),
YELLOW_GREEN("yellowGreen", 0x9acd32);
private static final EnumFlowerColor[] ALL_VALUES = values();
private int color;
private int colorDis;
private String name;
@@ -2964,7 +2963,7 @@ public enum EnumFlowerColor implements IFlowerColor {
}
public static EnumFlowerColor get(int i) {
return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
return values()[Math.max(0, i) % values().length];
}
@Override
-2
View File
@@ -12,7 +12,6 @@ public class Mods {
public static Mod forestry;
public static Mod ic2;
public static Mod botania;
public static Mod extraBiomes;
private static Item findItem(String modId, String name) {
Item stack = GameRegistry.findItem(modId, name);
@@ -42,7 +41,6 @@ public class Mods {
Mods.forestry = new Mod("Forestry");
Mods.ic2 = new Mod("IC2");
Mods.botania = new Mod("Botania");
Mods.extraBiomes = new Mod("ExtrabiomesXL");
}
public static class Mod {
@@ -11,7 +11,6 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
@@ -31,8 +30,6 @@ import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IBorder;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.nei.NEIHook;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -79,8 +76,6 @@ public class GuiCraftGUI extends GuiContainer {
@Override
public void drawScreen(int mouseX, int mouseY, float par3) {
NEIHook.preDraw();
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
drawDefaultBackground();
@@ -94,9 +89,6 @@ public class GuiCraftGUI extends GuiContainer {
window.render();
RenderHelper.enableGUIStandardItemLighting();
NEIHook.renderObjects(window, mouseX, mouseY);
GL11.glPushMatrix();
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
@@ -121,8 +113,6 @@ public class GuiCraftGUI extends GuiContainer {
if (tooltip.exists()) {
renderTooltip(new IPoint(mouseX, mouseY), tooltip);
} else {
NEIHook.renderToolTips(mouseX, mouseY);
}
zLevel = 0.0f;
GL11.glEnable(GL11.GL_LIGHTING);
@@ -229,8 +219,6 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void mouseClicked(int x, int y, int button) {
NEIHook.mouseClicked(x, y, button);
IWidget origin = window;
if (window.getMousedOverWidget() != null) {
origin = window.getMousedOverWidget();
@@ -240,8 +228,6 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void keyTyped(char c, int key) {
NEIHook.lastKeyTyped(key, c);
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
mc.thePlayer.closeScreen();
}
@@ -255,7 +241,6 @@ public class GuiCraftGUI extends GuiContainer {
if (button != -1) {
window.callEvent(new EventMouse.Up(origin, x, y, button));
}
NEIHook.mouseUp(x, y, button);
}
@Override
@@ -265,8 +250,6 @@ public class GuiCraftGUI extends GuiContainer {
if (dWheel != 0) {
window.callEvent(new EventMouse.Wheel(window, dWheel));
}
NEIHook.handleMouseWheel();
}
@Override
@@ -523,9 +506,4 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public ItemStack getStackUnderMouse(int x, int y) {
return window.calculateMousedOverWidgets().stream().filter(widget -> widget instanceof ControlSlot).findFirst()
.map(w -> ((ControlSlot) w).slot).map(Slot::getStack).orElse(null);
}
}
@@ -29,7 +29,6 @@ import binnie.core.craftgui.minecraft.control.ControlHelp;
import binnie.core.craftgui.minecraft.control.ControlInfo;
import binnie.core.craftgui.minecraft.control.ControlPowerSystem;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlSlotBase;
import binnie.core.craftgui.minecraft.control.ControlUser;
import binnie.core.craftgui.minecraft.control.EnumHighlighting;
import binnie.core.craftgui.renderer.Renderer;
@@ -41,7 +40,6 @@ import binnie.core.machines.Machine;
import binnie.core.machines.inventory.IInventoryMachine;
import binnie.core.machines.network.INetwork;
import binnie.core.machines.power.PowerSystem;
import binnie.core.nei.NEIHook;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.resource.BinnieResource;
import binnie.core.resource.ResourceType;
@@ -120,9 +118,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
if (!widget.calculateIsMouseOver()) {
continue;
}
if (NEIHook.enabled && widget instanceof ControlSlotBase) {
return;
}
if (widget instanceof ITooltip) {
((ITooltip) widget).getTooltip(tooltip);
if (tooltip.exists()) {
@@ -122,7 +122,7 @@ public class TransferRequest {
|| ((IInventorySlots) destination).getSlot(slot) == null
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
if (destination.getStackInSlot(slot) != null) {
if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
if (item.isStackable()) {
ItemStack merged = destination.getStackInSlot(slot).copy();
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
item = newStacks[0];
@@ -158,9 +158,8 @@ public class TransferRequest {
if (item.stackSize <= 0) {
item = null;
}
return item;
}
return null;
return item;
}
}
}
@@ -1,49 +0,0 @@
package binnie.core.nei;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import binnie.core.craftgui.minecraft.GuiCraftGUI;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.common.Optional;
@Optional.Interface(
iface = "codechicken.nei.guihook.IContainerObjectHandler",
modid = "NotEnoughItems",
striprefs = true)
public final class ContainerObjectHandler implements IContainerObjectHandler {
@Override
public void guiTick(GuiContainer gui) {
}
@Override
public void refresh(GuiContainer gui) {
}
@Override
public void load(GuiContainer gui) {
}
@Override
public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
if (gui instanceof GuiCraftGUI) {
return ((GuiCraftGUI) gui).getStackUnderMouse(mousex, mousey);
} else {
return null;
}
}
@Override
public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) {
return false;
}
@Override
public boolean shouldShowTooltip(GuiContainer gui) {
return true;
}
}
-107
View File
@@ -1,107 +0,0 @@
package binnie.core.nei;
import org.lwjgl.opengl.GL11;
import binnie.core.craftgui.minecraft.Window;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class NEIHook {
public static boolean enabled = false;
static {
if (Loader.isModLoaded("NotEnoughItems")) {
enabled = true;
addHandler();
}
}
@Optional.Method(modid = "NotEnoughItems")
private static void addHandler() {
GuiContainerManager.addObjectHandler(new ContainerObjectHandler());
}
@Optional.Method(modid = "NotEnoughItems")
private static GuiContainerManager getManager() {
return GuiContainerManager.getManager();
}
@Optional.Method(modid = "NotEnoughItems")
private static void preDrawImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.preDraw();
}
public static void preDraw() {
if (enabled) preDrawImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderObjectsImpl(Window window, int mouseX, int mouseY) {
GL11.glPushMatrix();
GL11.glTranslatef(window.x(), window.y(), 0.0f);
GuiContainerManager manager = getManager();
if (manager != null) manager.renderObjects(mouseX, mouseY);
GL11.glTranslatef(-window.x(), -window.y(), 0.0f);
GL11.glPopMatrix();
}
public static void renderObjects(Window window, int mouseX, int mouseY) {
if (enabled) renderObjectsImpl(window, mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderToolTipsImpl(int mouseX, int mouseY) {
GuiContainerManager manager = getManager();
if (manager != null) manager.renderToolTips(mouseX, mouseY);
}
public static void renderToolTips(int mouseX, int mouseY) {
if (enabled) renderToolTipsImpl(mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseClickedImpl(int x, int y, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseClicked(x, y, button);
}
public static void mouseClicked(int x, int y, int button) {
if (enabled) mouseClickedImpl(x, y, button);
}
@Optional.Method(modid = "NotEnoughItems")
private static void lastKeyTypedImpl(int k, char c) {
GuiContainerManager manager = getManager();
if (manager != null) manager.lastKeyTyped(k, c);
}
public static void lastKeyTyped(int k, char c) {
if (enabled) lastKeyTypedImpl(k, c);
}
@Optional.Method(modid = "NotEnoughItems")
private static void handleMouseWheelImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.handleMouseWheel();
}
public static void handleMouseWheel() {
if (enabled) handleMouseWheelImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseUpImpl(int mouseX, int mouseY, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseUp(mouseX, mouseY, button);
}
public static void mouseUp(int mouseX, int mouseY, int button) {
if (enabled) mouseUpImpl(mouseX, mouseY, button);
}
}
+1 -5
View File
@@ -2,11 +2,7 @@ package binnie.core.nei;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.*;
public class NEIUtils {
@@ -1,7 +1,6 @@
package binnie.core.nei;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.core.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -1,7 +1,6 @@
package binnie.core.nei;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -36,7 +36,7 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
public static void init() {
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.25f);
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.5f, 2.0f);// was 1.5x lim 5.0x
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.TERRITORY, 0.5f, 0.1f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.PRODUCTION, -0.25f, 0.0f);// was 0.75x lim 0.5x
@@ -20,8 +20,8 @@ public enum CircuitType implements IBeeModifier {
Territory(2, 10);
static {
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.5f, 5.0f);
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 10.0f);
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 2.5f, 10.0f);
CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f);
CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f);
CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
@@ -4,9 +4,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import binnie.extrabees.genetics.requirements.DummyMutationCondition;
import binnie.extrabees.genetics.requirements.IMutationRequirement;
import binnie.extrabees.genetics.requirements.RequirementPerson;
import binnie.extrabees.genetics.requirements.*;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome;
@@ -8,12 +8,13 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import com.google.common.base.Optional;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata;
import binnie.core.util.I18N;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager;
import extrabiomes.api.Stuff;
public class PlankType {
@@ -266,10 +267,13 @@ public class PlankType {
@Override
public ItemStack getStack() {
if (!Mods.extraBiomes.active()) {
try {
Class clss = Class.forName("extrabiomes.api.Stuff");
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, ordinal());
} catch (Exception e) {
return null;
}
return Stuff.planks.transform(block -> new ItemStack(block, 1, ordinal())).orNull();
}
@Override
@@ -8,7 +8,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager;
@@ -18,8 +17,6 @@ import binnie.extratrees.block.decor.FenceType;
public class WoodManager {
private static List<IPlankType> allPlankTypes;
public static IPlankType getPlankType(int index) {
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
if (wood instanceof IPlankType) {
@@ -100,18 +97,16 @@ public class WoodManager {
}
public static List<IPlankType> getAllPlankTypes() {
if (allPlankTypes != null) {
return allPlankTypes;
}
List<IPlankType> list = new ArrayList<>();
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
Collections.addAll(list, PlankType.ForestryPlanks.values());
if (Mods.extraBiomes.active()) {
Collections.addAll(list, PlankType.ExtraBiomesPlank.values());
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
if (type.getStack() != null) {
list.add(type);
}
}
Collections.addAll(list, PlankType.VanillaPlanks.values());
allPlankTypes = list;
return list;
}
@@ -29,18 +29,19 @@ public class Lumbermill {
public static Map<ItemStack, ItemStack> recipes = new HashMap<>();
public static ItemStack getPlankProduct(ItemStack item) {
ItemStack stack = null;
if (Lumbermill.recipes.isEmpty()) {
calculateLumbermillProducts();
}
for (Map.Entry<ItemStack, ItemStack> entry : Lumbermill.recipes.entrySet()) {
if (entry.getKey().isItemEqual(item)) {
ItemStack stack = entry.getValue().copy();
stack.stackSize = 6;
return stack;
stack = entry.getValue().copy();
break;
}
}
return null;
stack.stackSize = 6;
return stack;
}
public static void calculateLumbermillProducts() {
@@ -1,6 +1,6 @@
package binnie.extratrees.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Garden (Damp, Neutral)
for.binnie.circuit.garden.damp.alkaline=Garden (Damp, Alkaline)
botany.tube.name=Insulated Tube
botany.tube.copper=Copper
botany.tube.cooper=Cooper
botany.tube.tin=Tin
botany.tube.bronze=Bronze
botany.tube.iron=Iron
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Сад (влажный, нейтраль
for.binnie.circuit.garden.damp.alkaline=Сад (влажный, щелочной)
botany.tube.name=изолирующая лампа
botany.tube.copper=Медная
botany.tube.cooper=Медная
botany.tube.tin=Оловяная
botany.tube.bronze=Бронзовая
botany.tube.iron=Железная
@@ -364,7 +364,7 @@ for.binnie.circuit.garden.damp.neutral=花土(潮湿,中性)
for.binnie.circuit.garden.damp.alkaline=花土(潮湿,碱性)
botany.tube.name=恒温管
botany.tube.copper=铜
botany.tube.cooper=铜
botany.tube.tin=锡
botany.tube.bronze=青铜
botany.tube.iron=铁