mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
088d9c08a8 | ||
|
|
98547c2bcf | ||
|
|
02fa633043 | ||
|
|
9df6ab0232 | ||
|
|
89cc203875 | ||
|
|
4b247d08a5 | ||
|
|
8ecc8f20d5 | ||
|
|
74b9f8339a | ||
|
|
e20756a196 | ||
|
|
6d0f83c499 | ||
|
|
8e219c06be | ||
|
|
3fc576b6fc | ||
|
|
249cb2b308 | ||
|
|
e8d8c1994b | ||
|
|
195b47944f | ||
|
|
3224fdef7d | ||
|
|
46a159d788 |
No files matched your search
@@ -27,3 +27,4 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
.DS_Store
|
||||
+383
-33
@@ -1,4 +1,4 @@
|
||||
//version: 1674943145
|
||||
//version: 1677142954
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -9,13 +9,18 @@
|
||||
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.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 java.nio.file.Files
|
||||
@@ -23,10 +28,10 @@ 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 {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
@@ -47,6 +52,8 @@ buildscript {
|
||||
name 'Scala CI dependencies'
|
||||
url 'https://repo1.maven.org/maven2/'
|
||||
}
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
@@ -55,9 +62,9 @@ plugins {
|
||||
id 'eclipse'
|
||||
id 'scala'
|
||||
id 'maven-publish'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
|
||||
id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
|
||||
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
|
||||
@@ -66,7 +73,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.7.2' apply false
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.16'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.2'
|
||||
}
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
@@ -113,6 +120,7 @@ propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
propertyDefaultIfUnset("curseForgeRelations", "")
|
||||
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
|
||||
propertyDefaultIfUnset("relocateShadowedDependencies", true)
|
||||
// Deprecated properties (kept for backwards compat)
|
||||
propertyDefaultIfUnset("gradleTokenModId", "")
|
||||
propertyDefaultIfUnset("gradleTokenModName", "")
|
||||
@@ -121,6 +129,9 @@ propertyDefaultIfUnset("gradleTokenGroupName", "")
|
||||
propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only
|
||||
propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only
|
||||
|
||||
// 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
|
||||
if (!disableSpotless) {
|
||||
apply plugin: 'com.diffplug.spotless'
|
||||
@@ -149,6 +160,33 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
|
||||
// If Kotlin is enabled in the project
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
// Kotlin hacks our source sets, so we hack Kotlin's tasks
|
||||
def disabledKotlinTaskList = [
|
||||
"kaptGenerateStubsMcLauncherKotlin",
|
||||
"kaptGenerateStubsPatchedMcKotlin",
|
||||
"kaptGenerateStubsInjectedTagsKotlin",
|
||||
"compileMcLauncherKotlin",
|
||||
"compilePatchedMcKotlin",
|
||||
"compileInjectedTagsKotlin",
|
||||
"kaptMcLauncherKotlin",
|
||||
"kaptPatchedMcKotlin",
|
||||
"kaptInjectedTagsKotlin",
|
||||
"kspMcLauncherKotlin",
|
||||
"kspPatchedMcKotlin",
|
||||
"kspInjectedTagsKotlin",
|
||||
]
|
||||
tasks.configureEach { task ->
|
||||
if (task.name in disabledKotlinTaskList) {
|
||||
task.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
create("runtimeOnlyNonPublishable") {
|
||||
description = "Runtime only dependencies that are not published alongside the jar"
|
||||
@@ -158,11 +196,21 @@ configurations {
|
||||
}
|
||||
|
||||
if (enableModernJavaSyntax.toBoolean()) {
|
||||
repositories {
|
||||
mavenCentral {
|
||||
mavenContent {
|
||||
includeGroup("me.eigenraven.java8unsupported")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
|
||||
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
|
||||
transitive = false // We only care about the 1 annotation class
|
||||
}
|
||||
// Allow using jdk.unsupported classes like sun.misc.Unsafe in the compiled code, working around JDK-8206937.
|
||||
patchedMinecraft('me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0')
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
@@ -206,12 +254,33 @@ if (apiPackage) {
|
||||
}
|
||||
|
||||
if (accessTransformersFile) {
|
||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
||||
if (!getFile(targetFile).exists()) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
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)
|
||||
}
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
|
||||
}
|
||||
} else {
|
||||
boolean atsFound = false
|
||||
for (File at : sourceSets.getByName("main").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
for (File at : sourceSets.getByName("api").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
if (atsFound) {
|
||||
logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name")
|
||||
}
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
@@ -290,7 +359,7 @@ if (identifiedVersion == versionOverride) {
|
||||
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
group = "com.github.GTNewHorizons"
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
} else {
|
||||
@@ -320,6 +389,10 @@ minecraft {
|
||||
injectMissingGenerics.set(true)
|
||||
}
|
||||
|
||||
username = developmentEnvironmentUserName.toString()
|
||||
|
||||
lwjgl3Version = "3.3.2-SNAPSHOT"
|
||||
|
||||
// Enable assertions in the current mod
|
||||
extraRunJvmArguments.add("-ea:${modGroup}")
|
||||
|
||||
@@ -354,6 +427,26 @@ configurations.configureEach {
|
||||
}
|
||||
}
|
||||
}
|
||||
def obfuscationAttr = it.attributes.getAttribute(ObfuscationAttribute.OBFUSCATION_ATTRIBUTE)
|
||||
if (obfuscationAttr != null && obfuscationAttr.name == ObfuscationAttribute.SRG) {
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
// Remap CoFH core cursemaven dev jar to the obfuscated version for runObfClient/Server
|
||||
if (details.requested.group == 'curse.maven' && details.requested.name.endsWith('-69162') && details.requested.version == '2388751') {
|
||||
details.useVersion '2388750'
|
||||
details.because 'Pick obfuscated jar'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure tests have access to minecraft classes
|
||||
sourceSets {
|
||||
test {
|
||||
java {
|
||||
compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file('addon.gradle').exists()) {
|
||||
@@ -363,7 +456,7 @@ if (file('addon.gradle').exists()) {
|
||||
// Allow unsafe repos but warn
|
||||
repositories.configureEach { repo ->
|
||||
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
|
||||
if (repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) {
|
||||
if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) {
|
||||
logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'")
|
||||
repo.allowInsecureProtocol = true
|
||||
}
|
||||
@@ -373,8 +466,9 @@ repositories.configureEach { repo ->
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
configurations {
|
||||
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
|
||||
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
|
||||
for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) {
|
||||
config.extendsFrom(runtimeOnlyNonPublishable)
|
||||
if (usesShadowedDependencies.toBoolean()) {
|
||||
config.extendsFrom(shadowImplementation)
|
||||
// TODO: remove Compile after all uses are refactored to Implementation
|
||||
@@ -427,6 +521,13 @@ repositories {
|
||||
}
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
content {
|
||||
includeGroup "org.lwjgl"
|
||||
}
|
||||
}
|
||||
if (includeWellKnownRepositories.toBoolean()) {
|
||||
maven {
|
||||
name "CurseMaven"
|
||||
@@ -463,13 +564,21 @@ dependencies {
|
||||
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
|
||||
annotationProcessor('com.google.guava:guava:24.1.1-jre')
|
||||
annotationProcessor('com.google.code.gson:gson:2.8.6')
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.10:processor')
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.10')
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
if (usesMixins.toBoolean()) {
|
||||
dependencies {
|
||||
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,9 +622,11 @@ if (usesMixins.toBoolean()) {
|
||||
tasks.named("reobfJar", ReobfuscatedJar).configure {
|
||||
extraSrgFiles.from(mixinSrg)
|
||||
}
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn("generateAssets")
|
||||
}
|
||||
|
||||
tasks.named("compileJava", JavaCompile).configure {
|
||||
doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
@@ -529,6 +640,25 @@ if (usesMixins.toBoolean()) {
|
||||
"-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 {
|
||||
@@ -547,9 +677,149 @@ tasks.named("processResources", ProcessResources).configure {
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
dependsOn("compileJava", "compileScala")
|
||||
}
|
||||
}
|
||||
|
||||
ext.java17Toolchain = (JavaToolchainSpec spec) -> {
|
||||
spec.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
spec.vendor.set(JvmVendorSpec.matching("jetbrains"))
|
||||
}
|
||||
|
||||
ext.java17DependenciesCfg = configurations.create("java17Dependencies") {
|
||||
extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution
|
||||
canBeConsumed = false
|
||||
}
|
||||
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") {
|
||||
canBeConsumed = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.1.28'
|
||||
def asmVersion = '9.4'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.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}
|
||||
}
|
||||
|
||||
ext.java17JvmArgs = [
|
||||
// Java 9+ support
|
||||
"--illegal-access=warn",
|
||||
"-Dfile.encoding=UTF-8",
|
||||
"-Djava.security.manager=allow",
|
||||
"--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.net=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.nio=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.io=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.text=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
|
||||
"--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED",
|
||||
"--add-modules", "jdk.dynalink",
|
||||
"--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED",
|
||||
"--add-modules", "java.sql.rowset",
|
||||
"--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED"
|
||||
]
|
||||
|
||||
ext.hotswapJvmArgs = [
|
||||
// DCEVM advanced hot reload
|
||||
"-XX:+AllowEnhancedClassRedefinition",
|
||||
"-XX:HotswapAgent=fatjar"
|
||||
]
|
||||
|
||||
ext.setupHotswapAgentTask = tasks.register("setupHotswapAgent") {
|
||||
group = "GTNH Buildscript"
|
||||
description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory"
|
||||
def hsaUrl = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar'
|
||||
def targetFolderProvider = javaToolchains.launcherFor(java17Toolchain).map {it.metadata.installationPath.dir("lib/hotswap")}
|
||||
def targetFilename = "hotswap-agent.jar"
|
||||
onlyIf {
|
||||
!targetFolderProvider.get().file(targetFilename).asFile.exists()
|
||||
}
|
||||
doLast {
|
||||
def targetFolder = targetFolderProvider.get()
|
||||
targetFolder.asFile.mkdirs()
|
||||
download.run {
|
||||
src hsaUrl
|
||||
dest targetFolder.file(targetFilename).asFile
|
||||
overwrite false
|
||||
tempAndMove true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
// IntelliJ doesn't seem to allow commandline arguments so we also support an env variable
|
||||
private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP"));
|
||||
|
||||
@Input
|
||||
public boolean getEnableHotswap() { return enableHotswap }
|
||||
@Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger")
|
||||
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
|
||||
|
||||
@Inject
|
||||
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
|
||||
super(side, gradle)
|
||||
|
||||
this.lwjglVersion = 3
|
||||
this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain)
|
||||
this.extraJvmArgs.addAll(project.java17JvmArgs)
|
||||
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
|
||||
|
||||
this.classpath(project.java17PatchDependenciesCfg)
|
||||
if (side == Side.CLIENT) {
|
||||
this.classpath(project.minecraftTasks.lwjgl3Configuration)
|
||||
}
|
||||
// Use a raw provider instead of map to not create a dependency on the task
|
||||
this.classpath(project.provider(() -> project.tasks.named(superTask, RunMinecraftTask).get().classpath))
|
||||
this.classpath.filter { file ->
|
||||
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
|
||||
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
|
||||
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient")
|
||||
runClient17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge"
|
||||
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
|
||||
mainClass = "GradleStart"
|
||||
username = minecraft.username
|
||||
userUUID = minecraft.userUUID
|
||||
}
|
||||
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
|
||||
runServer17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge"
|
||||
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
|
||||
mainClass = "GradleStartServer"
|
||||
extraArgs.add("nogui")
|
||||
}
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
|
||||
@@ -584,6 +854,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
enabled = relocateShadowedDependencies.toBoolean()
|
||||
}
|
||||
tasks.named("shadowJar", ShadowJar).configure {
|
||||
manifest {
|
||||
@@ -599,7 +870,9 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
project.configurations.shadeCompile
|
||||
]
|
||||
archiveClassifier.set('dev')
|
||||
dependsOn(relocateShadowJar)
|
||||
if (relocateShadowedDependencies.toBoolean()) {
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
}
|
||||
configurations.runtimeElements.outgoing.artifacts.clear()
|
||||
configurations.apiElements.outgoing.artifacts.clear()
|
||||
@@ -616,7 +889,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
for (runTask in ["runClient", "runServer"]) {
|
||||
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
|
||||
tasks.named(runTask).configure {
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
@@ -625,16 +898,6 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
|
||||
ext.publishableObfJar = tasks.reobfJar
|
||||
|
||||
tasks.named('extractForgeUserdev', Copy).configure { efu ->
|
||||
doLast {
|
||||
// Fix CoFH-repackaged CCL not finding mappings
|
||||
project.copy {
|
||||
from(mcpTasks.userdevDir("conf"))
|
||||
into(new File(project.buildDir, "unpacked/conf"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('apiJar', Jar) {
|
||||
from(sourceSets.main.allSource) {
|
||||
include modGroupPath + "/" + apiPackagePath + '/**'
|
||||
@@ -664,9 +927,23 @@ idea {
|
||||
module {
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
inheritOutputDirs = true
|
||||
}
|
||||
project {
|
||||
settings {
|
||||
if (ideaOverrideBuildType != "") {
|
||||
delegateActions {
|
||||
if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) {
|
||||
delegateBuildRunToGradle = true
|
||||
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE
|
||||
} else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) {
|
||||
delegateBuildRunToGradle = false
|
||||
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
|
||||
} else {
|
||||
throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.')
|
||||
}
|
||||
}
|
||||
}
|
||||
runConfigurations {
|
||||
"1. Run Client"(Gradle) {
|
||||
taskNames = ["runClient"]
|
||||
@@ -674,6 +951,20 @@ idea {
|
||||
"2. Run Server"(Gradle) {
|
||||
taskNames = ["runServer"]
|
||||
}
|
||||
"1a. Run Client (Java 17)"(Gradle) {
|
||||
taskNames = ["runClient17"]
|
||||
}
|
||||
"2a. Run Server (Java 17)"(Gradle) {
|
||||
taskNames = ["runServer17"]
|
||||
}
|
||||
"1b. Run Client (Java 17, Hotswap)"(Gradle) {
|
||||
taskNames = ["runClient17"]
|
||||
envs = ["HOTSWAP": "true"]
|
||||
}
|
||||
"2b. Run Server (Java 17, Hotswap)"(Gradle) {
|
||||
taskNames = ["runServer17"]
|
||||
envs = ["HOTSWAP": "true"]
|
||||
}
|
||||
"3. Run Obfuscated Client"(Gradle) {
|
||||
taskNames = ["runObfClient"]
|
||||
}
|
||||
@@ -691,7 +982,7 @@ idea {
|
||||
}
|
||||
"Run Client (IJ Native)"(Application) {
|
||||
mainClass = "GradleStart"
|
||||
moduleName = project.name + ".main"
|
||||
moduleName = project.name + ".ideVirtualMain"
|
||||
afterEvaluate {
|
||||
workingDirectory = tasks.runClient.workingDir.absolutePath
|
||||
programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
|
||||
@@ -702,7 +993,7 @@ idea {
|
||||
}
|
||||
"Run Server (IJ Native)"(Application) {
|
||||
mainClass = "GradleStartServer"
|
||||
moduleName = project.name + ".main"
|
||||
moduleName = project.name + ".ideVirtualMain"
|
||||
afterEvaluate {
|
||||
workingDirectory = tasks.runServer.workingDir.absolutePath
|
||||
programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
|
||||
@@ -719,6 +1010,51 @@ idea {
|
||||
]
|
||||
}
|
||||
}
|
||||
withIDEADir { File ideaDir ->
|
||||
if (!ideaDir.path.contains(".idea")) {
|
||||
// If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory
|
||||
ideaDir = new File(ideaDir, ".idea")
|
||||
}
|
||||
if (ideaDir.isDirectory()) {
|
||||
def miscFile = new File(ideaDir, "misc.xml")
|
||||
if (miscFile.isFile()) {
|
||||
boolean dirty = false
|
||||
def miscTransformer = new XmlTransformer()
|
||||
miscTransformer.addAction { root ->
|
||||
Node rootNode = root.asNode()
|
||||
def rootManager = rootNode
|
||||
.component.find { it.@name == 'ProjectRootManager' }
|
||||
if (!rootManager) {
|
||||
rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2'])
|
||||
dirty = true
|
||||
}
|
||||
def output = rootManager.output
|
||||
if (!output) {
|
||||
output = rootManager.appendNode('output')
|
||||
dirty = true
|
||||
}
|
||||
if (!output.@url) {
|
||||
// Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow.
|
||||
// This is a sensible default for most setups
|
||||
output.@url = 'file://$PROJECT_DIR$/build/ideaBuild'
|
||||
dirty = true
|
||||
}
|
||||
}
|
||||
def result = miscTransformer.transform(miscFile.text)
|
||||
if (dirty) {
|
||||
miscFile.write(result)
|
||||
}
|
||||
} else {
|
||||
miscFile.text = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2">
|
||||
<output url="file://\$PROJECT_DIR\$/out" />
|
||||
</component>
|
||||
</project>
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,7 +1075,7 @@ publishing {
|
||||
artifact apiJar
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
@@ -866,10 +1202,21 @@ def addCurseForgeRelation(String type, String name) {
|
||||
}
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.0.1"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
}
|
||||
|
||||
tasks.register('updateBuildScript') {
|
||||
group = 'GTNH Buildscript'
|
||||
description = 'Updates the build script to the latest version'
|
||||
|
||||
if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) {
|
||||
dependsOn('wrapper')
|
||||
}
|
||||
|
||||
doLast {
|
||||
if (performBuildScriptUpdate()) return
|
||||
|
||||
@@ -882,6 +1229,9 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
|
||||
performBuildScriptUpdate()
|
||||
} else {
|
||||
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
|
||||
if (gradle.gradleVersion != buildscriptGradleVersion) {
|
||||
out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.6:dev')
|
||||
compile('com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev')
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.8')
|
||||
api('com.github.GTNewHorizons:CodeChickenLib:1.1.6:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.1.10:dev')
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.9.0')
|
||||
}
|
||||
+13
-5
@@ -26,11 +26,19 @@ developmentEnvironmentUserName = Developer
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile = NEIModContainer.java
|
||||
gradleTokenModId = GRADLETOKEN_MODID
|
||||
gradleTokenModName = GRADLETOKEN_MODNAME
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
# Generate a class with String fields for the mod id, name, version and group name named with the fields below
|
||||
generateGradleTokenClass = codechicken.nei.Tags
|
||||
gradleTokenModId = MODID
|
||||
gradleTokenModName = MODNAME
|
||||
gradleTokenVersion = VERSION
|
||||
gradleTokenGroupName = GROUPNAME
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -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
|
||||
|
||||
@@ -221,6 +221,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
return true;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.next_tooltip")) {
|
||||
GuiContainerManager.incrementTooltipPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isEnabled() && !isHidden()) {
|
||||
for (Widget widget : controlWidgets) if (inputFocused == null) widget.lastKeyTyped(keyID, keyChar);
|
||||
}
|
||||
@@ -354,11 +359,18 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
this.icons[2] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 64, 0, 16, 16).build();
|
||||
}
|
||||
|
||||
private boolean getIsAccessibleControlEventKey() {
|
||||
if (Minecraft.isRunningOnMac) {
|
||||
return Keyboard.getEventKey() == Keyboard.KEY_LMETA || Keyboard.getEventKey() == Keyboard.KEY_RMETA;
|
||||
}
|
||||
return Keyboard.getEventKey() == Keyboard.KEY_LCONTROL
|
||||
|| Keyboard.getEventKey() == Keyboard.KEY_RCONTROL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (!rightclick) {
|
||||
if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LCONTROL
|
||||
|| Keyboard.getEventKey() == Keyboard.KEY_RCONTROL)) {
|
||||
if (Keyboard.getEventKeyState() && getIsAccessibleControlEventKey()) {
|
||||
NEIClientConfig.cycleSetting("inventory.cheatmode", 3);
|
||||
} else {
|
||||
if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT
|
||||
|
||||
@@ -267,6 +267,14 @@ public class NEIClientConfig {
|
||||
.getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.optimize_gui_overlap_computation", true));
|
||||
|
||||
tag.getTag("inventory.jei_style_cycled_ingredients").setComment("JEI styled cycled ingredients")
|
||||
.getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_cycled_ingredients", true));
|
||||
|
||||
tag.getTag("inventory.shift_overlay_recipe")
|
||||
.setComment("Require holding shift to move items when overlaying recipe").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.shift_overlay_recipe", true));
|
||||
|
||||
tag.getTag("tools.handler_load_from_config").setComment("ADVANCED: Load handlers from config")
|
||||
.getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("tools.handler_load_from_config", true) {
|
||||
@@ -345,6 +353,7 @@ public class NEIClientConfig {
|
||||
API.addHashBind("gui.hide_bookmarks", Keyboard.KEY_B);
|
||||
API.addKeyBind("gui.getprevioussearch", Keyboard.KEY_UP);
|
||||
API.addKeyBind("gui.getnextsearch", Keyboard.KEY_DOWN);
|
||||
API.addHashBind("gui.next_tooltip", Keyboard.KEY_Z);
|
||||
|
||||
API.addKeyBind("world.chunkoverlay", Keyboard.KEY_F9);
|
||||
API.addKeyBind("world.moboverlay", Keyboard.KEY_F7);
|
||||
@@ -408,7 +417,7 @@ public class NEIClientConfig {
|
||||
}
|
||||
|
||||
public static int getKeyBinding(String string) {
|
||||
return getSetting("keys." + string).getIntValue();
|
||||
return getSetting("keys." + string).getIntValue(Keyboard.KEY_NONE);
|
||||
}
|
||||
|
||||
public static void setDefaultKeyBinding(String string, int key) {
|
||||
@@ -420,6 +429,36 @@ public class NEIClientConfig {
|
||||
return hash != Keyboard.CHAR_NONE && hash == NEIClientUtils.getKeyHash();
|
||||
}
|
||||
|
||||
public static String getKeyName(int keyBind, boolean useHash) {
|
||||
return getKeyName(keyBind, useHash, false);
|
||||
}
|
||||
|
||||
public static String getKeyName(int keyBind, boolean useHash, boolean showOnlyHash) {
|
||||
String keyText = "";
|
||||
|
||||
if (useHash) {
|
||||
final String DELIMITER = " + ";
|
||||
if ((keyBind & NEIClientUtils.CTRL_HASH) != 0) {
|
||||
keyText += NEIClientUtils.translate(Minecraft.isRunningOnMac ? "key.ctrl.mac" : "key.ctrl") + DELIMITER;
|
||||
}
|
||||
if ((keyBind & NEIClientUtils.SHIFT_HASH) != 0) {
|
||||
keyText += "SHIFT" + DELIMITER;
|
||||
}
|
||||
if ((keyBind & NEIClientUtils.ALT_HASH) != 0) {
|
||||
keyText += "ALT" + DELIMITER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!showOnlyHash) {
|
||||
keyText += Keyboard.getKeyName(unHashKey(keyBind));
|
||||
}
|
||||
return keyText;
|
||||
}
|
||||
|
||||
public static int unHashKey(int keyBind) {
|
||||
return keyBind & ~(NEIClientUtils.CTRL_HASH | NEIClientUtils.SHIFT_HASH | NEIClientUtils.ALT_HASH);
|
||||
}
|
||||
|
||||
public static void bootNEI(World world) {
|
||||
if (configLoaded) return;
|
||||
|
||||
@@ -539,6 +578,14 @@ public class NEIClientConfig {
|
||||
return getBooleanSetting("inventory.optimize_gui_overlap_computation");
|
||||
}
|
||||
|
||||
public static boolean useJEIStyledCycledIngredients() {
|
||||
return getBooleanSetting("inventory.jei_style_cycled_ingredients");
|
||||
}
|
||||
|
||||
public static boolean requireShiftForOverlayRecipe() {
|
||||
return getBooleanSetting("inventory.shift_overlay_recipe");
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
|
||||
}
|
||||
|
||||
@@ -251,6 +251,9 @@ public class NEIClientUtils extends NEIServerUtils {
|
||||
}
|
||||
|
||||
public static boolean controlKey() {
|
||||
if (Minecraft.isRunningOnMac) {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA);
|
||||
}
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ public class NEIModContainer extends DummyModContainer {
|
||||
|
||||
private static ModMetadata getModMetadata() {
|
||||
final ModMetadata modMetadata = new ModMetadata();
|
||||
modMetadata.name = "GRADLETOKEN_MODNAME";
|
||||
modMetadata.modId = "GRADLETOKEN_MODID";
|
||||
modMetadata.version = "GRADLETOKEN_VERSION";
|
||||
modMetadata.name = "NotEnoughItems";
|
||||
modMetadata.modId = "NotEnoughItems";
|
||||
modMetadata.version = Tags.VERSION;
|
||||
modMetadata.authorList = Arrays.asList("ChickenBones", "mitchej123");
|
||||
modMetadata.url = "https://github.com/GTNewHorizons/NotEnoughItems";
|
||||
modMetadata.description = "Recipe Viewer, Inventory Manager, Item Spawner, Cheats and more; GTNH Version includes many enhancements.";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
@@ -14,7 +15,6 @@ import net.minecraft.world.chunk.Chunk;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.math.MathHelper;
|
||||
import codechicken.lib.render.RenderUtils;
|
||||
import codechicken.nei.KeyManager.IKeyStateTracker;
|
||||
|
||||
public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
@@ -42,10 +42,19 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
public static void render(float frame) {
|
||||
GL11.glPushMatrix();
|
||||
Entity entity = Minecraft.getMinecraft().renderViewEntity;
|
||||
RenderUtils.translateToWorldCoords(entity, frame);
|
||||
|
||||
renderChunkBounds(entity);
|
||||
renderMobSpawnOverlay(entity);
|
||||
double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame;
|
||||
double interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame;
|
||||
double interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame;
|
||||
|
||||
int intOffsetX = (int) interpPosX;
|
||||
int intOffsetY = (int) interpPosY;
|
||||
int intOffsetZ = (int) interpPosZ;
|
||||
|
||||
GL11.glTranslated(-interpPosX + intOffsetX, -interpPosY + intOffsetY, -interpPosZ + intOffsetZ);
|
||||
|
||||
renderChunkBounds(entity, intOffsetX, intOffsetY, intOffsetZ);
|
||||
renderMobSpawnOverlay(entity, intOffsetX, intOffsetY, intOffsetZ);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -86,7 +95,7 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
}
|
||||
}
|
||||
|
||||
private static void renderMobSpawnOverlay(Entity entity) {
|
||||
private static void renderMobSpawnOverlay(Entity entity, int intOffsetX, int intOffsetY, int intOffsetZ) {
|
||||
if (mobOverlay == 0) {
|
||||
if (mobSpawnCache != null) {
|
||||
mobSpawnCache = null;
|
||||
@@ -105,15 +114,17 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glLineWidth(1.5F);
|
||||
GL11.glBegin(GL11.GL_LINES);
|
||||
|
||||
GL11.glColor4f(1, 0, 0, 1);
|
||||
int curSpawnMode = 2;
|
||||
|
||||
World world = entity.worldObj;
|
||||
int x1 = (int) entity.posX;
|
||||
int z1 = (int) entity.posZ;
|
||||
int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16);
|
||||
int x1 = (int) entity.posX - intOffsetX;
|
||||
int z1 = (int) entity.posZ - intOffsetZ;
|
||||
int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16) - intOffsetY;
|
||||
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawing(GL11.GL_LINES);
|
||||
tess.setColorOpaque(255, 0, 0);
|
||||
|
||||
for (int i = 0; i <= 32; i++) {
|
||||
int x = x1 - 16 + i;
|
||||
@@ -132,22 +143,22 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
|
||||
if (spawnMode != curSpawnMode) {
|
||||
if (spawnMode == 1) {
|
||||
GL11.glColor4f(1, 1, 0, 1);
|
||||
tess.setColorOpaque(255, 255, 0);
|
||||
} else {
|
||||
GL11.glColor4f(1, 0, 0, 1);
|
||||
tess.setColorOpaque(255, 0, 0);
|
||||
}
|
||||
curSpawnMode = spawnMode;
|
||||
}
|
||||
|
||||
GL11.glVertex3d(x, y + 0.02, z);
|
||||
GL11.glVertex3d(x + 1, y + 0.02, z + 1);
|
||||
GL11.glVertex3d(x + 1, y + 0.02, z);
|
||||
GL11.glVertex3d(x, y + 0.02, z + 1);
|
||||
tess.addVertex(x, y + 0.02, z);
|
||||
tess.addVertex(x + 1, y + 0.02, z + 1);
|
||||
tess.addVertex(x + 1, y + 0.02, z);
|
||||
tess.addVertex(x, y + 0.02, z + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnd();
|
||||
tess.draw();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -157,8 +168,8 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
private static final AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0);
|
||||
|
||||
private static byte getSpawnMode(Chunk chunk, int x, int y, int z) {
|
||||
if (!SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, chunk.worldObj, x, y, z)
|
||||
|| chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15) >= 8) {
|
||||
if (chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15) >= 8
|
||||
|| !SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, chunk.worldObj, x, y, z)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -176,7 +187,7 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
return (byte) (chunk.getSavedLightValue(EnumSkyBlock.Sky, x & 15, y, z & 15) >= 8 ? 1 : 2);
|
||||
}
|
||||
|
||||
private static void renderChunkBounds(Entity entity) {
|
||||
private static void renderChunkBounds(Entity entity, int intOffsetX, int intOffsetY, int intOffsetZ) {
|
||||
if (chunkOverlay == 0) return;
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
@@ -187,8 +198,8 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
GL11.glBegin(GL11.GL_LINES);
|
||||
|
||||
for (int cx = -4; cx <= 4; cx++) for (int cz = -4; cz <= 4; cz++) {
|
||||
double x1 = (entity.chunkCoordX + cx) << 4;
|
||||
double z1 = (entity.chunkCoordZ + cz) << 4;
|
||||
double x1 = ((entity.chunkCoordX + cx) << 4) - intOffsetX;
|
||||
double z1 = ((entity.chunkCoordZ + cz) << 4) - intOffsetZ;
|
||||
double x2 = x1 + 16;
|
||||
double z2 = z1 + 16;
|
||||
|
||||
@@ -205,6 +216,9 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
y1 = y2 - dy;
|
||||
}
|
||||
|
||||
y1 -= intOffsetY;
|
||||
y2 -= intOffsetY;
|
||||
|
||||
double dist = Math.pow(1.5, -(cx * cx + cz * cz));
|
||||
|
||||
GL11.glColor4d(0.9, 0, 0, dist);
|
||||
@@ -240,6 +254,9 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
y1 = y2 - dy;
|
||||
}
|
||||
|
||||
y1 -= intOffsetY;
|
||||
y2 -= intOffsetY;
|
||||
|
||||
GL11.glColor4d(0, 0.9, 0, 0.4);
|
||||
for (double y = (int) y1; y <= y2; y++) {
|
||||
GL11.glVertex3d(x2, y, z1);
|
||||
@@ -262,8 +279,10 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
GL11.glVertex3d(x2, y2, z1 + h);
|
||||
}
|
||||
} else if (chunkOverlay == 3) {
|
||||
int gx1 = ((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4;
|
||||
int gz1 = ((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4;
|
||||
int gx1 = (((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4)
|
||||
- intOffsetX;
|
||||
int gz1 = (((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4)
|
||||
- intOffsetZ;
|
||||
if (entity.chunkCoordX < 0) {
|
||||
gx1 += 16;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,14 @@ public class API {
|
||||
RecipeInfo.registerOverlayHandler(classz, handler, ident);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param classz The class of your gui
|
||||
* @param ident The recipe identification string
|
||||
*/
|
||||
public static boolean hasGuiOverlayHandler(Class<? extends GuiContainer> classz, String ident) {
|
||||
return RecipeInfo.hasOverlayHandler(classz, ident);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the offset to be added to items to translate them into recipe coords on the actual gui, default is 5, 11.
|
||||
* Primarily RecipeTransferRects
|
||||
|
||||
@@ -6,5 +6,5 @@ import codechicken.nei.recipe.IRecipeHandler;
|
||||
|
||||
public interface IOverlayHandler {
|
||||
|
||||
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift);
|
||||
void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift);
|
||||
}
|
||||
@@ -5,11 +5,9 @@ import static codechicken.lib.gui.GuiDraw.drawStringC;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
|
||||
public class OptionKeyBind extends OptionButton {
|
||||
@@ -124,31 +122,8 @@ public class OptionKeyBind extends OptionButton {
|
||||
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
String keyText = "";
|
||||
|
||||
if (useHash) {
|
||||
final int metahash = Math.max(editing ? NEIClientUtils.getMetaHash() : getValue(), 0);
|
||||
final String DELIMITER = EnumChatFormatting.GRAY + " + " + EnumChatFormatting.RESET;
|
||||
|
||||
if ((metahash & NEIClientUtils.CTRL_HASH) == NEIClientUtils.CTRL_HASH) {
|
||||
keyText += NEIClientUtils.translate(Minecraft.isRunningOnMac ? "key.ctrl.mac" : "key.ctrl") + DELIMITER;
|
||||
}
|
||||
|
||||
if ((metahash & NEIClientUtils.SHIFT_HASH) == NEIClientUtils.SHIFT_HASH) {
|
||||
keyText += "SHIFT" + DELIMITER;
|
||||
}
|
||||
|
||||
if ((metahash & NEIClientUtils.ALT_HASH) == NEIClientUtils.ALT_HASH) {
|
||||
keyText += "ALT" + DELIMITER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!editing) {
|
||||
keyText += Keyboard.getKeyName(
|
||||
getValue() & ~(NEIClientUtils.CTRL_HASH | NEIClientUtils.SHIFT_HASH | NEIClientUtils.ALT_HASH));
|
||||
}
|
||||
|
||||
return keyText;
|
||||
final int metahash = Math.max(editing ? NEIClientUtils.getMetaHash() : getValue(), 0);
|
||||
return NEIClientConfig.getKeyName(metahash, useHash, editing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,7 @@ import static codechicken.lib.gui.GuiDraw.fontRenderer;
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
import static codechicken.lib.gui.GuiDraw.renderEngine;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -32,6 +32,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
@@ -497,7 +498,49 @@ public class GuiContainerManager {
|
||||
|
||||
if (tooltip.size() > 0) tooltip.set(0, tooltip.get(0) + GuiDraw.TOOLTIP_LINESPACE); // add space after 'title'
|
||||
|
||||
drawMultilineTip(font, mousex + 12, mousey - 12, tooltip);
|
||||
drawPagedTooltip(font, mousex + 12, mousey - 12, tooltip);
|
||||
}
|
||||
|
||||
private static int tooltipPage;
|
||||
|
||||
public static void drawPagedTooltip(FontRenderer font, int x, int y, List<String> list) {
|
||||
if (list.isEmpty()) return;
|
||||
List<List<String>> tooltips = splitTooltipByPage(list);
|
||||
tooltipPage = tooltipPage < tooltips.size() ? tooltipPage : 0;
|
||||
if (tooltips.size() > 1) {
|
||||
tooltips.get(tooltipPage).add(
|
||||
EnumChatFormatting.ITALIC + NEIClientUtils.translate(
|
||||
"inventory.tooltip.page",
|
||||
tooltipPage + 1,
|
||||
tooltips.size(),
|
||||
NEIClientConfig.getKeyName(NEIClientConfig.getKeyBinding("gui.next_tooltip"), true)));
|
||||
}
|
||||
drawMultilineTip(font, x, y, tooltips.get(tooltipPage));
|
||||
}
|
||||
|
||||
public static List<List<String>> splitTooltipByPage(List<String> list) {
|
||||
List<List<String>> ret = new ArrayList<>();
|
||||
List<String> tmp = new ArrayList<>();
|
||||
int height = -2;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String text = list.get(i);
|
||||
GuiDraw.ITooltipLineHandler line = GuiDraw.getTipLine(text);
|
||||
int lineHeight = line != null ? line.getSize().height
|
||||
: text.endsWith(GuiDraw.TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10;
|
||||
if (height + lineHeight <= GuiDraw.displaySize().height - 8 * 2 - 10) {
|
||||
// top & bottom 8px + last line for showing page
|
||||
height += lineHeight;
|
||||
} else {
|
||||
ret.add(new ArrayList<>(tmp));
|
||||
tmp.clear();
|
||||
height = -2;
|
||||
}
|
||||
tmp.add(text);
|
||||
}
|
||||
if (!tmp.isEmpty()) {
|
||||
ret.add(tmp);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static boolean shouldShowTooltip(GuiContainer window) {
|
||||
@@ -516,6 +559,10 @@ public class GuiContainerManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static void incrementTooltipPage() {
|
||||
tooltipPage++;
|
||||
}
|
||||
|
||||
public void renderSlotUnderlay(Slot slot) {
|
||||
for (IContainerDrawHandler drawHandler : drawHandlers) drawHandler.renderSlotUnderlay(window, slot);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -38,7 +39,10 @@ public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
final RecipeHandlerQuery<ICraftingHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
h -> h.getRecipeHandler(outputId, results),
|
||||
craftinghandlers,
|
||||
serialCraftingHandlers);
|
||||
serialCraftingHandlers,
|
||||
"Error while looking up crafting recipe",
|
||||
"outputId: " + outputId,
|
||||
"results: " + Arrays.toString(results));
|
||||
|
||||
final ArrayList<ICraftingHandler> handlers = recipeQuery.runWithProfiling("recipe.concurrent.crafting");
|
||||
|
||||
|
||||
@@ -471,6 +471,7 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
}
|
||||
|
||||
protected void overlayRecipe(int recipe, final boolean shift) {
|
||||
boolean moveItems = shift || !NEIClientConfig.requireShiftForOverlayRecipe();
|
||||
if (handler == null || !handler.hasOverlay(firstGui, firstGui.inventorySlots, recipe)) {
|
||||
mc.displayGuiScreen(firstGui);
|
||||
return;
|
||||
@@ -479,8 +480,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
final IOverlayHandler overlayHandler = handler.getOverlayHandler(firstGui, recipe);
|
||||
|
||||
mc.displayGuiScreen(firstGui);
|
||||
if (renderer == null || shift) {
|
||||
overlayHandler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift);
|
||||
if (renderer == null || moveItems) {
|
||||
if (overlayHandler != null) {
|
||||
overlayHandler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, moveItems);
|
||||
}
|
||||
} else {
|
||||
LayoutManager.overlayRenderer = renderer;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
@@ -16,7 +17,10 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
RecipeHandlerQuery<IUsageHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
h -> getUsageOrCatalystHandler(h, inputId, ingredients),
|
||||
usagehandlers,
|
||||
serialUsageHandlers);
|
||||
serialUsageHandlers,
|
||||
"Error while looking up usage recipe",
|
||||
"inputId: " + inputId,
|
||||
"ingredients: " + Arrays.toString(ingredients));
|
||||
ArrayList<IUsageHandler> handlers = recipeQuery.runWithProfiling("recipe.concurrent.usage");
|
||||
if (handlers.isEmpty()) return false;
|
||||
|
||||
|
||||
@@ -21,20 +21,29 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
private final Function<T, T> recipeHandlerFunction;
|
||||
private final List<T> recipeHandlers;
|
||||
private final List<T> serialRecipeHandlers;
|
||||
private final String[] errorMessage;
|
||||
private boolean error = false;
|
||||
|
||||
RecipeHandlerQuery(Function<T, T> recipeHandlerFunction, List<T> recipeHandlers, List<T> serialRecipeHandlers) {
|
||||
RecipeHandlerQuery(Function<T, T> recipeHandlerFunction, List<T> recipeHandlers, List<T> serialRecipeHandlers,
|
||||
String... errorMessage) {
|
||||
this.recipeHandlerFunction = recipeHandlerFunction;
|
||||
this.recipeHandlers = recipeHandlers;
|
||||
this.serialRecipeHandlers = serialRecipeHandlers;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
ArrayList<T> runWithProfiling(String profilerSection) {
|
||||
TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
|
||||
profiler.start(profilerSection);
|
||||
try {
|
||||
return getRecipeHandlersParallel();
|
||||
ArrayList<T> handlers = getRecipeHandlersParallel();
|
||||
if (error) {
|
||||
displayRecipeLookupError();
|
||||
}
|
||||
return handlers;
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
displayRecipeLookupError(e);
|
||||
printLog(e);
|
||||
displayRecipeLookupError();
|
||||
return new ArrayList<>(0);
|
||||
} finally {
|
||||
profiler.end();
|
||||
@@ -51,19 +60,37 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
}
|
||||
|
||||
private ArrayList<T> getSerialHandlersWithRecipes() {
|
||||
return serialRecipeHandlers.stream().map(recipeHandlerFunction).filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
return serialRecipeHandlers.stream().map(handler -> {
|
||||
try {
|
||||
return recipeHandlerFunction.apply(handler);
|
||||
} catch (Throwable t) {
|
||||
printLog(t);
|
||||
error = true;
|
||||
return null;
|
||||
}
|
||||
}).filter(h -> h != null && h.numRecipes() > 0).collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
private ArrayList<T> getHandlersWithRecipes() throws InterruptedException, ExecutionException {
|
||||
return ItemList.forkJoinPool.submit(
|
||||
() -> recipeHandlers.parallelStream().map(recipeHandlerFunction).filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new)))
|
||||
.get();
|
||||
return ItemList.forkJoinPool.submit(() -> recipeHandlers.parallelStream().map(handler -> {
|
||||
try {
|
||||
return recipeHandlerFunction.apply(handler);
|
||||
} catch (Throwable t) {
|
||||
printLog(t);
|
||||
error = true;
|
||||
return null;
|
||||
}
|
||||
}).filter(h -> h != null && h.numRecipes() > 0).collect(Collectors.toCollection(ArrayList::new))).get();
|
||||
}
|
||||
|
||||
private static void displayRecipeLookupError(Exception e) {
|
||||
e.printStackTrace();
|
||||
private void printLog(Throwable t) {
|
||||
for (String message : errorMessage) {
|
||||
NEIClientConfig.logger.error(message);
|
||||
}
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
private void displayRecipeLookupError() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player != null) {
|
||||
IChatComponent chat = new ChatComponentTranslation("nei.chat.recipe.error");
|
||||
|
||||
@@ -70,6 +70,10 @@ public class RecipeInfo {
|
||||
return overlayMap.containsKey(new OverlayKey(gui.getClass(), ident));
|
||||
}
|
||||
|
||||
public static boolean hasOverlayHandler(Class<? extends GuiContainer> classz, String ident) {
|
||||
return overlayMap.containsKey(new OverlayKey(classz, ident));
|
||||
}
|
||||
|
||||
public static IOverlayHandler getOverlayHandler(GuiContainer gui, String ident) {
|
||||
return overlayMap.get(new OverlayKey(gui.getClass(), ident));
|
||||
}
|
||||
|
||||
@@ -182,8 +182,12 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
public List<PositionedStack> getCycledIngredients(int cycle, List<PositionedStack> ingredients) {
|
||||
|
||||
if (!NEIClientUtils.shiftKey()) {
|
||||
for (int itemIndex = 0; itemIndex < ingredients.size(); itemIndex++) {
|
||||
randomRenderPermutation(ingredients.get(itemIndex), cycle + itemIndex);
|
||||
if (NEIClientConfig.useJEIStyledCycledIngredients()) {
|
||||
jeiStyledRenderPermutation(ingredients, cycle);
|
||||
} else {
|
||||
for (int itemIndex = 0; itemIndex < ingredients.size(); itemIndex++) {
|
||||
randomRenderPermutation(ingredients.get(itemIndex), cycle + itemIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +199,12 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
stack.setPermutationToRender(Math.abs(rand.nextInt()) % stack.items.length);
|
||||
}
|
||||
|
||||
public void jeiStyledRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
for (PositionedStack stack : stacks) {
|
||||
stack.setPermutationToRender((int) (cycle % stack.items.length));
|
||||
}
|
||||
}
|
||||
|
||||
public void setIngredientPermutation(Collection<PositionedStack> ingredients, ItemStack ingredient) {
|
||||
for (PositionedStack stack : ingredients) {
|
||||
for (int i = 0; i < stack.items.length; i++) {
|
||||
|
||||
@@ -1343,6 +1343,25 @@ tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSewer,MineFactoryRel
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerGrinder,MineFactoryReloaded:machine.0:13,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerBioReactor,MineFactoryReloaded:machine.1:10,,MineFactoryReloaded,TRUE,,,,,,
|
||||
tonius.neiintegration.mods.minefactoryreloaded.RecipeHandlerSlaughterhouse,MineFactoryReloaded:machine.1:13,,MineFactoryReloaded,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe,ActuallyAdditions:itemBooklet,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIHairyBallRecipe,ActuallyAdditions:itemHairyBall,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICrusherRecipe$Double,ActuallyAdditions:blockGrinderDouble,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICrusherRecipe,ActuallyAdditions:blockGrinder,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIFurnaceDoubleRecipe,ActuallyAdditions:blockFurnaceDouble,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe,ActuallyAdditions:blockCoffeeMachine,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICompostRecipe,ActuallyAdditions:blockCompost,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe,ActuallyAdditions:blockAtomicReconstructor,,ActuallyAdditions,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEITreasureChestRecipe,ActuallyAdditions:blockTreasureChest,,ActuallyAdditions,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerFloatingFlowers,Botania:miniIsland,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerPetalApothecary,Botania:altar,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerRunicAltar,Botania:runeAltar,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerManaPool,Botania:pool,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerElvenTrade,Botania:alfheimPortal,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerBrewery,Botania:brewery,,Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerPureDaisy,Botania:specialFlower,"{type:puredaisy}",Botania,TRUE,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerLexicaBotania,Botania:lexicon,,Botania,TRUE,,,,,,
|
||||
neiplugins.forge.OreDictionaryList,minecraft:book,,NEIPlugins,TRUE,,,,,,
|
||||
neiplugins.forge.FluidRegistryList,minecraft:bucket,,NEIPlugins,TRUE,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe,ActuallyAdditions:itemBooklet,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIHairyBallRecipe,ActuallyAdditions:itemHairyBall,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICrusherRecipe$Double,ActuallyAdditions:blockGrinderDouble,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
|
||||
|
@@ -520,4 +520,14 @@ de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe,Actually Additions,A
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEICompostRecipe,Actually Additions,ActuallyAdditions:blockCompost,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe,Actually Additions,ActuallyAdditions:blockAtomicReconstructor,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEITreasureChestRecipe,Actually Additions,ActuallyAdditions:blockTreasureChest,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerFloatingFlowers,Botania,Botania:miniIsland,,Botania,TRUE,,,,,5,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerPetalApothecary,Botania,Botania:altar,,Botania,TRUE,,,102,137,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerRunicAltar,Botania,Botania:runeAltar,,Botania,TRUE,,,122,137,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerManaPool,Botania,Botania:pool,,Botania,TRUE,,,90,137,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerElvenTrade,Botania,Botania:alfheimPortal,,Botania,TRUE,,,90,130,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerBrewery,Botania,Botania:brewery,,Botania,TRUE,,,,,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerPureDaisy,Botania,Botania:specialFlower,"{type:puredaisy}",Botania,TRUE,,,,,4,,,,,,
|
||||
vazkii.botania.client.integration.nei.RecipeHandlerLexicaBotania,Botania,Botania:lexicon,,Botania,TRUE,,,,,,,,,,,
|
||||
neiplugins.forge.OreDictionaryList,NEIPlugins,minecraft:book,,NEIPlugins,TRUE,,,,,,,,,,,
|
||||
neiplugins.forge.FluidRegistryList,NEIPlugins,minecraft:bucket,,NEIPlugins,TRUE,,,,,,,,,,,
|
||||
de.ellpeck.actuallyadditions.mod.nei.NEITreasureChestRecipe,Actually Additions,ActuallyAdditions:blockTreasureChest,,ActuallyAdditions,TRUE,,,,,,,,,,,
|
||||
|
@@ -56,6 +56,7 @@ nei.inventory.current.gamemode.0=Current gamemode: survival
|
||||
nei.inventory.current.gamemode.1=Current gamemode: creative
|
||||
nei.inventory.current.gamemode.2=Current gamemode: creative+
|
||||
nei.inventory.current.gamemode.3=Current gamemode: adventure
|
||||
nei.inventory.tooltip.page=Page: %s / %s [Press %s to see next page]
|
||||
|
||||
nei.inventory.gamemode.0=Click: Set gamemode to survival
|
||||
nei.inventory.gamemode.1=Click: Set gamemode to creative
|
||||
@@ -108,6 +109,7 @@ nei.options.keys.gui.overlay_hide=Hide Overlay Recipe
|
||||
nei.options.keys.gui.overlay_use=Use Overlay Recipe
|
||||
nei.options.keys.gui.getprevioussearch=Previous Search
|
||||
nei.options.keys.gui.getnextsearch=Next Search
|
||||
nei.options.keys.gui.next_tooltip=Next Tooltip
|
||||
nei.options.keys.world=World
|
||||
nei.options.keys.world.chunkoverlay=Chunk Boundary Overlay
|
||||
nei.options.keys.world.moboverlay=Mob Spawn Overlay
|
||||
@@ -164,6 +166,12 @@ nei.options.inventory.ignore_potion_overlap.false=No
|
||||
nei.options.inventory.optimize_gui_overlap_computation=Optimize computation for GUI overlap
|
||||
nei.options.inventory.optimize_gui_overlap_computation.true=Yes
|
||||
nei.options.inventory.optimize_gui_overlap_computation.false=No
|
||||
nei.options.inventory.jei_style_cycled_ingredients=JEI styled cycled ingredients
|
||||
nei.options.inventory.jei_style_cycled_ingredients.true=Yes
|
||||
nei.options.inventory.jei_style_cycled_ingredients.false=No
|
||||
nei.options.inventory.shift_overlay_recipe=Require holding shift to move items when overlaying recipe
|
||||
nei.options.inventory.shift_overlay_recipe.true=Yes
|
||||
nei.options.inventory.shift_overlay_recipe.false=No
|
||||
nei.options.inventory.widgetsenabled.true=NEI Enabled
|
||||
nei.options.inventory.widgetsenabled.false=NEI Disabled
|
||||
nei.options.inventory.cheatmode.0=Recipe Mode
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"repo": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.1.5.6/",
|
||||
"file": "CodeChickenLib-1.7.10-1.1.5.6.jar",
|
||||
"dev": "CodeChickenLib-1.7.10-1.1.5.6-dev.jar",
|
||||
"repo": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.1.6/",
|
||||
"file": "CodeChickenLib-1.1.6.jar",
|
||||
"dev": "CodeChickenLib-1.1.6-dev.jar",
|
||||
"class": "codechicken.lib.asm.ASMHelper",
|
||||
"coreLib": true
|
||||
}
|
||||
Reference in new issue
Block a user