From 28e3880a0b3ca8e78076f5e6cf3c1329652e2739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20B=C3=A4rtschi?= Date: Thu, 27 Jun 2024 12:48:44 +0200 Subject: [PATCH] relicense to LGPL-3.0-only --- HEADER.java | 6 + LICENSE | 178 +++++++++-- build.gradle.kts | 281 +++++++++--------- gradle.properties | 2 +- settings.gradle.kts | 12 +- .../environmenttech/unittest/TestMod.java | 6 + .../unittest/TestProgressBar.java | 7 + .../resources/META-INF/neoforge.mods.toml | 2 +- .../robaertschi/environmenttech/Config.java | 6 + .../environmenttech/EnvironmentTech.java | 13 +- .../environmenttech/client/ETClient.java | 10 +- .../client/particle/EnvParticleProvider.java | 13 +- .../client/renderer/ContentBoxRenderer.java | 7 + .../client/renderer/EnvStorageRenderer.java | 13 +- .../client/screen/EnvCollectorScreen.java | 10 +- .../client/screen/ProgressArrowUtils.java | 7 + .../command/EnvironmenttechCommand.java | 12 +- .../environmenttech/compat/ETCompat.java | 7 + .../jei/EnvCollectorRecipeCategory.java | 16 +- .../compat/jei/JeiCompatPlugin.java | 14 +- .../compat/top/TOPInfoProvider.java | 7 + .../environmenttech/compat/top/TopCompat.java | 20 +- .../data/attachments/ETAttachments.java | 14 +- .../data/capabilities/AdaptedItemHandler.java | 10 +- .../data/capabilities/ETCapabilities.java | 10 +- .../data/capabilities/EnvStorage.java | 6 + .../data/capabilities/EnvType.java | 6 + .../data/capabilities/IEnvStorage.java | 6 + .../data/components/ETComponents.java | 10 +- .../data/components/FilledComponent.java | 14 +- .../data/recipes/ETRecipes.java | 13 +- .../data/recipes/EnvCollectorRecipe.java | 19 +- .../recipes/EnvCollectorRecipeSerializer.java | 16 +- .../datagen/ETBlockStateProvider.java | 10 +- .../environmenttech/datagen/ETDatagen.java | 15 +- .../datagen/ETItemModelProvider.java | 12 +- .../datagen/ETRecipeProvider.java | 16 +- .../environmenttech/level/ETChunkEvents.java | 13 +- .../environmenttech/level/block/ETBlocks.java | 9 +- .../level/block/EnvCollectorBlock.java | 20 +- .../level/block/EnvDistributorBlock.java | 18 +- .../level/block/SimpleBlockWithEntity.java | 22 +- .../level/block/entity/ETBlockEntities.java | 14 +- .../block/entity/EnvCollectorBlockEntity.java | 23 +- .../entity/EnvDistributorBlockEntity.java | 15 +- .../block/entity/ITickableBlockEntity.java | 6 + .../entity/renderer/EnvCollectorRenderer.java | 18 +- .../environmenttech/level/item/ETItems.java | 16 +- .../level/item/EnvDetectorItem.java | 16 +- .../level/particle/ETParticles.java | 13 +- .../level/particle/EnvParticle.java | 9 +- .../environmenttech/menu/ETMenus.java | 11 +- .../menu/EnvCollectorMenu.java | 13 +- .../environmenttech/utils/MouseUtils.java | 6 + 54 files changed, 800 insertions(+), 268 deletions(-) create mode 100644 HEADER.java diff --git a/HEADER.java b/HEADER.java new file mode 100644 index 0000000..dba6113 --- /dev/null +++ b/HEADER.java @@ -0,0 +1,6 @@ +/* + * EnvironmentTech Copyright (C) $YEAR Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ \ No newline at end of file diff --git a/LICENSE b/LICENSE index 3010ae8..153d416 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,165 @@ -The MIT License (MIT) + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 -Copyright (c) 2024 RoBaertschi + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 0e20329..1e7b6f4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,13 @@ import java.net.URI plugins { - `java-library` - eclipse - idea - `maven-publish` - id("io.freefair.lombok") version "8.6" - id ("net.neoforged.gradle.userdev") version ("7.0.151") + `java-library` + eclipse + idea + `maven-publish` + id("io.freefair.lombok") version "8.6" + id ("net.neoforged.gradle.userdev") version ("7.0.151") + id("com.diffplug.spotless") version "7.0.0.BETA1" } val minecraftVersion: String by project @@ -37,62 +38,76 @@ version = modVersion group = modGroupId repositories { - mavenLocal() - maven { - url = URI.create("https://maven.k-4u.nl") - } - maven { - url = URI.create("https://maven.blamejared.com") - name = "BlameJared" - } + mavenLocal() + maven { + url = URI.create("https://maven.k-4u.nl") + } + maven { + url = URI.create("https://maven.blamejared.com") + name = "BlameJared" + } - maven { - url = URI.create("https://maven.shedaniel.me/") - name = "Shedaniel" - } - maven { - url = URI.create("https://maven.architectury.dev/") - name = "Architectury" - } - maven { - url = URI.create("https://maven.terraformersmc.com/") - name = "TerraformersMC" - } + maven { + url = URI.create("https://maven.shedaniel.me/") + name = "Shedaniel" + } + maven { + url = URI.create("https://maven.architectury.dev/") + name = "Architectury" + } + maven { + url = URI.create("https://maven.terraformersmc.com/") + name = "TerraformersMC" + } } base { - archivesName = modId + archivesName = modId } java.toolchain.languageVersion = JavaLanguageVersion.of(21) +spotless { + format("misc") { + target("*.gradle.kts", ".gitattributes", ".gitignore") + trimTrailingWhitespace() + indentWithTabs() + endWithNewline() + } + + java { + importOrder("lombok", "java|javax", "", "net.minecraft", "com.mojang", "robaertschi", "\\#") + removeUnusedImports() + licenseHeaderFile("HEADER.java") + } +} sourceSets { - // Include resources generated by data generators. - main.configure { - resources { - srcDir("src/generated/resources") - } - } - create("junit") { - java { - } + // Include resources generated by data generators. + main.configure { + resources { + srcDir("src/generated/resources") + } + } + create("junit") { + java { + } - compileClasspath += sourceSets.main.get().output - runtimeClasspath += sourceSets.main.get().output + compileClasspath += sourceSets.main.get().output + runtimeClasspath += sourceSets.main.get().output - } + } } val junitImplementation: Configuration by configurations.getting { - extendsFrom(configurations.implementation.get()) + extendsFrom(configurations.implementation.get()) } val junitRuntimeOnly: Configuration by configurations.getting { - extendsFrom(configurations.runtimeOnly.get()) + extendsFrom(configurations.runtimeOnly.get()) } @@ -108,60 +123,60 @@ configurations["junitImplementation"].extendsFrom(configurations.implementation. runs { - configureEach { - // Recommended logging data for an userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - systemProperty ("forge.logging.markers", "REGISTRIES") + configureEach { + // Recommended logging data for an userdev environment + // The markers can be added/remove as needed separated by commas. + // "SCAN": For mods scan. + // "REGISTRIES": For firing of registry events. + // "REGISTRYDUMP": For getting the contents of all registries. + systemProperty ("forge.logging.markers", "REGISTRIES") - systemProperty ("forge.logging.console.level", "debug") + systemProperty ("forge.logging.console.level", "debug") - modSource (project.sourceSets["main"]) - } + modSource (project.sourceSets["main"]) + } - create("junit") { - junit(true) + create("junit") { + junit(true) - unitTestSources(sourceSets["junit"]) - } + unitTestSources(sourceSets["junit"]) + } - create("client") { - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - systemProperty ("forge.enabledGameTestNamespaces", modId) - } + create("client") { + // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. + systemProperty ("forge.enabledGameTestNamespaces", modId) + } - create("server") { - systemProperty ("forge.enabledGameTestNamespaces", modId) - programArgument ("--nogui") - } + create("server") { + systemProperty ("forge.enabledGameTestNamespaces", modId) + programArgument ("--nogui") + } - // This run config launches GameTestServer and runs all registered gametests, then exits. - // By default, the server will crash when no gametests are provided. - // The gametest system is also enabled by default for other run configs under the /test command. - create("gameTestServer") { - systemProperty ("forge.enabledGameTestNamespaces", modId) + // This run config launches GameTestServer and runs all registered gametests, then exits. + // By default, the server will crash when no gametests are provided. + // The gametest system is also enabled by default for other run configs under the /test command. + create("gameTestServer") { + systemProperty ("forge.enabledGameTestNamespaces", modId) - } + } - create("data") { - // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it - // workingDirectory project.file("run-data") + create("data") { + // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it + // workingDirectory project.file("run-data") - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - programArguments.addAll ("--mod", modId, "--all", "--output", file("src/generated/resources/").absolutePath, "--existing", file("src/main/resources/").absolutePath) - } + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. + programArguments.addAll ("--mod", modId, "--all", "--output", file("src/generated/resources/").absolutePath, "--existing", file("src/main/resources/").absolutePath) + } } dependencies { - implementation ("net.neoforged:neoforge:${neoVersion}") + implementation ("net.neoforged:neoforge:${neoVersion}") - compileOnly("mcjty.theoneprobe:theoneprobe:${topVersion}") - if (withTop) - runtimeOnly("mcjty.theoneprobe:theoneprobe:${topVersion}") + compileOnly("mcjty.theoneprobe:theoneprobe:${topVersion}") + if (withTop) + runtimeOnly("mcjty.theoneprobe:theoneprobe:${topVersion}") // compileOnly("dev.emi:emi-neoforge:${emiVersion}:api") // runtimeOnly("dev.emi:emi-neoforge:${emiVersion}") // runtimeOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${reiVersion}") @@ -169,40 +184,40 @@ dependencies { // compileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-neoforge:${reiVersion}") - // Testing - junitImplementation(platform("org.junit:junit-bom:${junitVersion}")) - junitImplementation("org.junit.jupiter:junit-jupiter-params") - junitRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + // Testing + junitImplementation(platform("org.junit:junit-bom:${junitVersion}")) + junitImplementation("org.junit.jupiter:junit-jupiter-params") + junitRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") - junitImplementation("org.assertj:assertj-core:${assertjVersion}") + junitImplementation("org.assertj:assertj-core:${assertjVersion}") - // Example mod dependency with JEI - // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime - compileOnly("mezz.jei:jei-${jeiMcVersion}-common-api:${jeiVersion}") - compileOnly("mezz.jei:jei-${jeiMcVersion}-neoforge-api:${jeiVersion}") - runtimeOnly("mezz.jei:jei-${jeiMcVersion}-neoforge:${jeiVersion}") + // Example mod dependency with JEI + // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime + compileOnly("mezz.jei:jei-${jeiMcVersion}-common-api:${jeiVersion}") + compileOnly("mezz.jei:jei-${jeiMcVersion}-neoforge-api:${jeiVersion}") + runtimeOnly("mezz.jei:jei-${jeiMcVersion}-neoforge:${jeiVersion}") - // Example mod dependency using a mod jar from ./libs with a flat dir repository - // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar - // The group id is ignored when searching -- in this case, it is "blank" - // implementation "blank:coolmod-${mc_version}:${coolmod_version}" + // Example mod dependency using a mod jar from ./libs with a flat dir repository + // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar + // The group id is ignored when searching -- in this case, it is "blank" + // implementation "blank:coolmod-${mc_version}:${coolmod_version}" - // Example mod dependency using a file as dependency - // implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar") + // Example mod dependency using a file as dependency + // implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar") - // Example project dependency using a sister or child project: - // implementation project(":myproject") + // Example project dependency using a sister or child project: + // implementation project(":myproject") - // For more info: - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html + // For more info: + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html } afterEvaluate { // runs["junit"].modSources(runs["junit"].modSources) // runs["junit"].modSources = runs["junit"].modSources.get().stream().filter { it != sourceSets.main.get() }.toList() - runs["junit"].modSources.all().get().values().remove(sourceSets.main.get()) + runs["junit"].modSources.all().get().values().remove(sourceSets.main.get()) } @@ -212,49 +227,49 @@ afterEvaluate { // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments. // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html tasks.withType().configureEach { - val replaceProperties = mapOf( - "minecraft_version" to minecraftVersion, - "minecraft_version_range" to minecraftVersionRange, - "neo_version" to neoVersion, - "neo_version_range" to neoVersionRange, - "loader_version_range" to loaderVersionRange, - "mod_id" to modId, - "mod_name" to modName, - "mod_license" to modLicense, - "mod_version" to modVersion, - "mod_authors" to modAuthors, - "mod_description" to modDescription) - inputs.properties(replaceProperties) + val replaceProperties = mapOf( + "minecraft_version" to minecraftVersion, + "minecraft_version_range" to minecraftVersionRange, + "neo_version" to neoVersion, + "neo_version_range" to neoVersionRange, + "loader_version_range" to loaderVersionRange, + "mod_id" to modId, + "mod_name" to modName, + "mod_license" to modLicense, + "mod_version" to modVersion, + "mod_authors" to modAuthors, + "mod_description" to modDescription) + inputs.properties(replaceProperties) - filesMatching("META-INF/neoforge.mods.toml") { - expand(replaceProperties) - } + filesMatching("META-INF/neoforge.mods.toml") { + expand(replaceProperties) + } } // Example configuration to allow publishing using the maven-publish plugin publishing { - publications { - register("mavenJava") { - from (components["java"]) - } - } - repositories { + publications { + register("mavenJava") { + from (components["java"]) + } + } + repositories { - maven { - url = project.projectDir.toURI() - } - } + maven { + url = project.projectDir.toURI() + } + } } // IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. idea { - module { - isDownloadJavadoc = true - isDownloadSources = true - } + module { + isDownloadJavadoc = true + isDownloadSources = true + } } tasks.test { - useJUnitPlatform() -} \ No newline at end of file + useJUnitPlatform() +} diff --git a/gradle.properties b/gradle.properties index 3b5d59b..c4d917c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,7 +29,7 @@ modId=environmenttech # The human-readable display name for the mod. modName=EnvironmentTech # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. -modLicense=MIT +modLicense=LGPL-3.0-only # The mod version. See https://semver.org/ modVersion=1.0-SNAPSHOT # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. diff --git a/settings.gradle.kts b/settings.gradle.kts index cf04d13..593404a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,11 @@ pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - maven ("https://maven.neoforged.net/releases") - } + repositories { + mavenLocal() + gradlePluginPortal() + maven ("https://maven.neoforged.net/releases") + } } plugins { - id ("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id ("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } diff --git a/src/junit/java/robaertschi/environmenttech/unittest/TestMod.java b/src/junit/java/robaertschi/environmenttech/unittest/TestMod.java index 0dcf83e..47188ea 100644 --- a/src/junit/java/robaertschi/environmenttech/unittest/TestMod.java +++ b/src/junit/java/robaertschi/environmenttech/unittest/TestMod.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.unittest; diff --git a/src/junit/java/robaertschi/environmenttech/unittest/TestProgressBar.java b/src/junit/java/robaertschi/environmenttech/unittest/TestProgressBar.java index 40ffe27..08f5037 100644 --- a/src/junit/java/robaertschi/environmenttech/unittest/TestProgressBar.java +++ b/src/junit/java/robaertschi/environmenttech/unittest/TestProgressBar.java @@ -1,6 +1,13 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.unittest; import org.junit.jupiter.api.Test; + import robaertschi.environmenttech.client.screen.ProgressArrowUtils; import static org.assertj.core.api.Assertions.*; diff --git a/src/junit/resources/META-INF/neoforge.mods.toml b/src/junit/resources/META-INF/neoforge.mods.toml index ecb953e..6fc99e4 100644 --- a/src/junit/resources/META-INF/neoforge.mods.toml +++ b/src/junit/resources/META-INF/neoforge.mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" loaderVersion="[2,)" -license="MIT" +license="LGPL-3.0-only" [[mods]] modId="environmenttech_tests" \ No newline at end of file diff --git a/src/main/java/robaertschi/environmenttech/Config.java b/src/main/java/robaertschi/environmenttech/Config.java index 4b233be..7ffaca9 100644 --- a/src/main/java/robaertschi/environmenttech/Config.java +++ b/src/main/java/robaertschi/environmenttech/Config.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech; import net.neoforged.bus.api.SubscribeEvent; diff --git a/src/main/java/robaertschi/environmenttech/EnvironmentTech.java b/src/main/java/robaertschi/environmenttech/EnvironmentTech.java index 7019b8b..1081cbe 100644 --- a/src/main/java/robaertschi/environmenttech/EnvironmentTech.java +++ b/src/main/java/robaertschi/environmenttech/EnvironmentTech.java @@ -1,7 +1,11 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech; -import com.mojang.logging.LogUtils; -import net.minecraft.resources.ResourceLocation; import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModContainer; @@ -10,6 +14,11 @@ import net.neoforged.fml.config.ModConfig; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.RegisterCommandsEvent; import org.slf4j.Logger; + +import net.minecraft.resources.ResourceLocation; + +import com.mojang.logging.LogUtils; + import robaertschi.environmenttech.command.EnvironmenttechCommand; import robaertschi.environmenttech.compat.ETCompat; import robaertschi.environmenttech.data.attachments.ETAttachments; diff --git a/src/main/java/robaertschi/environmenttech/client/ETClient.java b/src/main/java/robaertschi/environmenttech/client/ETClient.java index 9b2f53d..2f2b89a 100644 --- a/src/main/java/robaertschi/environmenttech/client/ETClient.java +++ b/src/main/java/robaertschi/environmenttech/client/ETClient.java @@ -1,10 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client; -import net.minecraft.client.renderer.item.ItemProperties; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.*; + +import net.minecraft.client.renderer.item.ItemProperties; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.client.particle.EnvParticleProvider; import robaertschi.environmenttech.client.screen.EnvCollectorScreen; diff --git a/src/main/java/robaertschi/environmenttech/client/particle/EnvParticleProvider.java b/src/main/java/robaertschi/environmenttech/client/particle/EnvParticleProvider.java index c8ead13..292d2f3 100644 --- a/src/main/java/robaertschi/environmenttech/client/particle/EnvParticleProvider.java +++ b/src/main/java/robaertschi/environmenttech/client/particle/EnvParticleProvider.java @@ -1,13 +1,22 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client.particle; import lombok.AllArgsConstructor; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleProvider; import net.minecraft.client.particle.SpriteSet; import net.minecraft.core.particles.SimpleParticleType; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; + import robaertschi.environmenttech.level.particle.EnvParticle; @AllArgsConstructor() diff --git a/src/main/java/robaertschi/environmenttech/client/renderer/ContentBoxRenderer.java b/src/main/java/robaertschi/environmenttech/client/renderer/ContentBoxRenderer.java index 199d6d1..a95e3f3 100644 --- a/src/main/java/robaertschi/environmenttech/client/renderer/ContentBoxRenderer.java +++ b/src/main/java/robaertschi/environmenttech/client/renderer/ContentBoxRenderer.java @@ -1,6 +1,13 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client.renderer; import lombok.AllArgsConstructor; + import net.minecraft.client.gui.GuiGraphics; import net.minecraft.util.FastColor; diff --git a/src/main/java/robaertschi/environmenttech/client/renderer/EnvStorageRenderer.java b/src/main/java/robaertschi/environmenttech/client/renderer/EnvStorageRenderer.java index d0f91c2..2a3aa91 100644 --- a/src/main/java/robaertschi/environmenttech/client/renderer/EnvStorageRenderer.java +++ b/src/main/java/robaertschi/environmenttech/client/renderer/EnvStorageRenderer.java @@ -1,15 +1,22 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client.renderer; +import java.util.List; +import java.util.Optional; + import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.util.FastColor; + import robaertschi.environmenttech.data.capabilities.IEnvStorage; import robaertschi.environmenttech.utils.MouseUtils; -import java.util.List; -import java.util.Optional; - /* * BluSunrize * Copyright (c) 2021 diff --git a/src/main/java/robaertschi/environmenttech/client/screen/EnvCollectorScreen.java b/src/main/java/robaertschi/environmenttech/client/screen/EnvCollectorScreen.java index 9f28d8d..f1072d6 100644 --- a/src/main/java/robaertschi/environmenttech/client/screen/EnvCollectorScreen.java +++ b/src/main/java/robaertschi/environmenttech/client/screen/EnvCollectorScreen.java @@ -1,11 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client.screen; +import org.jetbrains.annotations.NotNull; + import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.client.renderer.EnvStorageRenderer; import robaertschi.environmenttech.menu.EnvCollectorMenu; diff --git a/src/main/java/robaertschi/environmenttech/client/screen/ProgressArrowUtils.java b/src/main/java/robaertschi/environmenttech/client/screen/ProgressArrowUtils.java index 870d987..55511d8 100644 --- a/src/main/java/robaertschi/environmenttech/client/screen/ProgressArrowUtils.java +++ b/src/main/java/robaertschi/environmenttech/client/screen/ProgressArrowUtils.java @@ -1,6 +1,13 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.client.screen; import net.minecraft.resources.ResourceLocation; + import robaertschi.environmenttech.EnvironmentTech; public class ProgressArrowUtils { diff --git a/src/main/java/robaertschi/environmenttech/command/EnvironmenttechCommand.java b/src/main/java/robaertschi/environmenttech/command/EnvironmenttechCommand.java index 65c6a8a..8eb0b01 100644 --- a/src/main/java/robaertschi/environmenttech/command/EnvironmenttechCommand.java +++ b/src/main/java/robaertschi/environmenttech/command/EnvironmenttechCommand.java @@ -1,12 +1,20 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.command; -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.LongArgumentType; import net.minecraft.commands.CommandSourceStack; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.ChunkAccess; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.LongArgumentType; + import robaertschi.environmenttech.data.attachments.ETAttachments; import static net.minecraft.commands.Commands.*; diff --git a/src/main/java/robaertschi/environmenttech/compat/ETCompat.java b/src/main/java/robaertschi/environmenttech/compat/ETCompat.java index 7533dfd..43e8d61 100644 --- a/src/main/java/robaertschi/environmenttech/compat/ETCompat.java +++ b/src/main/java/robaertschi/environmenttech/compat/ETCompat.java @@ -1,7 +1,14 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.compat; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModList; + import robaertschi.environmenttech.compat.top.TopCompat; public class ETCompat { diff --git a/src/main/java/robaertschi/environmenttech/compat/jei/EnvCollectorRecipeCategory.java b/src/main/java/robaertschi/environmenttech/compat/jei/EnvCollectorRecipeCategory.java index 74a734b..4466f2b 100644 --- a/src/main/java/robaertschi/environmenttech/compat/jei/EnvCollectorRecipeCategory.java +++ b/src/main/java/robaertschi/environmenttech/compat/jei/EnvCollectorRecipeCategory.java @@ -1,5 +1,15 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.compat.jei; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.ParametersAreNonnullByDefault; + import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; import mezz.jei.api.gui.drawable.IDrawable; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; @@ -8,12 +18,14 @@ import mezz.jei.api.recipe.IFocusGroup; import mezz.jei.api.recipe.RecipeIngredientRole; import mezz.jei.api.recipe.RecipeType; import mezz.jei.api.recipe.category.IRecipeCategory; + import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeHolder; + import robaertschi.environmenttech.client.renderer.EnvStorageRenderer; import robaertschi.environmenttech.client.screen.EnvCollectorScreen; import robaertschi.environmenttech.data.recipes.ETRecipes; @@ -21,10 +33,6 @@ import robaertschi.environmenttech.data.recipes.EnvCollectorRecipe; import robaertschi.environmenttech.level.block.ETBlocks; import robaertschi.environmenttech.utils.MouseUtils; -import javax.annotation.ParametersAreNonnullByDefault; -import java.util.ArrayList; -import java.util.List; - @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault public class EnvCollectorRecipeCategory implements IRecipeCategory> { diff --git a/src/main/java/robaertschi/environmenttech/compat/jei/JeiCompatPlugin.java b/src/main/java/robaertschi/environmenttech/compat/jei/JeiCompatPlugin.java index 856d1ab..e91575b 100644 --- a/src/main/java/robaertschi/environmenttech/compat/jei/JeiCompatPlugin.java +++ b/src/main/java/robaertschi/environmenttech/compat/jei/JeiCompatPlugin.java @@ -1,17 +1,27 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.compat.jei; +import javax.annotation.ParametersAreNonnullByDefault; + import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; import mezz.jei.api.registration.IRecipeCatalystRegistration; import mezz.jei.api.registration.IRecipeCategoryRegistration; import mezz.jei.api.registration.IRecipeRegistration; import mezz.jei.api.registration.IRecipeTransferRegistration; +import org.jetbrains.annotations.NotNull; + import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.data.recipes.ETRecipes; import robaertschi.environmenttech.level.block.ETBlocks; @@ -19,8 +29,6 @@ import robaertschi.environmenttech.level.block.entity.EnvCollectorBlockEntity; import robaertschi.environmenttech.menu.ETMenus; import robaertschi.environmenttech.menu.EnvCollectorMenu; -import javax.annotation.ParametersAreNonnullByDefault; - @JeiPlugin @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault diff --git a/src/main/java/robaertschi/environmenttech/compat/top/TOPInfoProvider.java b/src/main/java/robaertschi/environmenttech/compat/top/TOPInfoProvider.java index 697bfa6..a02c9dd 100644 --- a/src/main/java/robaertschi/environmenttech/compat/top/TOPInfoProvider.java +++ b/src/main/java/robaertschi/environmenttech/compat/top/TOPInfoProvider.java @@ -1,8 +1,15 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.compat.top; import mcjty.theoneprobe.api.IProbeHitData; import mcjty.theoneprobe.api.IProbeInfo; import mcjty.theoneprobe.api.ProbeMode; + import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; diff --git a/src/main/java/robaertschi/environmenttech/compat/top/TopCompat.java b/src/main/java/robaertschi/environmenttech/compat/top/TopCompat.java index 2557222..2132b4a 100644 --- a/src/main/java/robaertschi/environmenttech/compat/top/TopCompat.java +++ b/src/main/java/robaertschi/environmenttech/compat/top/TopCompat.java @@ -1,23 +1,31 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.compat.top; +import java.util.function.Function; + import mcjty.theoneprobe.api.*; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.InterModComms; +import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; +import net.neoforged.neoforge.capabilities.BlockCapabilityCache; + import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.fml.InterModComms; -import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; -import net.neoforged.neoforge.capabilities.BlockCapabilityCache; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.client.renderer.EnvStorageRenderer; import robaertschi.environmenttech.data.capabilities.ETCapabilities; import robaertschi.environmenttech.data.capabilities.EnvType; import robaertschi.environmenttech.data.capabilities.IEnvStorage; -import java.util.function.Function; - public class TopCompat { public static void init(IEventBus modEventBus) { modEventBus.addListener(TopCompat::sendIMC); diff --git a/src/main/java/robaertschi/environmenttech/data/attachments/ETAttachments.java b/src/main/java/robaertschi/environmenttech/data/attachments/ETAttachments.java index 7c58204..6c7a3b1 100644 --- a/src/main/java/robaertschi/environmenttech/data/attachments/ETAttachments.java +++ b/src/main/java/robaertschi/environmenttech/data/attachments/ETAttachments.java @@ -1,13 +1,21 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.attachments; -import com.mojang.serialization.Codec; +import java.util.function.Supplier; + import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.attachment.AttachmentType; import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.NeoForgeRegistries; -import robaertschi.environmenttech.EnvironmentTech; -import java.util.function.Supplier; +import com.mojang.serialization.Codec; + +import robaertschi.environmenttech.EnvironmentTech; public class ETAttachments { private static final DeferredRegister> ATTACHMENT_TYPES = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, EnvironmentTech.MODID); diff --git a/src/main/java/robaertschi/environmenttech/data/capabilities/AdaptedItemHandler.java b/src/main/java/robaertschi/environmenttech/data/capabilities/AdaptedItemHandler.java index 94ce287..266be44 100644 --- a/src/main/java/robaertschi/environmenttech/data/capabilities/AdaptedItemHandler.java +++ b/src/main/java/robaertschi/environmenttech/data/capabilities/AdaptedItemHandler.java @@ -1,10 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.capabilities; import lombok.AllArgsConstructor; -import net.minecraft.world.item.ItemStack; + import net.neoforged.neoforge.items.IItemHandlerModifiable; import org.jetbrains.annotations.NotNull; +import net.minecraft.world.item.ItemStack; + @AllArgsConstructor public class AdaptedItemHandler implements IItemHandlerModifiable { private final IItemHandlerModifiable handler; diff --git a/src/main/java/robaertschi/environmenttech/data/capabilities/ETCapabilities.java b/src/main/java/robaertschi/environmenttech/data/capabilities/ETCapabilities.java index e9702be..333fcce 100644 --- a/src/main/java/robaertschi/environmenttech/data/capabilities/ETCapabilities.java +++ b/src/main/java/robaertschi/environmenttech/data/capabilities/ETCapabilities.java @@ -1,10 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.capabilities; -import net.minecraft.core.Direction; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.capabilities.BlockCapability; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; + +import net.minecraft.core.Direction; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.level.block.entity.ETBlockEntities; diff --git a/src/main/java/robaertschi/environmenttech/data/capabilities/EnvStorage.java b/src/main/java/robaertschi/environmenttech/data/capabilities/EnvStorage.java index 7e02b0e..5a13b58 100644 --- a/src/main/java/robaertschi/environmenttech/data/capabilities/EnvStorage.java +++ b/src/main/java/robaertschi/environmenttech/data/capabilities/EnvStorage.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.capabilities; import net.minecraft.util.Mth; diff --git a/src/main/java/robaertschi/environmenttech/data/capabilities/EnvType.java b/src/main/java/robaertschi/environmenttech/data/capabilities/EnvType.java index 632c33a..b1a998b 100644 --- a/src/main/java/robaertschi/environmenttech/data/capabilities/EnvType.java +++ b/src/main/java/robaertschi/environmenttech/data/capabilities/EnvType.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.capabilities; public enum EnvType { diff --git a/src/main/java/robaertschi/environmenttech/data/capabilities/IEnvStorage.java b/src/main/java/robaertschi/environmenttech/data/capabilities/IEnvStorage.java index f4f7542..88e3c5e 100644 --- a/src/main/java/robaertschi/environmenttech/data/capabilities/IEnvStorage.java +++ b/src/main/java/robaertschi/environmenttech/data/capabilities/IEnvStorage.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.capabilities; /** diff --git a/src/main/java/robaertschi/environmenttech/data/components/ETComponents.java b/src/main/java/robaertschi/environmenttech/data/components/ETComponents.java index 2780ac3..7ff2332 100644 --- a/src/main/java/robaertschi/environmenttech/data/components/ETComponents.java +++ b/src/main/java/robaertschi/environmenttech/data/components/ETComponents.java @@ -1,9 +1,17 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.components; -import net.minecraft.core.component.DataComponentType; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; + +import net.minecraft.core.component.DataComponentType; + import robaertschi.environmenttech.EnvironmentTech; public class ETComponents { diff --git a/src/main/java/robaertschi/environmenttech/data/components/FilledComponent.java b/src/main/java/robaertschi/environmenttech/data/components/FilledComponent.java index a6e3f8d..8d46a51 100644 --- a/src/main/java/robaertschi/environmenttech/data/components/FilledComponent.java +++ b/src/main/java/robaertschi/environmenttech/data/components/FilledComponent.java @@ -1,10 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.components; +import io.netty.buffer.ByteBuf; + +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; + import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import io.netty.buffer.ByteBuf; -import net.minecraft.network.codec.ByteBufCodecs; -import net.minecraft.network.codec.StreamCodec; public record FilledComponent(int filled) { public static final Codec CODEC = RecordCodecBuilder.create(filledComponentInstance -> diff --git a/src/main/java/robaertschi/environmenttech/data/recipes/ETRecipes.java b/src/main/java/robaertschi/environmenttech/data/recipes/ETRecipes.java index 1779f03..b75973b 100644 --- a/src/main/java/robaertschi/environmenttech/data/recipes/ETRecipes.java +++ b/src/main/java/robaertschi/environmenttech/data/recipes/ETRecipes.java @@ -1,11 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.recipes; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; + import net.minecraft.core.registries.Registries; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredRegister; import static robaertschi.environmenttech.EnvironmentTech.MODID; diff --git a/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipe.java b/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipe.java index 34fa7e7..2d69f82 100644 --- a/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipe.java +++ b/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipe.java @@ -1,6 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.recipes; import lombok.RequiredArgsConstructor; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import net.minecraft.advancements.Advancement; import net.minecraft.advancements.AdvancementRequirements; import net.minecraft.advancements.AdvancementRewards; @@ -10,16 +23,10 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.recipes.RecipeBuilder; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.Container; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.*; import net.minecraft.world.level.Level; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.LinkedHashMap; -import java.util.Map; public record EnvCollectorRecipe(Ingredient input, ItemStack output, int envUsed) implements Recipe { @Override diff --git a/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipeSerializer.java b/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipeSerializer.java index 3a77c5d..ae24dd6 100644 --- a/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipeSerializer.java +++ b/src/main/java/robaertschi/environmenttech/data/recipes/EnvCollectorRecipeSerializer.java @@ -1,14 +1,22 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.data.recipes; -import com.mojang.serialization.Codec; -import com.mojang.serialization.MapCodec; -import com.mojang.serialization.codecs.RecordCodecBuilder; +import org.jetbrains.annotations.NotNull; + import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; -import org.jetbrains.annotations.NotNull; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; public class EnvCollectorRecipeSerializer implements RecipeSerializer { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec( diff --git a/src/main/java/robaertschi/environmenttech/datagen/ETBlockStateProvider.java b/src/main/java/robaertschi/environmenttech/datagen/ETBlockStateProvider.java index dae8e0e..aa147c8 100644 --- a/src/main/java/robaertschi/environmenttech/datagen/ETBlockStateProvider.java +++ b/src/main/java/robaertschi/environmenttech/datagen/ETBlockStateProvider.java @@ -1,9 +1,17 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.datagen; -import net.minecraft.data.PackOutput; import net.neoforged.neoforge.client.model.generators.BlockStateProvider; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.data.ExistingFileHelper; + +import net.minecraft.data.PackOutput; + import robaertschi.environmenttech.level.block.ETBlocks; import static robaertschi.environmenttech.EnvironmentTech.MODID; diff --git a/src/main/java/robaertschi/environmenttech/datagen/ETDatagen.java b/src/main/java/robaertschi/environmenttech/datagen/ETDatagen.java index de9ef6d..5ae080a 100644 --- a/src/main/java/robaertschi/environmenttech/datagen/ETDatagen.java +++ b/src/main/java/robaertschi/environmenttech/datagen/ETDatagen.java @@ -1,14 +1,21 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.datagen; -import net.minecraft.core.HolderLookup; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.PackOutput; +import java.util.concurrent.CompletableFuture; + import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; -import java.util.concurrent.CompletableFuture; +import net.minecraft.core.HolderLookup; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import static robaertschi.environmenttech.EnvironmentTech.MODID; diff --git a/src/main/java/robaertschi/environmenttech/datagen/ETItemModelProvider.java b/src/main/java/robaertschi/environmenttech/datagen/ETItemModelProvider.java index 2a0bf9f..9a957b4 100644 --- a/src/main/java/robaertschi/environmenttech/datagen/ETItemModelProvider.java +++ b/src/main/java/robaertschi/environmenttech/datagen/ETItemModelProvider.java @@ -1,11 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.datagen; -import net.minecraft.data.PackOutput; -import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.client.model.generators.ItemModelBuilder; import net.neoforged.neoforge.client.model.generators.ItemModelProvider; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.data.ExistingFileHelper; + +import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.level.block.ETBlocks; import robaertschi.environmenttech.level.item.ETItems; diff --git a/src/main/java/robaertschi/environmenttech/datagen/ETRecipeProvider.java b/src/main/java/robaertschi/environmenttech/datagen/ETRecipeProvider.java index 9ceb173..4d0b07e 100644 --- a/src/main/java/robaertschi/environmenttech/datagen/ETRecipeProvider.java +++ b/src/main/java/robaertschi/environmenttech/datagen/ETRecipeProvider.java @@ -1,5 +1,16 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.datagen; +import java.util.concurrent.CompletableFuture; + +import net.neoforged.neoforge.common.Tags; +import org.jetbrains.annotations.NotNull; + import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.core.HolderLookup; @@ -11,14 +22,11 @@ import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import net.neoforged.neoforge.common.Tags; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.data.recipes.EnvCollectorRecipe; import robaertschi.environmenttech.level.item.ETItems; -import java.util.concurrent.CompletableFuture; - public class ETRecipeProvider extends RecipeProvider { public ETRecipeProvider(PackOutput pOutput, CompletableFuture pRegistries) { super(pOutput, pRegistries); diff --git a/src/main/java/robaertschi/environmenttech/level/ETChunkEvents.java b/src/main/java/robaertschi/environmenttech/level/ETChunkEvents.java index d4b7fd2..47d4445 100644 --- a/src/main/java/robaertschi/environmenttech/level/ETChunkEvents.java +++ b/src/main/java/robaertschi/environmenttech/level/ETChunkEvents.java @@ -1,11 +1,20 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level; import lombok.extern.slf4j.Slf4j; -import net.minecraft.world.level.chunk.LevelChunk; -import net.minecraft.world.level.chunk.status.ChunkStatus; + import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.level.ChunkEvent; + +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.level.chunk.status.ChunkStatus; + import robaertschi.environmenttech.Config; import robaertschi.environmenttech.EnvironmentTech; import robaertschi.environmenttech.data.attachments.ETAttachments; diff --git a/src/main/java/robaertschi/environmenttech/level/block/ETBlocks.java b/src/main/java/robaertschi/environmenttech/level/block/ETBlocks.java index 0244414..2497dfb 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/ETBlocks.java +++ b/src/main/java/robaertschi/environmenttech/level/block/ETBlocks.java @@ -1,10 +1,17 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block; -import net.minecraft.world.level.block.state.BlockBehaviour; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.world.level.block.state.BlockBehaviour; + import static robaertschi.environmenttech.EnvironmentTech.MODID; public class ETBlocks { diff --git a/src/main/java/robaertschi/environmenttech/level/block/EnvCollectorBlock.java b/src/main/java/robaertschi/environmenttech/level/block/EnvCollectorBlock.java index 0b0e95b..30f9f6c 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/EnvCollectorBlock.java +++ b/src/main/java/robaertschi/environmenttech/level/block/EnvCollectorBlock.java @@ -1,7 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block; -import com.mojang.serialization.MapCodec; import lombok.extern.slf4j.Slf4j; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -19,13 +30,12 @@ import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; + +import com.mojang.serialization.MapCodec; + import robaertschi.environmenttech.level.block.entity.ETBlockEntities; import robaertschi.environmenttech.level.block.entity.EnvCollectorBlockEntity; -import javax.annotation.ParametersAreNonnullByDefault; - @ParametersAreNonnullByDefault() @Slf4j public class EnvCollectorBlock extends SimpleBlockWithEntity { diff --git a/src/main/java/robaertschi/environmenttech/level/block/EnvDistributorBlock.java b/src/main/java/robaertschi/environmenttech/level/block/EnvDistributorBlock.java index 8fdbb87..7103fcd 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/EnvDistributorBlock.java +++ b/src/main/java/robaertschi/environmenttech/level/block/EnvDistributorBlock.java @@ -1,18 +1,28 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block; -import com.mojang.serialization.MapCodec; import lombok.extern.slf4j.Slf4j; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.jetbrains.annotations.Nullable; + import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.Nullable; + +import com.mojang.serialization.MapCodec; + import robaertschi.environmenttech.level.block.entity.ETBlockEntities; import robaertschi.environmenttech.level.block.entity.EnvDistributorBlockEntity; -import javax.annotation.ParametersAreNonnullByDefault; - @Slf4j @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault diff --git a/src/main/java/robaertschi/environmenttech/level/block/SimpleBlockWithEntity.java b/src/main/java/robaertschi/environmenttech/level/block/SimpleBlockWithEntity.java index 4697447..40fb9a6 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/SimpleBlockWithEntity.java +++ b/src/main/java/robaertschi/environmenttech/level/block/SimpleBlockWithEntity.java @@ -1,5 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block; +import javax.annotation.ParametersAreNonnullByDefault; + +import net.neoforged.neoforge.registries.DeferredHolder; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; @@ -14,14 +28,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DirectionProperty; -import net.neoforged.neoforge.registries.DeferredHolder; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import robaertschi.environmenttech.level.block.entity.ITickableBlockEntity; -import javax.annotation.ParametersAreNonnullByDefault; +import robaertschi.environmenttech.level.block.entity.ITickableBlockEntity; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault diff --git a/src/main/java/robaertschi/environmenttech/level/block/entity/ETBlockEntities.java b/src/main/java/robaertschi/environmenttech/level/block/entity/ETBlockEntities.java index 35cd784..0fa6b08 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/entity/ETBlockEntities.java +++ b/src/main/java/robaertschi/environmenttech/level/block/entity/ETBlockEntities.java @@ -1,15 +1,23 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block.entity; -import net.minecraft.core.registries.Registries; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; + +import net.minecraft.core.registries.Registries; +import net.minecraft.world.level.block.entity.BlockEntityType; + import robaertschi.environmenttech.level.block.ETBlocks; -import robaertschi.environmenttech.level.block.EnvDistributorBlock; import static robaertschi.environmenttech.EnvironmentTech.MODID; +@SuppressWarnings("DataFlowIssue") public class ETBlockEntities { public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(Registries.BLOCK_ENTITY_TYPE, MODID); diff --git a/src/main/java/robaertschi/environmenttech/level/block/entity/EnvCollectorBlockEntity.java b/src/main/java/robaertschi/environmenttech/level/block/entity/EnvCollectorBlockEntity.java index 60c5eb8..95a7254 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/entity/EnvCollectorBlockEntity.java +++ b/src/main/java/robaertschi/environmenttech/level/block/entity/EnvCollectorBlockEntity.java @@ -1,9 +1,24 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block.entity; import lombok.Getter; + import mcjty.theoneprobe.api.IProbeHitData; import mcjty.theoneprobe.api.IProbeInfo; import mcjty.theoneprobe.api.ProbeMode; +import net.neoforged.jarjar.nio.util.Lazy; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandlerModifiable; +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.wrapper.CombinedInvWrapper; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; @@ -24,13 +39,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkAccess; -import net.neoforged.jarjar.nio.util.Lazy; -import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.IItemHandlerModifiable; -import net.neoforged.neoforge.items.ItemStackHandler; -import net.neoforged.neoforge.items.wrapper.CombinedInvWrapper; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; + import robaertschi.environmenttech.compat.top.TOPInfoProvider; import robaertschi.environmenttech.data.attachments.ETAttachments; import robaertschi.environmenttech.data.capabilities.AdaptedItemHandler; diff --git a/src/main/java/robaertschi/environmenttech/level/block/entity/EnvDistributorBlockEntity.java b/src/main/java/robaertschi/environmenttech/level/block/entity/EnvDistributorBlockEntity.java index e229f08..b0a8c8a 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/entity/EnvDistributorBlockEntity.java +++ b/src/main/java/robaertschi/environmenttech/level/block/entity/EnvDistributorBlockEntity.java @@ -1,6 +1,17 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block.entity; import lombok.Getter; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.jetbrains.annotations.NotNull; + import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; @@ -8,13 +19,11 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkAccess; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.data.attachments.ETAttachments; import robaertschi.environmenttech.data.capabilities.EnvStorage; import robaertschi.environmenttech.data.capabilities.EnvType; -import javax.annotation.ParametersAreNonnullByDefault; - import static robaertschi.environmenttech.EnvironmentTech.MODID; @Getter diff --git a/src/main/java/robaertschi/environmenttech/level/block/entity/ITickableBlockEntity.java b/src/main/java/robaertschi/environmenttech/level/block/entity/ITickableBlockEntity.java index 09c1ad6..0cc0acf 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/entity/ITickableBlockEntity.java +++ b/src/main/java/robaertschi/environmenttech/level/block/entity/ITickableBlockEntity.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block.entity; import net.minecraft.core.BlockPos; diff --git a/src/main/java/robaertschi/environmenttech/level/block/entity/renderer/EnvCollectorRenderer.java b/src/main/java/robaertschi/environmenttech/level/block/entity/renderer/EnvCollectorRenderer.java index 40ded90..596b957 100644 --- a/src/main/java/robaertschi/environmenttech/level/block/entity/renderer/EnvCollectorRenderer.java +++ b/src/main/java/robaertschi/environmenttech/level/block/entity/renderer/EnvCollectorRenderer.java @@ -1,7 +1,14 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.block.entity.renderer; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.math.Axis; +import java.util.Objects; +import javax.annotation.ParametersAreNonnullByDefault; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.MultiBufferSource; @@ -16,13 +23,14 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.LightLayer; import net.minecraft.world.phys.Vec3; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Axis; + import robaertschi.environmenttech.level.block.EnvCollectorBlock; import robaertschi.environmenttech.level.block.entity.EnvCollectorBlockEntity; import robaertschi.environmenttech.level.particle.ETParticles; -import javax.annotation.ParametersAreNonnullByDefault; -import java.util.Objects; - @ParametersAreNonnullByDefault public class EnvCollectorRenderer implements BlockEntityRenderer { @SuppressWarnings("unused") diff --git a/src/main/java/robaertschi/environmenttech/level/item/ETItems.java b/src/main/java/robaertschi/environmenttech/level/item/ETItems.java index 8ef4e5a..805433e 100644 --- a/src/main/java/robaertschi/environmenttech/level/item/ETItems.java +++ b/src/main/java/robaertschi/environmenttech/level/item/ETItems.java @@ -1,5 +1,16 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.item; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredItem; +import net.neoforged.neoforge.registries.DeferredRegister; + import net.minecraft.core.component.DataComponents; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; @@ -8,10 +19,7 @@ import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.Item; import net.minecraft.world.item.component.CustomModelData; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredItem; -import net.neoforged.neoforge.registries.DeferredRegister; + import robaertschi.environmenttech.level.block.ETBlocks; import static robaertschi.environmenttech.EnvironmentTech.MODID; diff --git a/src/main/java/robaertschi/environmenttech/level/item/EnvDetectorItem.java b/src/main/java/robaertschi/environmenttech/level/item/EnvDetectorItem.java index a138522..10fa726 100644 --- a/src/main/java/robaertschi/environmenttech/level/item/EnvDetectorItem.java +++ b/src/main/java/robaertschi/environmenttech/level/item/EnvDetectorItem.java @@ -1,5 +1,16 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.item; +import java.util.List; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.jetbrains.annotations.NotNull; + import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerLevel; @@ -11,14 +22,11 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.data.attachments.ETAttachments; import robaertschi.environmenttech.data.components.ETComponents; import robaertschi.environmenttech.data.components.FilledComponent; -import javax.annotation.ParametersAreNonnullByDefault; -import java.util.List; - @ParametersAreNonnullByDefault public class EnvDetectorItem extends Item { public static final int STEPS = 9; diff --git a/src/main/java/robaertschi/environmenttech/level/particle/ETParticles.java b/src/main/java/robaertschi/environmenttech/level/particle/ETParticles.java index f79fd37..9f59352 100644 --- a/src/main/java/robaertschi/environmenttech/level/particle/ETParticles.java +++ b/src/main/java/robaertschi/environmenttech/level/particle/ETParticles.java @@ -1,11 +1,18 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.particle; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; + import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.core.registries.BuiltInRegistries; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredRegister; import static robaertschi.environmenttech.EnvironmentTech.MODID; diff --git a/src/main/java/robaertschi/environmenttech/level/particle/EnvParticle.java b/src/main/java/robaertschi/environmenttech/level/particle/EnvParticle.java index 4fcd3ba..bd74dac 100644 --- a/src/main/java/robaertschi/environmenttech/level/particle/EnvParticle.java +++ b/src/main/java/robaertschi/environmenttech/level/particle/EnvParticle.java @@ -1,12 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.level.particle; +import org.jetbrains.annotations.NotNull; + import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.particle.ParticleRenderType; import net.minecraft.client.particle.SpriteSet; import net.minecraft.client.particle.TextureSheetParticle; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleType; -import org.jetbrains.annotations.NotNull; public class EnvParticle extends TextureSheetParticle implements ParticleOptions { private final SpriteSet spriteSet; diff --git a/src/main/java/robaertschi/environmenttech/menu/ETMenus.java b/src/main/java/robaertschi/environmenttech/menu/ETMenus.java index 2cb5a5b..873dc4f 100644 --- a/src/main/java/robaertschi/environmenttech/menu/ETMenus.java +++ b/src/main/java/robaertschi/environmenttech/menu/ETMenus.java @@ -1,12 +1,19 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.menu; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.world.inventory.MenuType; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.inventory.MenuType; + import static robaertschi.environmenttech.EnvironmentTech.MODID; public class ETMenus { diff --git a/src/main/java/robaertschi/environmenttech/menu/EnvCollectorMenu.java b/src/main/java/robaertschi/environmenttech/menu/EnvCollectorMenu.java index 8be1a78..0a2d77e 100644 --- a/src/main/java/robaertschi/environmenttech/menu/EnvCollectorMenu.java +++ b/src/main/java/robaertschi/environmenttech/menu/EnvCollectorMenu.java @@ -1,14 +1,23 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.menu; import lombok.Getter; + +import net.neoforged.neoforge.items.SlotItemHandler; +import org.jetbrains.annotations.NotNull; + import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.Container; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.*; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.items.SlotItemHandler; -import org.jetbrains.annotations.NotNull; + import robaertschi.environmenttech.level.block.ETBlocks; import robaertschi.environmenttech.level.block.entity.EnvCollectorBlockEntity; diff --git a/src/main/java/robaertschi/environmenttech/utils/MouseUtils.java b/src/main/java/robaertschi/environmenttech/utils/MouseUtils.java index 7b9dac4..2d860ab 100644 --- a/src/main/java/robaertschi/environmenttech/utils/MouseUtils.java +++ b/src/main/java/robaertschi/environmenttech/utils/MouseUtils.java @@ -1,3 +1,9 @@ +/* + * EnvironmentTech Copyright (C) 2024 Robin Bärtschi + * This program comes with ABSOLUTELY NO WARRANTY; for details open the file LICENSE at the root of the source code. + * This is free software, and you are welcome to redistribute it + * under certain conditions; read the LICENSE file at the root of the source code for details. + */ package robaertschi.environmenttech.utils; public class MouseUtils {