diff options
author | Roman / Linnea Gräf <roman.graef@gmail.com> | 2023-01-25 19:43:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 19:43:51 +0100 |
commit | f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb (patch) | |
tree | f8ad2c2ab2f859446345e189e62007b3e28b44c0 | |
parent | f1ce88fb8e98b41a10ba374d32cb312b949ba8ef (diff) | |
download | NotEnoughUpdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.tar.gz NotEnoughUpdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.tar.bz2 NotEnoughUpdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.zip |
Annotation registering (and also some comptime performance) (#554)
59 files changed, 488 insertions, 142 deletions
diff --git a/annotations/build.gradle.kts b/annotations/build.gradle.kts new file mode 100644 index 00000000..c9e13173 --- /dev/null +++ b/annotations/build.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +plugins { + kotlin("jvm") + java +} + +repositories { + mavenCentral() +} + +tasks.withType<JavaCompile> { + if (JavaVersion.current().isJava9Compatible) { + options.release.set(8) + } +} + +dependencies { + implementation(kotlin("stdlib-jdk8")) + implementation("com.google.devtools.ksp:symbol-processing-api:1.8.0-1.0.8") + implementation("com.squareup:kotlinpoet:1.12.0") + implementation("com.squareup:kotlinpoet-ksp:1.12.0") +} + + + + diff --git a/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSubscribe.kt b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSubscribe.kt new file mode 100644 index 00000000..1ba6be99 --- /dev/null +++ b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSubscribe.kt @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2023 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.autosubscribe + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.CLASS) +annotation class NEUAutoSubscribe diff --git a/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessor.kt b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessor.kt new file mode 100644 index 00000000..157749d0 --- /dev/null +++ b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessor.kt @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2023 Linnea Gräf + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.autosubscribe + +import com.google.devtools.ksp.getDeclaredFunctions +import com.google.devtools.ksp.getDeclaredProperties +import com.google.devtools.ksp.processing.CodeGenerator +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.symbol.ClassKind +import com.google.devtools.ksp.symbol.KSAnnotated +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.Modifier +import com.google.devtools.ksp.validate +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy +import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.asTypeName +import com.squareup.kotlinpoet.ksp.toClassName +import com.squareup.kotlinpoet.ksp.writeTo +import java.util.function.Consumer +import java.util.function.Supplier + +internal class NEUAutoSymbolProcessor(val codeGenerator: CodeGenerator, val logger: KSPLogger) : SymbolProcessor { + fun collectSubscribers(elements: List<KSAnnotated>): List<NEUEventSubscriber> = buildList { + for (element in elements) { + if (element !is KSClassDeclaration) { + logger.error("@NEUAutoSubscribe is only valid on class or object declarations", element) + continue + } + if (element.typeParameters.isNotEmpty()) { + logger.error("@NEUAutoSubscribe is not valid on generic classes", element) + continue + } + val name = element.qualifiedName + if (name == null) { + logger.error("@NEUAutoSubscribe could not find name", element) + continue + } + when (element.classKind) { + ClassKind.CLASS -> { + val instanceGetter = element.getDeclaredFunctions().find { + it.simpleName.asString() == "getInstance" + } + val instanceVariable = element.getDeclaredProperties().find { + it.simpleName.asString() == "INSTANCE" + } + if (instanceGetter != null) { + val returnType = instanceGetter.returnType + if (returnType == null || !element.asStarProjectedType().isAssignableFrom(returnType.resolve())) { + logger.error( + "getInstance() does not have the expected return type ${element.asStarProjectedType()}", + instanceGetter + ) + continue + } + add(NEUEventSubscriber(InvocationKind.GET_INSTANCE, element)) + } else if (instanceVariable != null) { + val variableType = instanceVariable.type + if (!element.asStarProjectedType().isAssignableFrom(variableType.resolve())) { + logger.error( + "INSTANCE does not have expected type ${element.asStarProjectedType()}", + instanceVariable + ) + continue + } + add(NEUEventSubscriber(InvocationKind.ACCESS_INSTANCE, element)) + } else { + add(NEUEventSubscriber(InvocationKind.DEFAULT_CONSTRUCTOR, element)) + } + } + + ClassKind.OBJECT -> { + add(NEUEventSubscriber(InvocationKind.OBJECT_INSTANCE, element)) + } + + else -> { + logger.error( + "@NEUAutoSubscribe is only valid on classes and objects, not on ${element.classKind}", + element + ) + continue + } + } + } + + } + + val subscribers = mutableListOf<NEUEventSubscriber>() + override fun process(resolver: Resolver): List<KSAnnotated> { + val candidates = resolver.getSymbolsWithAnnotation(NEUAutoSubscribe::class.qualifiedName!!).toList() + val valid = candidates.filter { it.validate() } + val invalid = candidates.filter { !it.validate() } + + subscribers.addAll(collectSubscribers(valid)) + return invalid + } + + override fun finish() { + if (subscribers.isEmpty()) return + val deps = subscribers.mapNotNull { it.declaration.containingFile } + logger.info("Dependencies: $deps") + FileSpec.builder("io.github.moulberry.notenoughupdates.autosubscribe", "AutoLoad") + .addFileComment("@generated by ${NEUAutoSymbolProcessor::class.simpleName}") + .addType( + TypeSpec.objectBuilder("AutoLoad") + .addFunction( + FunSpec.builder("provide") + .addParameter( + "consumer", + Consumer::class.asTypeName() + .parameterizedBy(Supplier::class.parameterizedBy(Any::class)) + ) + .apply { + subscribers.sortedBy { it.declaration.simpleName.asString() }.forEach { (invocationKind, declaration) -> + when (invocationKind) { + InvocationKind.GET_INSTANCE -> addStatement( + "consumer.accept { %T.getInstance() }", + declaration.toClassName() + ) + + InvocationKind.OBJECT_INSTANCE -> addStatement( + "consumer.accept { %T }", + declaration.toClassName() + ) + + InvocationKind.DEFAULT_CONSTRUCTOR -> addStatement( + "consumer.accept { %T() }", + declaration.toClassName() + ) + + InvocationKind.ACCESS_INSTANCE -> addStatement( + "consumer.accept { %T.INSTANCE }", + declaration.toClassName() + ) + } + } + } + .build() + ) + .build() + ) + .build() + .writeTo(codeGenerator, aggregating = true, originatingKSFiles = deps) + } +} diff --git a/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessorProvider.kt b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessorProvider.kt new file mode 100644 index 00000000..ef0edd88 --- /dev/null +++ b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUAutoSymbolProcessorProvider.kt @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2023 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.autosubscribe + +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.processing.SymbolProcessorEnvironment +import com.google.devtools.ksp.processing.SymbolProcessorProvider + +class NEUAutoSymbolProcessorProvider : SymbolProcessorProvider { + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { + return NEUAutoSymbolProcessor(environment.codeGenerator, environment.logger) + } +} diff --git a/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUEventSubscriber.kt b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUEventSubscriber.kt new file mode 100644 index 00000000..d17b6004 --- /dev/null +++ b/annotations/src/main/kotlin/io/github/moulberry/notenoughupdates/autosubscribe/NEUEventSubscriber.kt @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2023 Linnea Gräf + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.autosubscribe + +import com.google.devtools.ksp.symbol.KSClassDeclaration + +internal data class NEUEventSubscriber( + val invocationKind: InvocationKind, + val declaration: KSClassDeclaration, +) + +internal enum class InvocationKind { + GET_INSTANCE, + OBJECT_INSTANCE, + DEFAULT_CONSTRUCTOR, + ACCESS_INSTANCE, +} diff --git a/annotations/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/annotations/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider new file mode 100644 index 00000000..eaad70ce --- /dev/null +++ b/annotations/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider @@ -0,0 +1,20 @@ +# +# Copyright (C) 2023 NotEnoughUpdates contributors +# +# This file is part of NotEnoughUpdates. +# +# NotEnoughUpdates is free software: you can redistribute it +# and/or modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. +# +# NotEnoughUpdates is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. +# + +io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSymbolProcessorProvider diff --git a/build.gradle.kts b/build.gradle.kts index e9e769a8..e41aa513 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,8 +30,8 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" id("io.github.juuxel.loom-quiltflower") version "1.7.3" `maven-publish` - id("io.freefair.lombok") version "6.5.1" - kotlin("jvm") version "1.7.20" + kotlin("jvm") version "1.8.0" + id("com.google.devtools.ksp") version "1.8.0-1.0.8" } @@ -62,6 +62,7 @@ loom { pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) mixinConfig("mixins.notenoughupdates.json") } + @Suppress("UnstableApiUsage") mixin { defaultRefmapName.set("mixins.notenoughupdates.refmap.json") } @@ -78,44 +79,43 @@ repositories { maven("https://repo.polyfrost.cc/releases") } -lombok { - version.set("1.18.24") -} - - -val shadowImplementation by configurations.creating { +val shadowImplementation: Configuration by configurations.creating { configurations.implementation.get().extendsFrom(this) } -val shadowOnly by configurations.creating { +val shadowOnly: Configuration by configurations.creating { } -val shadowApi by configurations.creating { +val shadowApi: Configuration by configurations.creating { configurations.api.get().extendsFrom(this) } -val devEnv by configurations.creating { +val devEnv: Configuration by configurations.creating { configurations.runtimeClasspath.get().extendsFrom(this) isCanBeResolved = false isCanBeConsumed = false isVisible = false } -val kotlinDependencies by configurations.creating { +val kotlinDependencies: Configuration by configurations.creating { configurations.implementation.get().extendsFrom(this) } -val oneconfigQuarantineSourceSet = sourceSets.create("oneconfig") { +val oneconfigQuarantineSourceSet: SourceSet = sourceSets.create("oneconfig") { java { srcDir(layout.projectDirectory.dir("src/main/oneconfig")) } - kotlin { +} + +configurations { + val main = getByName(sourceSets.main.get().compileClasspathConfigurationName) + "oneconfigImplementation" { + extendsFrom(main) } } dependencies { - implementation("org.projectlombok:lombok:1.18.22") minecraft("com.mojang:minecraft:1.8.9") mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") @@ -126,21 +126,27 @@ dependencies { runtimeOnly("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+") // Should be included in jar } - "oneconfigImplementation"(sourceSets.main.get().output) - "oneconfigImplementation"(sourceSets.main.get().compileClasspath) "oneconfigCompileOnly"(project(":oneconfigquarantine", configuration = "namedElements")) + "oneconfigImplementation"(sourceSets.main.get().output) "runtimeOnly"(oneconfigQuarantineSourceSet.output) // Please keep this version in sync with KotlinLoadingTweaker - implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.7.21")) + implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) kotlinDependencies(kotlin("stdlib")) + compileOnly(ksp(project(":annotations"))!!) + compileOnly("org.projectlombok:lombok:1.18.24") + annotationProcessor("org.projectlombok:lombok:1.18.24") + "oneconfigAnnotationProcessor"("org.projectlombok:lombok:1.18.24") + shadowImplementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false // Dependencies of mixin are already bundled by minecraft } annotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") + + @Suppress("VulnerableLibrariesLocal") shadowApi("info.bliki.wiki:bliki-core:3.1.0") - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") + testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") testAnnotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") // modImplementation("io.github.notenoughupdates:MoulConfig:0.0.1") @@ -151,15 +157,24 @@ dependencies { java { withSourcesJar() - toolchain.languageVersion.set(JavaLanguageVersion.of(8)) +// toolchain.languageVersion.set(JavaLanguageVersion.of(8)) } // Tasks: tasks.withType(JavaCompile::class) { options.encoding = "UTF-8" + options.isFork = true + if (JavaVersion.current().isJava9Compatible) + options.release.set(8) +} +tasks.named("compileOneconfigJava", JavaCompile::class) { + doFirst { + println("oneconfig args: ${this@named.options.compilerArgs}") + } } + tasks.named<Test>("test") { useJUnitPlatform() } @@ -189,12 +204,16 @@ val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") { } } +tasks.remapSourcesJar { + this.enabled = false +} + /* Bypassing https://github.com/johnrengelman/shadow/issues/111 */ // Use Zip instead of Jar as to not include META-INF val kotlinDependencyCollectionJar by tasks.creating(Zip::class) { archiveFileName.set("kotlin-libraries-wrapped.jar") destinationDirectory.set(project.layout.buildDirectory.dir("kotlinwrapper")) - from(kotlinDependencies.files) + from(kotlinDependencies) into("neu-kotlin-libraries-wrapped") } @@ -227,6 +246,15 @@ tasks.processResources { } } +idea { + module { + // Not using += due to https://github.com/gradle/gradle/issues/8749 + sourceDirs = sourceDirs + file("build/generated/ksp/main/kotlin") // or tasks["kspKotlin"].destination + testSourceDirs = testSourceDirs + file("build/generated/ksp/test/kotlin") + generatedSourceDirs = generatedSourceDirs + file("build/generated/ksp/main/kotlin") + file("build/generated/ksp/test/kotlin") + } +} + sourceSets.main { output.setResourcesDir(file("$buildDir/classes/java/main")) } diff --git a/buildSrc/src/main/kotlin/neubs/buildflags.kt b/buildSrc/src/main/kotlin/neubs/buildflags.kt index 6b7ab489..27c4bbcf 100644 --- a/buildSrc/src/main/kotlin/neubs/buildflags.kt +++ b/buildSrc/src/main/kotlin/neubs/buildflags.kt @@ -19,8 +19,13 @@ package neubs +import org.gradle.api.DefaultTask import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.MapProperty +import org.gradle.api.tasks.* +import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.the import java.nio.charset.StandardCharsets import java.util.* @@ -28,22 +33,16 @@ import java.util.* const val NEU_BUILDFLAGS_PREFIX = "neu.buildflags." class NEUBuildFlags : Plugin<Project> { + override fun apply(target: Project) { val props = target.properties.filterKeys { it.startsWith(NEU_BUILDFLAGS_PREFIX) }.mapValues { it.value as String } target.extensions.add("buildflags", Extension(props)) - target.tasks.create("generateBuildFlags") { - outputs.upToDateWhen { false } - val t = target.layout.buildDirectory.file("buildflags.properties") - outputs.file(t) - doLast { - val p = Properties() - p.putAll(props) - t.get().asFile.writer(StandardCharsets.UTF_8).use { - p.store(it, "Store build time configuration for NEU") - } - } - + target.tasks.create<WriteProperties>("generateBuildFlags") { + this.encoding = StandardCharsets.UTF_8.name() + this.setProperties(props) + this.comment = "Store build time configuration for NEU" + this.setOutputFile(target.layout.buildDirectory.file("buildflags.properties")) } } diff --git a/gradle.properties b/gradle.properties index 0009739e..0eb2e107 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,7 @@ org.gradle.jvmargs=-Xmx2G +org.gradle.parallel=true +org.gradle.caching=true +kotlin.incremental.useClasspathSnapshot=true loom.platform=forge # NEU Buildflags. Please keep these flags in a commented out form while checked into version control. # See BuildFlags.java for usages of these values. diff --git a/oneconfigquarantine/build.gradle.kts b/oneconfigquarantine/build.gradle.kts index 32bc3b7c..15797e1e 100644 --- a/oneconfigquarantine/build.gradle.kts +++ b/oneconfigquarantine/build.gradle.kts @@ -1,3 +1,5 @@ +import net.fabricmc.loom.task.RemapJarTask + /* * Copyright (C) 2022 NotEnoughUpdates contributors * @@ -43,3 +45,10 @@ dependencies { modApi("cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha+") // Don't you just love 0.1.0-alpha+ } +tasks.withType<JavaCompile> { + this.enabled = false +} +tasks.withType<RemapJarTask> { + println(this) + this.enabled = false +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a910edd3..86073a5b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -40,4 +40,5 @@ pluginManagement { } include("oneconfigquarantine") +include("annotations") rootProject.name = "NotEnoughUpdates" diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index ce15b09a..5c3083a3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -748,7 +748,7 @@ public class NEUManager { } } - public String getUUIDFromNBT(NBTTagCompound tag) { + public static String getUUIDFromNBT(NBTTagCompound tag) { String uuid = null; if (tag != null && tag.hasKey("ExtraAttributes", 10)) { NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); @@ -965,7 +965,7 @@ public class NEUManager { .resolveInternalName(); } - public String getUUIDForItem(ItemStack stack) { + public static String getUUIDForItem(ItemStack stack) { if (stack == null) return null; NBTTagCompound tag = stack.getTagCompound(); return getUUIDFromNBT(tag); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index d6ae6219..a4643eb5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -23,74 +23,35 @@ import com.google.common.collect.Sets; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; +import io.github.moulberry.notenoughupdates.autosubscribe.AutoLoad; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.commands.Commands; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; -import io.github.moulberry.notenoughupdates.cosmetics.CapeManager; import io.github.moulberry.notenoughupdates.cosmetics.ShaderManager; -import io.github.moulberry.notenoughupdates.dungeons.DungeonMap; import io.github.moulberry.notenoughupdates.listener.ChatListener; import io.github.moulberry.notenoughupdates.listener.ItemTooltipEssenceShopListener; import io.github.moulberry.notenoughupdates.listener.ItemTooltipListener; import io.github.moulberry.notenoughupdates.listener.ItemTooltipRngListener; import io.github.moulberry.notenoughupdates.listener.NEUEventListener; -import io.github.moulberry.notenoughupdates.listener.OldAnimationChecker; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.listener.WorldListener; -import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneContactHelper; -import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneFavourites; -import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; -import io.github.moulberry.notenoughupdates.miscfeatures.AntiCoopAdd; -import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; -import io.github.moulberry.notenoughupdates.miscfeatures.AuctionProfit; -import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; -import io.github.moulberry.notenoughupdates.miscfeatures.CrystalOverlay; -import io.github.moulberry.notenoughupdates.miscfeatures.CrystalWishingCompassSolver; -import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects; import io.github.moulberry.notenoughupdates.miscfeatures.CustomSkulls; -import io.github.moulberry.notenoughupdates.miscfeatures.DungeonNpcProfitOverlay; -import io.github.moulberry.notenoughupdates.miscfeatures.DwarvenMinesWaypoints; -import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import io.github.moulberry.notenoughupdates.miscfeatures.FairySouls; -import io.github.moulberry.notenoughupdates.miscfeatures.FishingHelper; -import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCustomizeManager; -import io.github.moulberry.notenoughupdates.miscfeatures.MiningStuff; import io.github.moulberry.notenoughupdates.miscfeatures.NPCRetexturing; import io.github.moulberry.notenoughupdates.miscfeatures.Navigation; -import io.github.moulberry.notenoughupdates.miscfeatures.NullzeeSphere; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; -import io.github.moulberry.notenoughupdates.miscfeatures.PowerStoneStatsDisplay; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; -import io.github.moulberry.notenoughupdates.miscfeatures.SunTzu; -import io.github.moulberry.notenoughupdates.miscfeatures.WardrobeMouseButtons; -import io.github.moulberry.notenoughupdates.miscfeatures.WitherCloakChanger; -import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBlockSounds; -import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.DwarvenMinesTextures; -import io.github.moulberry.notenoughupdates.miscfeatures.item.enchants.EnchantStyleCustomizer; import io.github.moulberry.notenoughupdates.miscfeatures.updater.AutoUpdater; -import io.github.moulberry.notenoughupdates.miscfeatures.world.EnderNodeHighlighter; -import io.github.moulberry.notenoughupdates.miscfeatures.world.FrozenTreasuresHighlighter; -import io.github.moulberry.notenoughupdates.miscfeatures.world.GlowingMushroomHighlighter; -import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay; -import io.github.moulberry.notenoughupdates.miscgui.InventoryStorageSelector; -import io.github.moulberry.notenoughupdates.miscgui.SignCalculator; -import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay; -import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager; import io.github.moulberry.notenoughupdates.mixins.AccessorMinecraft; import io.github.moulberry.notenoughupdates.oneconfig.IOneConfigCompat; import io.github.moulberry.notenoughupdates.options.NEUConfig; -import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; -import io.github.moulberry.notenoughupdates.overlays.FuelBar; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; import io.github.moulberry.notenoughupdates.recipes.RecipeGenerator; -import io.github.moulberry.notenoughupdates.util.Constants; -import io.github.moulberry.notenoughupdates.util.SBInfo; -import io.github.moulberry.notenoughupdates.util.TitleUtil; import io.github.moulberry.notenoughupdates.util.Utils; -import io.github.moulberry.notenoughupdates.util.XPInformation; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; @@ -130,6 +91,7 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Set; +@NEUAutoSubscribe @Mod( modid = NotEnoughUpdates.MODID, version = NotEnoughUpdates.VERSION, clientSideOnly = true, useMetadata = true, guiFactory = "io.github.moulberry.notenoughupdates.core.config.MoulConfigGuiForgeInterop") @@ -297,62 +259,18 @@ public class NotEnoughUpdates { IOneConfigCompat.getInstance().ifPresent(it -> it.initConfig(config, this::saveConfig)); - MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new NEUEventListener(this)); MinecraftForge.EVENT_BUS.register(new RecipeGenerator(this)); - MinecraftForge.EVENT_BUS.register(CapeManager.getInstance()); - //MinecraftForge.EVENT_BUS.register(new SBGamemodes()); - MinecraftForge.EVENT_BUS.register(new EnchantingSolvers()); - MinecraftForge.EVENT_BUS.register(new CalendarOverlay()); - MinecraftForge.EVENT_BUS.register(SBInfo.getInstance()); - MinecraftForge.EVENT_BUS.register(CustomItemEffects.INSTANCE); - MinecraftForge.EVENT_BUS.register(new Constants()); - MinecraftForge.EVENT_BUS.register(new DungeonMap()); - MinecraftForge.EVENT_BUS.register(new SunTzu()); - MinecraftForge.EVENT_BUS.register(new WitherCloakChanger()); - MinecraftForge.EVENT_BUS.register(new MiningStuff()); - MinecraftForge.EVENT_BUS.register(FairySouls.getInstance()); - MinecraftForge.EVENT_BUS.register(new CrystalOverlay()); - MinecraftForge.EVENT_BUS.register(new ItemCooldowns()); - MinecraftForge.EVENT_BUS.register(new DwarvenMinesWaypoints()); - MinecraftForge.EVENT_BUS.register(new FuelBar()); - MinecraftForge.EVENT_BUS.register(new AuctionProfit()); - MinecraftForge.EVENT_BUS.register(new DungeonNpcProfitOverlay()); - MinecraftForge.EVENT_BUS.register(XPInformation.getInstance()); MinecraftForge.EVENT_BUS.register(OverlayManager.petInfoOverlay); MinecraftForge.EVENT_BUS.register(OverlayManager.timersOverlay); - MinecraftForge.EVENT_BUS.register(new NullzeeSphere()); - MinecraftForge.EVENT_BUS.register(InventoryStorageSelector.getInstance()); - MinecraftForge.EVENT_BUS.register(SlotLocking.getInstance()); - MinecraftForge.EVENT_BUS.register(FishingHelper.getInstance()); - MinecraftForge.EVENT_BUS.register(CrystalWishingCompassSolver.getInstance()); - MinecraftForge.EVENT_BUS.register(new DwarvenMinesTextures()); - MinecraftForge.EVENT_BUS.register(EquipmentOverlay.INSTANCE); - MinecraftForge.EVENT_BUS.register(CustomBiomes.INSTANCE); MinecraftForge.EVENT_BUS.register(new ChatListener(this)); MinecraftForge.EVENT_BUS.register(new ItemTooltipListener(this)); MinecraftForge.EVENT_BUS.register(new ItemTooltipRngListener(this)); MinecraftForge.EVENT_BUS.register(new ItemTooltipEssenceShopListener(this)); MinecraftForge.EVENT_BUS.register(new RenderListener(this)); - MinecraftForge.EVENT_BUS.register(new OldAnimationChecker()); - MinecraftForge.EVENT_BUS.register(new SignCalculator()); - MinecraftForge.EVENT_BUS.register(TrophyRewardOverlay.getInstance()); - MinecraftForge.EVENT_BUS.register(PowerStoneStatsDisplay.getInstance()); - MinecraftForge.EVENT_BUS.register(AntiCoopAdd.getInstance()); - MinecraftForge.EVENT_BUS.register(AbiphoneWarning.getInstance()); - MinecraftForge.EVENT_BUS.register(new BetterContainers()); - MinecraftForge.EVENT_BUS.register(AuctionBINWarning.getInstance()); - MinecraftForge.EVENT_BUS.register(MinionHelperManager.getInstance()); MinecraftForge.EVENT_BUS.register(navigation); - MinecraftForge.EVENT_BUS.register(new GlowingMushroomHighlighter()); MinecraftForge.EVENT_BUS.register(new WorldListener(this)); - MinecraftForge.EVENT_BUS.register(EnchantStyleCustomizer.INSTANCE); - MinecraftForge.EVENT_BUS.register(TitleUtil.getInstance()); - MinecraftForge.EVENT_BUS.register(EnderNodeHighlighter.getInstance()); - MinecraftForge.EVENT_BUS.register(FrozenTreasuresHighlighter.getInstance()); - MinecraftForge.EVENT_BUS.register(AbiphoneFavourites.getInstance()); - MinecraftForge.EVENT_BUS.register(AbiphoneContactHelper.getInstance()); - MinecraftForge.EVENT_BUS.register(new WardrobeMouseButtons()); + AutoLoad.INSTANCE.provide(supplier -> MinecraftForge.EVENT_BUS.register(supplier.get())); if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) { IReloadableResourceManager manager = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index 7a609a2a..4a7c1939 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -24,6 +24,7 @@ import com.google.common.collect.HashBiMap; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.shader.Framebuffer; @@ -44,6 +45,7 @@ import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +@NEUAutoSubscribe public class CapeManager { public static final CapeManager INSTANCE = new CapeManager(); public long lastCapeUpdate = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java index e15168f5..686cef8e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.dungeons; import com.google.common.collect.Iterables; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.util.NEUResourceManager; @@ -73,6 +74,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +@NEUAutoSubscribe public class DungeonMap { private static final ResourceLocation GREEN_CHECK = new ResourceLocation( "notenoughupdates:dungeon_map/green_check.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/OldAnimationChecker.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/OldAnimationChecker.java index 7858918b..8d62c0aa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/OldAnimationChecker.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/OldAnimationChecker.java @@ -21,12 +21,14 @@ package io.github.moulberry.notenoughupdates.listener; import com.google.common.collect.Lists; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +@NEUAutoSubscribe public class OldAnimationChecker { private void unregister() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/loader/KotlinLoadingTweaker.java b/src/main/java/io/github/moulberry/notenoughupdates/loader/KotlinLoadingTweaker.java index 0c63b17d..bf4e746f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/loader/KotlinLoadingTweaker.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/loader/KotlinLoadingTweaker.java @@ -82,7 +82,7 @@ public class KotlinLoadingTweaker implements ITweaker { * Full version format: [1, 7, 20] (1.7.20) * RC version format: [1, 7, 20, 1] (1.7.20-rc1) */ - public static final int[] BUNDLED_KOTLIN_VERSION = new int[]{1, 7, 20}; + public static final int[] BUNDLED_KOTLIN_VERSION = new int[]{1, 8, 0}; @Override public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneContactHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneContactHelper.java index d2a5fc84..3178d241 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneContactHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneContactHelper.java @@ -24,6 +24,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Constants; @@ -36,6 +37,7 @@ import org.lwjgl.input.Keyboard; import java.util.List; import java.util.Map; +@NEUAutoSubscribe public class AbiphoneContactHelper { private static final AbiphoneContactHelper INSTANCE = new AbiphoneContactHelper(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java index ce96b29a..3366fd1e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; @@ -44,6 +45,7 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; +@NEUAutoSubscribe public class AbiphoneFavourites { private static final AbiphoneFavourites INSTANCE = new AbiphoneFavourites(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java index 67ac4f4c..2c28bcd1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.GuiElement; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; @@ -41,6 +42,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.List; +@NEUAutoSubscribe public class AbiphoneWarning extends GuiElement { private static final AbiphoneWarning INSTANCE = new AbiphoneWarning(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java index aaa13d39..40425560 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -32,6 +33,7 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +@NEUAutoSubscribe public class AntiCoopAdd { private static final AntiCoopAdd INSTANCE = new AntiCoopAdd(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java index 75813700..8f6671d2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.GuiElement; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; @@ -43,6 +44,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class AuctionBINWarning extends GuiElement { private static final AuctionBINWarning INSTANCE = new AuctionBINWarning(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java index 82c392e4..c0e40ec9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.util.Utils; @@ -39,6 +40,7 @@ import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.GL11; +@NEUAutoSubscribe public class AuctionProfit { public static final ResourceLocation auctionProfitImage = diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java index dc7b0e15..e7331378 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; @@ -47,6 +48,7 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.HashMap; +@NEUAutoSubscribe public class BetterContainers { private static final ResourceLocation TOGGLE_OFF = new ResourceLocation("notenoughupdates:dynamic_54/toggle_off.png"); private static final ResourceLocation TOGGLE_ON = new ResourceLocation("notenoughupdates:dynamic_54/toggle_on.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java index c0653742..047f3c99 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.ReverseWorldRenderer; import io.github.moulberry.notenoughupdates.util.SpecialColour; import net.minecraft.client.Minecraft; @@ -48,6 +49,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +@NEUAutoSubscribe public class CrystalOverlay { private enum CrystalType { FARMING_MINION(8, 0xDAA520), diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java index 50975af9..c6e714fe 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.Line; import io.github.moulberry.notenoughupdates.core.util.Vec3Comparable; import io.github.moulberry.notenoughupdates.events.SpawnParticleEvent; @@ -52,6 +53,7 @@ import java.util.Locale; import java.util.function.BooleanSupplier; import java.util.function.LongSupplier; +@NEUAutoSubscribe public class CrystalWishingCompassSolver { enum SolverState { NOT_STARTED, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index 452f8a9b..e959c761 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; @@ -76,6 +77,7 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class CustomItemEffects { public static final CustomItemEffects INSTANCE = new CustomItemEffects(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java index 28ce10f1..711d5235 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.util.ItemUtils; @@ -52,6 +53,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class DungeonNpcProfitOverlay { private static final ResourceLocation dungeonProfitResource = diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java index 6b2c9ac9..e2eb13b2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.overlays.MiningOverlay; @@ -46,6 +47,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class DwarvenMinesWaypoints { private final HashMap<String, Vector3f> waypointsMap = new HashMap<String, Vector3f>() {{ diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index d5cbfdde..695c9851 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -45,6 +46,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +@NEUAutoSubscribe public class EnchantingSolvers { public static SolverType currentSolver = SolverType.NONE; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java index 9e3343a4..5a611178 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java @@ -25,6 +25,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.commands.ClientCommandBase; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; @@ -64,6 +65,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.stream.Collectors; +@NEUAutoSubscribe public class FairySouls { private static FairySouls instance = null; private static final String unknownProfile = "unknown"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java index a7c22b93..800e25b1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.ChromaColour; import io.github.moulberry.notenoughupdates.events.SpawnParticleEvent; import io.github.moulberry.notenoughupdates.util.SpecialColour; @@ -53,6 +54,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +@NEUAutoSubscribe public class FishingHelper { private static final FishingHelper INSTANCE = new FishingHelper(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java index e5ee40d0..5651a6ed 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -36,6 +37,7 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class ItemCooldowns { private static final Pattern COOLDOWN_LORE = Pattern.compile("\\u00a78Cooldown: \\u00a7a(\\d+)s"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java index 15fc8ef8..dad801ec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.ChromaColour; import net.minecraft.client.Minecraft; @@ -67,8 +68,6 @@ public class ItemCustomizeManager { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); private static ItemDataMap itemDataMap = new ItemDataMap(); - private static final HashMap<Integer, String> itemUuidCache = new HashMap<>(); - public static class ItemDataMap { public HashMap<String, ItemData> itemData = new HashMap<>(); } @@ -269,25 +268,10 @@ public class ItemCustomizeManager { return CUSTOM_GLINT_TEXTURE; } - public static String getUuidForItem(ItemStack stack) { - if (!stack.hasTagCompound()) return null; - - int nbtHash = stack.getTagCompound().hashCode(); - - if (itemUuidCache.containsKey(nbtHash)) { - return itemUuidCache.get(nbtHash); - } - - String uuid = NotEnoughUpdates.INSTANCE.manager.getUUIDForItem(stack); - - itemUuidCache.put(nbtHash, uuid); - return uuid; - } - public static ItemData getDataForItem(ItemStack stack) { if (stack == null) return null; - String uuid = getUuidForItem(stack); + String uuid = NEUManager.getUUIDForItem(stack); if (uuid == null) { return null; @@ -297,7 +281,6 @@ public class ItemCustomizeManager { } public static void tick() { - itemUuidCache.clear(); disableTextureBinding = false; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java index 12e0301b..2cbd3125 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; import io.github.moulberry.notenoughupdates.overlays.MiningOverlay; import io.github.moulberry.notenoughupdates.util.SBInfo; @@ -44,6 +45,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.Map; +@NEUAutoSubscribe public class MiningStuff { private static BlockPos overlayLoc = null; private static long titaniumNotifMillis = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NullzeeSphere.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NullzeeSphere.java index 6302343e..08d48962 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NullzeeSphere.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NullzeeSphere.java @@ -19,6 +19,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.ReverseWorldRenderer; import io.github.moulberry.notenoughupdates.util.SpecialColour; import net.minecraft.client.Minecraft; @@ -41,6 +42,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +@NEUAutoSubscribe public class NullzeeSphere { public static boolean enabled = false; public static float size = 20; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PowerStoneStatsDisplay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PowerStoneStatsDisplay.java index 975bbe6e..31dd71eb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PowerStoneStatsDisplay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PowerStoneStatsDisplay.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.ItemUtils; @@ -39,6 +40,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Locale; +@NEUAutoSubscribe public class PowerStoneStatsDisplay { private static PowerStoneStatsDisplay instance = null; private final NumberFormat format = NumberFormat.getInstance(Locale.US); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java index 7e65e032..b447cf61 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent; @@ -64,6 +65,7 @@ import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.util.HashMap; +@NEUAutoSubscribe public class SlotLocking { private static final SlotLocking INSTANCE = new SlotLocking(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java index 7fc8beba..736d5058 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java @@ -19,6 +19,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; @@ -30,6 +31,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.Random; +@NEUAutoSubscribe public class SunTzu { private static boolean enabled = false; private static int quoteNum = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WardrobeMouseButtons.kt b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WardrobeMouseButtons.kt index d34f3b5e..f38d3752 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WardrobeMouseButtons.kt +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WardrobeMouseButtons.kt @@ -19,12 +19,14 @@ package io.github.moulberry.notenoughupdates.miscfeatures import io.github.moulberry.notenoughupdates.NotEnoughUpdates +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.core.config.KeybindHelper import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.gui.inventory.GuiChest import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +@NEUAutoSubscribe class WardrobeMouseButtons { private val keybinds: List<Int> get() = listOf( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WitherCloakChanger.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WitherCloakChanger.java index 02d7bf7b..704606bf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WitherCloakChanger.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WitherCloakChanger.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; @@ -33,6 +34,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; +@NEUAutoSubscribe public class WitherCloakChanger { public static boolean isCloakActive = false; /** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBiomes.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBiomes.java index 48a01187..dd97a1f0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBiomes.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBiomes.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.customblockzones; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.OnBlockBreakSoundEffect; import io.github.moulberry.notenoughupdates.util.SBInfo; import net.minecraft.block.BlockColored; @@ -37,6 +38,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.HashMap; import java.util.Map; + +@NEUAutoSubscribe public class CustomBiomes { public static final CustomBiomes INSTANCE = new CustomBiomes(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/DwarvenMinesTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/DwarvenMinesTextures.java index 1c6acc1d..df437fee 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/DwarvenMinesTextures.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/DwarvenMinesTextures.java @@ -24,6 +24,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; @@ -46,6 +47,7 @@ import java.util.Set; import static io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes.isMithril; import static io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes.isTitanium; +@NEUAutoSubscribe public class DwarvenMinesTextures implements IslandZoneSubdivider { private static class IgnoreColumn { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/item/enchants/EnchantStyleCustomizer.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/item/enchants/EnchantStyleCustomizer.java index 47acfa60..82db0b30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/item/enchants/EnchantStyleCustomizer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/item/enchants/EnchantStyleCustomizer.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.item.enchants; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.LRUCache; import io.github.moulberry.notenoughupdates.util.LateBindingChroma; import io.github.moulberry.notenoughupdates.util.Utils; @@ -33,6 +34,7 @@ import java.util.List; import java.util.Set; import java.util.regex.Matcher; +@NEUAutoSubscribe public class EnchantStyleCustomizer { public static EnchantStyleCustomizer INSTANCE = new EnchantStyleCustomizer(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/EnderNodeHighlighter.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/EnderNodeHighlighter.java index ce0e6a25..51fc950c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/EnderNodeHighlighter.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/EnderNodeHighlighter.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.world; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SpawnParticleEvent; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; @@ -33,6 +34,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import static io.github.moulberry.notenoughupdates.util.MathUtil.basicallyEqual; +@NEUAutoSubscribe public class EnderNodeHighlighter extends GenericBlockHighlighter { private static final EnderNodeHighlighter INSTANCE = new EnderNodeHighlighter(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/FrozenTreasuresHighlighter.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/FrozenTreasuresHighlighter.java index a7a8706a..2f8071a0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/FrozenTreasuresHighlighter.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/FrozenTreasuresHighlighter.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.world; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; import net.minecraft.block.Block; @@ -34,6 +35,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import java.util.List; +@NEUAutoSubscribe public class FrozenTreasuresHighlighter extends GenericBlockHighlighter { private static final FrozenTreasuresHighlighter INSTANCE = new FrozenTreasuresHighlighter(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GlowingMushroomHighlighter.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GlowingMushroomHighlighter.java index fa5794ea..17f5f527 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GlowingMushroomHighlighter.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GlowingMushroomHighlighter.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.world; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SpawnParticleEvent; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; @@ -33,6 +34,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import static io.github.moulberry.notenoughupdates.util.MathUtil.isDecimalPartApproximately; +@NEUAutoSubscribe public class GlowingMushroomHighlighter extends GenericBlockHighlighter { @SubscribeEvent diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java index 5f5c4832..48d37f2f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -24,6 +24,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -66,6 +67,7 @@ import java.util.regex.Pattern; import static io.github.moulberry.notenoughupdates.util.GuiTextures.help; +@NEUAutoSubscribe public class CalendarOverlay { private static final ResourceLocation BACKGROUND = new ResourceLocation("notenoughupdates:calendar/background.png"); private static final ResourceLocation DISPLAYBAR = new ResourceLocation("notenoughupdates:calendar/displaybar.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java index 205dcd83..8ee68457 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; import io.github.moulberry.notenoughupdates.util.Utils; @@ -39,7 +40,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; - +@NEUAutoSubscribe public class InventoryStorageSelector { private static final InventoryStorageSelector INSTANCE = new InventoryStorageSelector(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/SignCalculator.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/SignCalculator.java index ac676a98..4f01e551 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/SignCalculator.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/SignCalculator.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.SignSubmitEvent; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiEditSign; import io.github.moulberry.notenoughupdates.util.Calculator; @@ -35,6 +36,7 @@ import java.text.DecimalFormat; import java.math.BigDecimal; import java.util.Objects; +@NEUAutoSubscribe public class SignCalculator { String lastSource = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java index 828e50b1..e13934e1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.util.Constants; @@ -50,6 +51,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +@NEUAutoSubscribe public class TrophyRewardOverlay { private static TrophyRewardOverlay instance = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java index 512ebb8f..03eb227c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscgui.minionhelper; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.miscgui.minionhelper.loaders.MinionHelperApiLoader; import io.github.moulberry.notenoughupdates.miscgui.minionhelper.loaders.MinionHelperChatLoader; import io.github.moulberry.notenoughupdates.miscgui.minionhelper.loaders.MinionHelperInventoryLoader; @@ -41,6 +42,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +@NEUAutoSubscribe public class MinionHelperManager { private static MinionHelperManager instance = null; private final Map<String, Minion> minions = new HashMap<>(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index 5cd8f6b3..db81bfa4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -24,6 +24,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.GuiInventoryBackgroundDrawnEvent; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; @@ -54,6 +55,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +@NEUAutoSubscribe public class EquipmentOverlay { public static EquipmentOverlay INSTANCE = new EquipmentOverlay(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java index f2e485f2..9212eb6f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.overlays; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.core.config.gui.GuiPositionEditor; import io.github.moulberry.notenoughupdates.util.SBInfo; @@ -38,6 +39,7 @@ import org.lwjgl.opengl.GL14; import java.awt.*; +@NEUAutoSubscribe public class FuelBar { public static final ResourceLocation FUEL_BAR = new ResourceLocation("notenoughupdates:fuel_bar.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java index 0105ba1f..6b1bef26 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java @@ -30,6 +30,7 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent; import io.github.moulberry.notenoughupdates.recipes.EssenceUpgrades; import io.github.moulberry.notenoughupdates.recipes.NeuRecipe; @@ -40,6 +41,7 @@ import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import java.util.regex.Pattern; +@NEUAutoSubscribe public class Constants { private static class PatternSerializer implements JsonDeserializer<Pattern>, JsonSerializer<Pattern> { @Override diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index ec7ec404..8ce765aa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.util; import com.google.common.reflect.TypeToken; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeListener; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager; @@ -65,6 +66,7 @@ import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class SBInfo { private static final SBInfo INSTANCE = new SBInfo(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/TitleUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/TitleUtil.java index 59db7cac..71b4e8dc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/TitleUtil.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/TitleUtil.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.util; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -27,6 +28,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +@NEUAutoSubscribe public class TitleUtil { private static final TitleUtil INSTANCE = new TitleUtil(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java index 81eea343..94bfbee8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.util; import com.google.common.base.Splitter; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -34,6 +35,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +@NEUAutoSubscribe public class XPInformation { private static final XPInformation INSTANCE = new XPInformation(); diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt index 200aa3fa..99066e52 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt @@ -23,7 +23,9 @@ import com.google.gson.JsonObject import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay.Rarity import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe +@NEUAutoSubscribe object PetLeveling { data class ExpLadder( |