From be2ea227718b19b00a0be0e59ec54bb87ffd5ea2 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:07:44 +0100 Subject: [PATCH 01/12] Shutdown fast --- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 1 - .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 1 - .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- 11 files changed, 9 insertions(+), 11 deletions(-) diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 5e22dfed..32871cc3 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,7 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stopServer(); System.exit(0); } } diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 5e22dfed..32871cc3 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,7 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stopServer(); System.exit(0); } } diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 24804499..14e91745 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 24804499..14e91745 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 97356444..550ffd4f 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index f83555bb..bd5efe0f 100644 --- a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..781404fb 100644 --- a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..781404fb 100644 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..781404fb 100644 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..781404fb 100644 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..781404fb 100644 --- a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + System.exit(0); } } From 6edfd626645d6249b676b36a11bfdc9e31cb9212 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:11:59 +0100 Subject: [PATCH 02/12] Change to order of releases --- .github/workflows/build.yml | 4 ++-- settings.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad1ea4b4..9901111c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: branches: - main pull_request: - branches: + branches: - main jobs: @@ -13,7 +13,7 @@ jobs: strategy: matrix: - version: ["1.7", "1.8.9", "1.9.4", "1.10.2", "1.11.2", "1.12.2", "1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "1.19", "1.19.2", "22w19a", "1.20"] + version: ["1.7", "1.8.9", "1.9.4", "1.10.2", "1.11.2", "1.12.2", "1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "22w19a", "1.19", "1.19.2", "1.20"] name: Build ${{ matrix.version }} diff --git a/settings.gradle b/settings.gradle index 8551948a..9609f9ba 100644 --- a/settings.gradle +++ b/settings.gradle @@ -42,8 +42,8 @@ dependencyResolutionManagement { "1.16", "1.17", "1.18", + "22w19a", "1.19", "1.19.2", - "22w19a", "1.20", ].forEach { include it } From de63177a8fd4b65795b49527890dfa0dd88c1f44 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:24:13 +0100 Subject: [PATCH 03/12] Revert "Shutdown fast" This reverts commit be2ea227718b19b00a0be0e59ec54bb87ffd5ea2. --- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 1 + .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 1 + .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- 11 files changed, 11 insertions(+), 9 deletions(-) diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..5e22dfed 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,7 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); + DGU.getCurrentlyRunningServer().stopServer(); System.exit(0); } } diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..5e22dfed 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,7 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); + DGU.getCurrentlyRunningServer().stopServer(); System.exit(0); } } diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 14e91745..24804499 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 14e91745..24804499 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 550ffd4f..97356444 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -23,6 +23,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index bd5efe0f..f83555bb 100644 --- a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 781404fb..6d9415eb 100644 --- a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 781404fb..6d9415eb 100644 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 781404fb..6d9415eb 100644 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 781404fb..6d9415eb 100644 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 781404fb..6d9415eb 100644 --- a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - System.exit(0); + DGU.getCurrentlyRunningServer().stop(false); } } From 44117795360c9d67fab15566e2fc6436bfe9ac6f Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:27:02 +0100 Subject: [PATCH 04/12] Remove all shutdown hook, we do not care about generator worlds --- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 3 ++- .../minecraftdatagenerator/mixin/StopMixin.java | 15 +++++++++++++++ .../minecraft-data-generator.mixins.json | 1 + 32 files changed, 266 insertions(+), 10 deletions(-) create mode 100644 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java create mode 100644 22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.10.2/src/main/resources/minecraft-data-generator.mixins.json b/1.10.2/src/main/resources/minecraft-data-generator.mixins.json index 4dd13158..743298f2 100644 --- a/1.10.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.10.2/src/main/resources/minecraft-data-generator.mixins.json @@ -15,7 +15,8 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.11.2/src/main/resources/minecraft-data-generator.mixins.json b/1.11.2/src/main/resources/minecraft-data-generator.mixins.json index fcdcd1a0..f67dcb78 100644 --- a/1.11.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.11.2/src/main/resources/minecraft-data-generator.mixins.json @@ -13,7 +13,8 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.12.2/src/main/resources/minecraft-data-generator.mixins.json b/1.12.2/src/main/resources/minecraft-data-generator.mixins.json index fcdcd1a0..f67dcb78 100644 --- a/1.12.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.12.2/src/main/resources/minecraft-data-generator.mixins.json @@ -13,7 +13,8 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.13/src/main/resources/minecraft-data-generator.mixins.json b/1.13/src/main/resources/minecraft-data-generator.mixins.json index ea255f59..f1c9fe0a 100644 --- a/1.13/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.13/src/main/resources/minecraft-data-generator.mixins.json @@ -6,7 +6,8 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.14/src/main/resources/minecraft-data-generator.mixins.json b/1.14/src/main/resources/minecraft-data-generator.mixins.json index ea255f59..f1c9fe0a 100644 --- a/1.14/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.14/src/main/resources/minecraft-data-generator.mixins.json @@ -6,7 +6,8 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.15/src/main/resources/minecraft-data-generator.mixins.json b/1.15/src/main/resources/minecraft-data-generator.mixins.json index ea255f59..f1c9fe0a 100644 --- a/1.15/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.15/src/main/resources/minecraft-data-generator.mixins.json @@ -6,7 +6,8 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.16/src/main/resources/minecraft-data-generator.mixins.json b/1.16/src/main/resources/minecraft-data-generator.mixins.json index 7154c902..16feca5b 100644 --- a/1.16/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.16/src/main/resources/minecraft-data-generator.mixins.json @@ -8,7 +8,8 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.17/src/main/resources/minecraft-data-generator.mixins.json b/1.17/src/main/resources/minecraft-data-generator.mixins.json index 0b916b11..4bc8f8d3 100644 --- a/1.17/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.17/src/main/resources/minecraft-data-generator.mixins.json @@ -6,7 +6,8 @@ "mixins": [ "ClientPlayerInteractionManagerMixin", "MiningToolItemAccessor", - "ReadyMixin" + "ReadyMixin", + "StopMixin" ], "client": [ ], diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.18/src/main/resources/minecraft-data-generator.mixins.json b/1.18/src/main/resources/minecraft-data-generator.mixins.json index 5d80b76e..a2a44b55 100644 --- a/1.18/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.18/src/main/resources/minecraft-data-generator.mixins.json @@ -7,7 +7,8 @@ "ClientPlayerInteractionManagerMixin", "EULAMixin", "MiningToolItemAccessor", - "ReadyMixin" + "ReadyMixin", + "StopMixin" ], "client": [ ], diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.19.2/src/main/resources/minecraft-data-generator.mixins.json b/1.19.2/src/main/resources/minecraft-data-generator.mixins.json index f3afe061..4b1310f7 100644 --- a/1.19.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.19.2/src/main/resources/minecraft-data-generator.mixins.json @@ -8,6 +8,7 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", + "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.19/src/main/resources/minecraft-data-generator.mixins.json b/1.19/src/main/resources/minecraft-data-generator.mixins.json index f3afe061..4b1310f7 100644 --- a/1.19/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.19/src/main/resources/minecraft-data-generator.mixins.json @@ -8,6 +8,7 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", + "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.20/src/main/resources/minecraft-data-generator.mixins.json b/1.20/src/main/resources/minecraft-data-generator.mixins.json index f3afe061..4b1310f7 100644 --- a/1.20/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.20/src/main/resources/minecraft-data-generator.mixins.json @@ -8,6 +8,7 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", + "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.7/src/main/resources/minecraft-data-generator.mixins.json b/1.7/src/main/resources/minecraft-data-generator.mixins.json index 804329be..f995162f 100644 --- a/1.7/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.7/src/main/resources/minecraft-data-generator.mixins.json @@ -6,6 +6,7 @@ "mixins": [ "BlocksMixin", "ReadyMixin", + "StopMixin", "VariantBlockItemAccessor", "accessor.BiomeAccessor", "accessor.BlockAccessor", diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.8.9/src/main/resources/minecraft-data-generator.mixins.json b/1.8.9/src/main/resources/minecraft-data-generator.mixins.json index 90389267..c92fb692 100644 --- a/1.8.9/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.8.9/src/main/resources/minecraft-data-generator.mixins.json @@ -13,6 +13,7 @@ "NoteBlockAccessor", "ReadyMixin", "StatusEffectAccessor", + "StopMixin", "overwrite.CocoaBlockOverwrite", "overwrite.EndPortalFrameBlockOverwrite", "overwrite.ItemEntityOverwrite", diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..f20088fd --- /dev/null +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/1.9.4/src/main/resources/minecraft-data-generator.mixins.json b/1.9.4/src/main/resources/minecraft-data-generator.mixins.json index 4dd13158..743298f2 100644 --- a/1.9.4/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.9.4/src/main/resources/minecraft-data-generator.mixins.json @@ -15,7 +15,8 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor" + "StatusEffectAccessor", + "StopMixin" ], "client": [ ], diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java new file mode 100644 index 00000000..742fb94c --- /dev/null +++ b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java @@ -0,0 +1,15 @@ +package dev.u9g.minecraftdatagenerator.mixin; + +import net.minecraft.server.MinecraftServer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftServer.class) +public class StopMixin { + @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) + private void init(CallbackInfo cir) { + cir.cancel(); + } +} diff --git a/22w19a/src/main/resources/minecraft-data-generator.mixins.json b/22w19a/src/main/resources/minecraft-data-generator.mixins.json index 9e8d4163..fed4d5c0 100644 --- a/22w19a/src/main/resources/minecraft-data-generator.mixins.json +++ b/22w19a/src/main/resources/minecraft-data-generator.mixins.json @@ -7,6 +7,7 @@ "ClientPlayerInteractionManagerMixin", "MiningToolItemAccessor", "ReadyMixin", + "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ From e68e5a61093ecb93183009ade296e21dbc80f799 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:36:53 +0100 Subject: [PATCH 05/12] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 18f71182..b76af4dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,28 @@ -1. Update gradle.properties with the latest values from https://fabricmc.net/develop/ -2. Run `./gradlew build` and fix any errors caused by API changes if any (see https://fabricmc.net/blog/) -3. Run `./gradlew runServer` -4. Check the results in `run/minecraft-data` \ No newline at end of file +# minecraft-data-generator-server + +This tool generates minecraft-data files based on a running server using a fabric mod. +The supported versions can be read in the directory structured. +Every version has its own directory. + +## Usage + +You can put any version that has a directory into the command below. +Just replace `` with the version you want to generate. + +```bash +./gradlew ::runServer +``` + +You can then find the minecraft-data in the `/run/minecraft-data` directory. + +## Adding a new version + +To add a new version, you need to create a new directory in the root directory with the version name. +Then you need to add the version to the list in the `settings.gradle.kts` file. +Then also add it to the `.github/workflows/build.yml` file. +Then copy the code of the most recently released version into the new directory. +Then you need to change the values in the `gradle.properties` file. +At last, you need to fix all code issues that are caused by the new version. +For that, use an IDE like IntelliJ IDEA to fix the issues. +Once everything compiles, you can commit the changes, push them to your fork and create a pull request. +Once your PR was accepted and merged, the new version will be available in the next release. From bc5ce3e1425725a74450b07fe8cc710db0d68b6b Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:37:58 +0100 Subject: [PATCH 06/12] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b76af4dd..19a1cd33 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # minecraft-data-generator-server This tool generates minecraft-data files based on a running server using a fabric mod. -The supported versions can be read in the directory structured. +The supported versions can be read in the directory structure. Every version has its own directory. ## Usage From 93455aba6876e8c470eafa66dc0ac02653f4905b Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:38:37 +0100 Subject: [PATCH 07/12] Add OS-specific commands --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 19a1cd33..a13bc785 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,16 @@ Every version has its own directory. You can put any version that has a directory into the command below. Just replace `` with the version you want to generate. +For Linux/Mac OS: ```bash ./gradlew ::runServer ``` +For Windows: +```bash +gradlew.bat ::runServer +``` + You can then find the minecraft-data in the `/run/minecraft-data` directory. ## Adding a new version From ec6e395f5d99cb071af4b0d23f20409c94597802 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:05:42 +0100 Subject: [PATCH 08/12] More code improvements --- .../BiomeColors.java | 8 ++--- .../clientsideannoyances}/BlockColorable.java | 2 +- .../BlockColors.java | 19 +++++----- .../clientsideannoyances}/FoliageColors.java | 6 ++-- .../GrassColors.java | 6 ++-- .../ServerSideRedstoneWireBlock.java | 2 +- .../BlockCollisionShapesDataGenerator.java | 33 +++++++---------- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 8 ++--- .../BiomeColors.java | 12 +++---- .../clientsideannoyances}/BlockColorable.java | 2 +- .../BlockColors.java | 19 +++++----- .../FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../SkyColor.java | 2 +- .../generators/BiomesDataGenerator.java | 2 +- .../BlockCollisionShapesDataGenerator.java | 33 +++++++---------- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 6 ++-- .../BiomeColors.java | 8 ++--- .../BlockColorable.java | 2 +- .../BlockColors.java | 7 ++-- .../clientsideannoyances}/FoliageColors.java | 2 +- .../clientsideannoyances}/GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../BlockCollisionShapesDataGenerator.java | 33 +++++++---------- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 8 ++--- .../BiomeColors.java | 2 +- .../BlockColorable.java | 2 +- .../BlockColors.java | 5 ++- .../clientsideannoyances}/FoliageColors.java | 2 +- .../clientsideannoyances}/GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../generators/BiomesDataGenerator.java | 3 +- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 8 ++--- .../clientsideannoyances}/FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../generators/TintsDataGenerator.java | 6 ++-- .../clientsideannoyances}/FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../generators/TintsDataGenerator.java | 6 ++-- .../clientsideannoyances}/FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../generators/EnchantmentsDataGenerator.java | 2 +- .../generators/TintsDataGenerator.java | 6 ++-- .../generators/EnchantmentsDataGenerator.java | 2 +- .../generators/EnchantmentsDataGenerator.java | 2 +- .../generators/EnchantmentsDataGenerator.java | 2 +- .../mojangannoyances/BlockColors.java | 18 +++++----- .../generators/EnchantmentsDataGenerator.java | 2 +- .../mojangannoyances/BlockColors.java | 18 +++++----- .../generators/EnchantmentsDataGenerator.java | 2 +- .../mojangannoyances/BlockColors.java | 18 +++++----- .../BiomeBlockColors.java | 2 +- .../FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../BlockCollisionShapesDataGenerator.java | 35 +++++++------------ .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 6 ++-- .../BiomeBlockColors.java | 4 +-- .../BiomeColors.java | 8 ++--- .../FoliageColors.java | 2 +- .../GrassColors.java | 2 +- .../ServerSideRedstoneWireBlock.java | 2 +- .../BlockCollisionShapesDataGenerator.java | 33 +++++++---------- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 8 ++--- .../mixin/overwrite/CocoaBlockOverwrite.java | 3 ++ .../SkeletonSkullBlockOverwrite.java | 5 +++ .../mixin/overwrite/StairBlockOverwrite.java | 3 ++ .../ServerSideRedstoneWireBlock.java | 28 --------------- .../BiomeColors.java | 8 ++--- .../clientsideannoyances}/BlockColorable.java | 2 +- .../BlockColors.java | 19 +++++----- .../clientsideannoyances}/FoliageColors.java | 6 ++-- .../GrassColors.java | 6 ++-- .../ServerSideRedstoneWireBlock.java | 28 +++++++++++++++ .../BlockCollisionShapesDataGenerator.java | 33 +++++++---------- .../generators/EntitiesDataGenerator.java | 3 +- .../generators/TintsDataGenerator.java | 8 ++--- .../generators/EnchantmentsDataGenerator.java | 2 +- 88 files changed, 288 insertions(+), 350 deletions(-) rename 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (75%) rename {1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/BlockColorable.java (84%) rename 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColors.java (84%) rename {1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (78%) rename 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (74%) rename {1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (74%) rename {1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/BlockColorable.java (84%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColors.java (85%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/FoliageColors.java (91%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (88%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/SkyColor.java (97%) rename 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (79%) rename 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColorable.java (83%) rename 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColors.java (95%) rename {1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (93%) rename {1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/GrassColors.java (92%) rename 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename 1.13/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (97%) rename 1.13/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColorable.java (83%) rename 1.13/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColors.java (96%) rename {1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (93%) rename {1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/GrassColors.java (92%) rename {1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename {1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (93%) rename 1.14/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (92%) rename {1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename {1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (93%) rename 1.15/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (92%) rename 1.15/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/ServerSideRedstoneWireBlock.java (94%) rename {1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (93%) rename 1.16/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (92%) rename 1.16/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/ServerSideRedstoneWireBlock.java (94%) rename 1.7/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeBlockColors.java (98%) rename 1.7/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/FoliageColors.java (93%) rename 1.7/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (92%) rename {1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) rename 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeBlockColors.java (96%) rename 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (75%) rename 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/FoliageColors.java (94%) rename 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (92%) rename 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/ServerSideRedstoneWireBlock.java (92%) delete mode 100644 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BiomeColors.java (75%) rename {1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/BlockColorable.java (84%) rename 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/BlockColors.java (84%) rename {1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances => 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances}/FoliageColors.java (78%) rename 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/{ClientSideAnnoyances => clientsideannoyances}/GrassColors.java (74%) create mode 100644 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 75% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index 257db1a9..f42641fb 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.util.math.BlockPos; @@ -7,8 +7,8 @@ import java.util.Iterator; public class BiomeColors { - private static final ColorProvider GRASS_COLOR = (biome, pos) -> biome.getGrassColor(pos); - private static final ColorProvider FOLIAGE_COLOR = (biome, pos) -> biome.getFoliageColor(pos); + private static final ColorProvider GRASS_COLOR = Biome::getGrassColor; + private static final ColorProvider FOLIAGE_COLOR = Biome::getFoliageColor; private static final ColorProvider WATER_COLOR = (biome, pos) -> biome.getWaterColor(); private static int getColor(EmptyBlockView view, BlockPos pos, ColorProvider provider) { @@ -17,7 +17,7 @@ private static int getColor(EmptyBlockView view, BlockPos pos, ColorProvider pro int k = 0; int l; - for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { + for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { BlockPos.Mutable mutable = (BlockPos.Mutable) iterator.next(); l = provider.getColorAtPos(view.getBiome(mutable), mutable); i += (l & 16711680) >> 16; diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java similarity index 84% rename from 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java index 3e3e044c..b6819227 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.BlockState; diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java similarity index 84% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java index 4df7551c..2bd090ca 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.*; @@ -19,7 +19,7 @@ public BlockColors() { public static BlockColors create() { final BlockColors blockColors = new BlockColors(); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - DoublePlantBlock.DoublePlantType doublePlantType = (DoublePlantBlock.DoublePlantType) blockState.get(DoublePlantBlock.VARIANT); + DoublePlantBlock.DoublePlantType doublePlantType = blockState.get(DoublePlantBlock.VARIANT); return blockView == null || blockPos == null || doublePlantType != DoublePlantBlock.DoublePlantType.GRASS && doublePlantType != DoublePlantBlock.DoublePlantType.FERN ? -1 : BiomeColors.getGrassColor(blockView, blockPos); }, Blocks.DOUBLE_PLANT); blockColors.method_12158((blockState, blockView, blockPos, i) -> { @@ -38,7 +38,7 @@ public static BlockColors create() { }, Blocks.FLOWER_POT); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : GrassColors.getColor(0.5D, 1.0D), Blocks.GRASS); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - PlanksBlock.WoodType woodType = (PlanksBlock.WoodType) blockState.get(Leaves1Block.VARIANT); + PlanksBlock.WoodType woodType = blockState.get(Leaves1Block.VARIANT); if (woodType == PlanksBlock.WoodType.SPRUCE) { return FoliageColors.getSpruceColor(); } else if (woodType == PlanksBlock.WoodType.BIRCH) { @@ -49,10 +49,10 @@ public static BlockColors create() { }, Blocks.LEAVES); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getFoliageColor(blockView, blockPos) : FoliageColors.getDefaultColor(), Blocks.LEAVES2); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getWaterColor(blockView, blockPos) : -1, Blocks.WATER, Blocks.FLOWING_WATER); - blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877((Integer) blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877(blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : -1, Blocks.SUGARCANE); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - int j = (Integer) blockState.get(AttachedStemBlock.AGE); + int j = blockState.get(AttachedStemBlock.AGE); int k = j * 32; int l = 255 - j * 8; int m = j * 4; @@ -71,9 +71,9 @@ public static BlockColors create() { } public int method_13410(BlockState blockState) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); if (blockColorable != null) { - return blockColorable.method_12155(blockState, (EmptyBlockView) null, (BlockPos) null, 0); + return blockColorable.method_12155(blockState, null, null, 0); } else { MaterialColor materialColor = blockState.getMaterialColor(); return materialColor != null ? materialColor.color : -1; @@ -81,15 +81,14 @@ public int method_13410(BlockState blockState) { } public int method_12157(BlockState blockState, @Nullable EmptyBlockView blockView, @Nullable BlockPos blockPos, int i) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); return blockColorable == null ? -1 : blockColorable.method_12155(blockState, blockView, blockPos, i); } public void method_12158(BlockColorable blockColorable, Block... blocks) { int i = blocks.length; - for (int j = 0; j < i; ++j) { - Block block = blocks[j]; + for (Block block : blocks) { this.BlockColor2Id.set(blockColorable, Block.getIdByBlock(block)); } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 78% rename from 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 8c32f48f..b63e543b 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; @@ -30,8 +30,8 @@ public static int getDefaultColor() { } public static int getFoliageColor(Biome biome) { - double d = (double) MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return FoliageColors.getColor(d, e); } } diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 74% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 88687071..afee2b70 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; @@ -19,8 +19,8 @@ public static int getColor(double temperature, double humidity) { } public static int getGrassColor(Biome biome) { - double d = (double) MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return GrassColors.getColor(d, e); } } diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index 1572a082..75c9f89c 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index b2789fd0..2bb5a0be 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -96,31 +96,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index 5828f9e9..3703b843 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -55,7 +55,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -65,7 +65,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index a4f970c9..8d1b2a84 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -3,10 +3,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 74% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index 9bee1854..eb56ce44 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.util.math.BlockPos; @@ -9,13 +9,13 @@ public class BiomeColors { private static final ColorProvider GRASS_COLOR = (biome, pos) -> { - double d = (double) MathHelper.clamp(biome.getTemperature(pos), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(pos), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return GrassColors.getColor(d, e); }; private static final ColorProvider FOLIAGE_COLOR = (biome, pos) -> { - double d = (double) MathHelper.clamp(biome.getTemperature(pos), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(pos), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return FoliageColors.getColor(d, e); }; private static final ColorProvider WATER_COLOR = (biome, pos) -> biome.getWaterColor(); @@ -26,7 +26,7 @@ private static int getColor(EmptyBlockView view, BlockPos pos, ColorProvider pro int k = 0; int l; - for (Iterator var6 = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); var6.hasNext(); k += l & 255) { + for (Iterator var6 = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); var6.hasNext(); k += l & 255) { BlockPos.Mutable mutable = (BlockPos.Mutable) var6.next(); l = provider.getColorAtPos(view.getBiome(mutable), mutable); i += (l & 16711680) >> 16; diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java similarity index 84% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java index 3e3e044c..b6819227 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.BlockState; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java similarity index 85% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java index 773f95fe..5053ac73 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.*; @@ -18,7 +18,7 @@ public BlockColors() { public static BlockColors create() { final BlockColors blockColors = new BlockColors(); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - DoublePlantBlock.DoublePlantType doublePlantType = (DoublePlantBlock.DoublePlantType) blockState.get(DoublePlantBlock.VARIANT); + DoublePlantBlock.DoublePlantType doublePlantType = blockState.get(DoublePlantBlock.VARIANT); return blockView != null && blockPos != null && (doublePlantType == DoublePlantBlock.DoublePlantType.GRASS || doublePlantType == DoublePlantBlock.DoublePlantType.FERN) ? BiomeColors.getGrassColor(blockView, blockState.get(DoublePlantBlock.HALF) == DoublePlantBlock.HalfType.UPPER ? blockPos.down() : blockPos) : -1; }, Blocks.DOUBLE_PLANT); blockColors.method_12158((blockState, blockView, blockPos, i) -> { @@ -37,7 +37,7 @@ public static BlockColors create() { }, Blocks.FLOWER_POT); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : GrassColors.getColor(0.5D, 1.0D), Blocks.GRASS); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - PlanksBlock.WoodType woodType = (PlanksBlock.WoodType) blockState.get(Leaves1Block.VARIANT); + PlanksBlock.WoodType woodType = blockState.get(Leaves1Block.VARIANT); if (woodType == PlanksBlock.WoodType.SPRUCE) { return net.minecraft.client.color.world.FoliageColors.getSpruceColor(); } else if (woodType == PlanksBlock.WoodType.BIRCH) { @@ -48,10 +48,10 @@ public static BlockColors create() { }, Blocks.LEAVES); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getFoliageColor(blockView, blockPos) : FoliageColors.getDefaultColor(), Blocks.LEAVES2); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getWaterColor(blockView, blockPos) : -1, Blocks.WATER, Blocks.FLOWING_WATER); - blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877((Integer) blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877(blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : -1, Blocks.SUGARCANE); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - int j = (Integer) blockState.get(AttachedStemBlock.AGE); + int j = blockState.get(AttachedStemBlock.AGE); int k = j * 32; int l = 255 - j * 8; int m = j * 4; @@ -70,9 +70,9 @@ public static BlockColors create() { } public int method_13410(BlockState blockState) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); if (blockColorable != null) { - return blockColorable.method_12155(blockState, null, (BlockPos) null, 0); + return blockColorable.method_12155(blockState, null, null, 0); } else { MaterialColor materialColor = blockState.getMaterialColor(); return materialColor != null ? materialColor.color : -1; @@ -80,15 +80,14 @@ public int method_13410(BlockState blockState) { } public int method_12157(BlockState blockState, @Nullable EmptyBlockView blockView, @Nullable BlockPos blockPos, int i) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); return blockColorable == null ? -1 : blockColorable.method_12155(blockState, blockView, blockPos, i); } public void method_12158(BlockColorable blockColorable, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.BlockColor2Id.set(blockColorable, Block.getIdByBlock(block)); } diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 91% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index d728f58f..f4d20ec2 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; public class FoliageColors { private static int[] colorMap = new int[65536]; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 88% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 2e828e1c..0528f394 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; public class GrassColors { private static int[] colorMap = new int[65536]; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index 1572a082..75c9f89c 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/SkyColor.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/SkyColor.java similarity index 97% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/SkyColor.java rename to 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/SkyColor.java index 033a11ca..fd0b7ae7 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/SkyColor.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/SkyColor.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java index 893c26c5..1453aa27 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java @@ -2,7 +2,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.SkyColor; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.SkyColor; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import net.minecraft.util.Identifier; import net.minecraft.util.registry.SimpleRegistry; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index fe814585..47cac43b 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -93,31 +93,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index cb4b58b6..b1b24cf8 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -49,7 +49,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -59,7 +59,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index ce9c0ee9..401c2c5a 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -3,9 +3,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BiomeColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BiomeColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 79% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index e4070ada..874569b3 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; @@ -7,8 +7,8 @@ import java.util.Iterator; public class BiomeColors { - private static final ColorProvider GRASS_COLOR = (biome, pos) -> biome.getGrassColor(pos); - private static final ColorProvider FOLIAGE_COLOR = (biome, pos) -> biome.getFoliageColor(pos); + private static final ColorProvider GRASS_COLOR = Biome::getGrassColor; + private static final ColorProvider FOLIAGE_COLOR = Biome::getFoliageColor; private static final ColorProvider WATER_COLOR = (biome, pos) -> biome.getWaterColor(); private static int getColor(BlockView view, BlockPos pos, ColorProvider provider) { @@ -18,7 +18,7 @@ private static int getColor(BlockView view, BlockPos pos, ColorProvider provider int l; for (Iterator var6 = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); var6.hasNext(); k += l & 255) { - BlockPos.Mutable mutable = (BlockPos.Mutable) var6.next(); + BlockPos.Mutable mutable = var6.next(); l = provider.getColorAtPos(view.getBiome(mutable), mutable); i += (l & 16711680) >> 16; j += (l & '\uff00') >> 8; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java similarity index 83% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java index d1443853..64809900 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java similarity index 95% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java index a18847ac..51bf78c8 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; @@ -51,7 +51,7 @@ public static BlockColors create() { }, Blocks.LEAVES); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getFoliageColor(blockView, blockPos) : FoliageColors.getDefaultColor(), Blocks.LEAVES2); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getWaterColor(blockView, blockPos) : -1, Blocks.WATER, Blocks.FLOWING_WATER); - blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877((Integer) blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877(blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : -1, Blocks.SUGARCANE); blockColors.method_12158((blockState, blockView, blockPos, i) -> { int j = blockState.get(AttachedStemBlock.AGE); @@ -91,8 +91,7 @@ public int method_12157(BlockState blockState, @Nullable BlockView blockView, @N public void method_12158(BlockColorable blockColorable, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.BlockColor2Id.set(blockColorable, Block.getIdByBlock(block)); } } diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 9a7ad297..1d3f9480 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index d6fe5bd7..9d653723 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index c6b2943e..f733e90f 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index 1036d62c..f6870455 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -95,31 +95,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index 0b375d55..5528e0b7 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -55,7 +55,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -65,7 +65,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index 146afba4..72c79511 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -2,10 +2,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.DGU; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 97% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index a6105512..a661211e 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.client.MinecraftClient; import net.minecraft.util.math.BlockPos; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java similarity index 83% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java index 280d2eeb..f6baf129 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java similarity index 96% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java index eec0c8e1..a372bf64 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.block.*; import net.minecraft.class_2181; @@ -56,8 +56,7 @@ public int method_18332(BlockState blockState, @Nullable RenderBlockView renderB public void method_12158(BlockColorable blockColorable, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.BlockColor2Id.set(blockColorable, Registry.BLOCK.getRawId(block)); } diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 9a7ad297..1d3f9480 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index d6fe5bd7..9d653723 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index c6b2943e..f733e90f 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java index 133b8ef0..1de3cf31 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/BiomesDataGenerator.java @@ -13,12 +13,11 @@ public class BiomesDataGenerator implements IDataGenerator { private static String guessBiomeDimensionFromCategory(Biome biome) { - String category = switch (biome.getCategory()) { + return switch (biome.getCategory()) { case NETHER -> "nether"; case THEEND -> "end"; default -> "overworld"; }; - return category; } private static int getBiomeColorFor(String biomeName) { diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index f56096df..d2db88de 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -77,7 +77,7 @@ private static String getCategoryFrom(@NotNull EntityType entityType) { if (entityType == EntityType.PLAYER) return "other"; // fail early for player entities Class entityClazz = getEntityClass(entityType); String packageName = entityClazz.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -87,7 +87,6 @@ private static String getCategoryFrom(@NotNull EntityType entityType) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index a6bd0635..07935d7f 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -2,10 +2,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.util.DGU; import net.minecraft.block.Block; import net.minecraft.block.Blocks; diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 97c57352..f1068ebd 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index ff1ce7b1..91270912 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index c6b2943e..f733e90f 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index 754d7dbf..8ae3fdad 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -2,9 +2,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.util.DGU; import net.fabricmc.api.EnvType; import net.fabricmc.loader.api.FabricLoader; diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 97c57352..f1068ebd 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 300131c1..ee6a498a 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 94% rename from 1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index c9b29873..5a21ac15 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.client.util.math.Vector3f; import net.minecraft.util.math.MathHelper; diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index a9b7788d..07926410 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -2,9 +2,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.util.EmptyRenderBlockView; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 97c57352..f1068ebd 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 8273ed57..9452d37a 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 94% rename from 1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index c9b29873..5a21ac15 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.client.util.math.Vector3f; import net.minecraft.util.math.MathHelper; diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index 3d0a895d..f480e930 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -2,9 +2,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeEffectsAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyRenderBlockView; import net.fabricmc.api.EnvType; diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java index 2107780e..e8430ebe 100644 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java @@ -34,12 +34,12 @@ public static BlockColors create() { blockColors.registerColorProvider((state, world, pos, tintIndex) -> FoliageColors.getBirchColor(), Blocks.BIRCH_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor(), Blocks.OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.ACACIA_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.VINE, Blocks.MANGROVE_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getWaterColor(world, pos) : -1, Blocks.WATER, Blocks.BUBBLE_COLUMN, Blocks.WATER_CAULDRON); - blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor((Integer) state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor(state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.registerColorProperty(RedstoneWireBlock.POWER, Blocks.REDSTONE_WIRE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : -1, Blocks.SUGAR_CANE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> 14731036, Blocks.ATTACHED_MELON_STEM, Blocks.ATTACHED_PUMPKIN_STEM); blockColors.registerColorProvider((state, world, pos, tintIndex) -> { - int i = (Integer) state.get(StemBlock.AGE); + int i = state.get(StemBlock.AGE); int j = i * 32; int k = 255 - i * 8; int l = i * 4; @@ -51,9 +51,9 @@ public static BlockColors create() { } public int getParticleColor(BlockState state, World world, BlockPos pos) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); if (blockColorProvider != null) { - return blockColorProvider.getColor(state, (BlockRenderView) null, (BlockPos) null, 0); + return blockColorProvider.getColor(state, null, null, 0); } else { MapColor mapColor = state.getMapColor(world, pos); return mapColor != null ? mapColor.color : -1; @@ -61,15 +61,14 @@ public int getParticleColor(BlockState state, World world, BlockPos pos) { } public int getColor(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int tintIndex) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); return blockColorProvider == null ? -1 : blockColorProvider.getColor(state, world, pos, tintIndex); } public void registerColorProvider(BlockColorProvider provider, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.providers.set(provider, Registry.BLOCK.getRawId(block)); } @@ -78,8 +77,7 @@ public void registerColorProvider(BlockColorProvider provider, Block... blocks) private void registerColorProperties(Set> properties, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.properties.put(block, properties); } @@ -90,6 +88,6 @@ private void registerColorProperty(Property property, Block... blocks) { } public Set> getProperties(Block block) { - return (Set) this.properties.getOrDefault(block, ImmutableSet.of()); + return this.properties.getOrDefault(block, ImmutableSet.of()); } } diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java index 2107780e..e8430ebe 100644 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java @@ -34,12 +34,12 @@ public static BlockColors create() { blockColors.registerColorProvider((state, world, pos, tintIndex) -> FoliageColors.getBirchColor(), Blocks.BIRCH_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor(), Blocks.OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.ACACIA_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.VINE, Blocks.MANGROVE_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getWaterColor(world, pos) : -1, Blocks.WATER, Blocks.BUBBLE_COLUMN, Blocks.WATER_CAULDRON); - blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor((Integer) state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor(state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.registerColorProperty(RedstoneWireBlock.POWER, Blocks.REDSTONE_WIRE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : -1, Blocks.SUGAR_CANE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> 14731036, Blocks.ATTACHED_MELON_STEM, Blocks.ATTACHED_PUMPKIN_STEM); blockColors.registerColorProvider((state, world, pos, tintIndex) -> { - int i = (Integer) state.get(StemBlock.AGE); + int i = state.get(StemBlock.AGE); int j = i * 32; int k = 255 - i * 8; int l = i * 4; @@ -51,9 +51,9 @@ public static BlockColors create() { } public int getParticleColor(BlockState state, World world, BlockPos pos) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); if (blockColorProvider != null) { - return blockColorProvider.getColor(state, (BlockRenderView) null, (BlockPos) null, 0); + return blockColorProvider.getColor(state, null, null, 0); } else { MapColor mapColor = state.getMapColor(world, pos); return mapColor != null ? mapColor.color : -1; @@ -61,15 +61,14 @@ public int getParticleColor(BlockState state, World world, BlockPos pos) { } public int getColor(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int tintIndex) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(Registry.BLOCK.getRawId(state.getBlock())); return blockColorProvider == null ? -1 : blockColorProvider.getColor(state, world, pos, tintIndex); } public void registerColorProvider(BlockColorProvider provider, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.providers.set(provider, Registry.BLOCK.getRawId(block)); } @@ -78,8 +77,7 @@ public void registerColorProvider(BlockColorProvider provider, Block... blocks) private void registerColorProperties(Set> properties, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.properties.put(block, properties); } @@ -90,6 +88,6 @@ private void registerColorProperty(Property property, Block... blocks) { } public Set> getProperties(Block block) { - return (Set) this.properties.getOrDefault(block, ImmutableSet.of()); + return this.properties.getOrDefault(block, ImmutableSet.of()); } } diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a015cc4f..6bd50d74 100644 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -76,7 +76,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java index 368da7f4..a0a3bdf8 100644 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mojangannoyances/BlockColors.java @@ -35,12 +35,12 @@ public static BlockColors create() { blockColors.registerColorProvider((state, world, pos, tintIndex) -> FoliageColors.getBirchColor(), Blocks.BIRCH_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor(), Blocks.OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.ACACIA_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.VINE, Blocks.MANGROVE_LEAVES); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getWaterColor(world, pos) : -1, Blocks.WATER, Blocks.BUBBLE_COLUMN, Blocks.WATER_CAULDRON); - blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor((Integer) state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.registerColorProvider((state, world, pos, tintIndex) -> RedstoneWireBlock.getWireColor(state.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.registerColorProperty(RedstoneWireBlock.POWER, Blocks.REDSTONE_WIRE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : -1, Blocks.SUGAR_CANE); blockColors.registerColorProvider((state, world, pos, tintIndex) -> 14731036, Blocks.ATTACHED_MELON_STEM, Blocks.ATTACHED_PUMPKIN_STEM); blockColors.registerColorProvider((state, world, pos, tintIndex) -> { - int i = (Integer) state.get(StemBlock.AGE); + int i = state.get(StemBlock.AGE); int j = i * 32; int k = 255 - i * 8; int l = i * 4; @@ -52,9 +52,9 @@ public static BlockColors create() { } public int getParticleColor(BlockState state, World world, BlockPos pos) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(DGU.getWorld().getRegistryManager().get(RegistryKeys.BLOCK).getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(DGU.getWorld().getRegistryManager().get(RegistryKeys.BLOCK).getRawId(state.getBlock())); if (blockColorProvider != null) { - return blockColorProvider.getColor(state, (BlockRenderView) null, (BlockPos) null, 0); + return blockColorProvider.getColor(state, null, null, 0); } else { MapColor mapColor = state.getMapColor(world, pos); return mapColor != null ? mapColor.color : -1; @@ -62,15 +62,14 @@ public int getParticleColor(BlockState state, World world, BlockPos pos) { } public int getColor(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int tintIndex) { - BlockColorProvider blockColorProvider = (BlockColorProvider) this.providers.get(DGU.getWorld().getRegistryManager().get(RegistryKeys.BLOCK).getRawId(state.getBlock())); + BlockColorProvider blockColorProvider = this.providers.get(DGU.getWorld().getRegistryManager().get(RegistryKeys.BLOCK).getRawId(state.getBlock())); return blockColorProvider == null ? -1 : blockColorProvider.getColor(state, world, pos, tintIndex); } public void registerColorProvider(BlockColorProvider provider, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.providers.set(provider, DGU.getWorld().getRegistryManager().get(RegistryKeys.BLOCK).getRawId(block)); } @@ -79,8 +78,7 @@ public void registerColorProvider(BlockColorProvider provider, Block... blocks) private void registerColorProperties(Set> properties, Block... blocks) { int var4 = blocks.length; - for (int var5 = 0; var5 < var4; ++var5) { - Block block = blocks[var5]; + for (Block block : blocks) { this.properties.put(block, properties); } @@ -91,6 +89,6 @@ private void registerColorProperty(Property property, Block... blocks) { } public Set> getProperties(Block block) { - return (Set) this.properties.getOrDefault(block, ImmutableSet.of()); + return this.properties.getOrDefault(block, ImmutableSet.of()); } } diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java similarity index 98% rename from 1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java rename to 1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java index 7ea5ca90..c032c331 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.block.*; import net.minecraft.world.biome.Biome; diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 93% rename from 1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index bb71f227..b5538a62 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 9841e737..0ca9862a 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index 1572a082..75c9f89c 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index 8cbef351..b2d77af7 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -111,31 +111,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } - - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index 6db70ce8..ebfcf936 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -54,7 +54,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -64,7 +64,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index fdb342fb..414749bb 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -3,9 +3,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BiomeBlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BiomeBlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; import dev.u9g.minecraftdatagenerator.mixin.accessor.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java similarity index 96% rename from 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java rename to 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java index e860bb9d..ee0d2201 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeBlockColors.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeBlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.*; @@ -46,7 +46,7 @@ public BlockState getBlockState(BlockPos pos) { } else if (block instanceof SugarCaneBlock || block instanceof TallPlantBlock) { return GrassColors.getGrassColor(EmptyBlockView.INSTANCE.getBiome(BlockPos.ORIGIN)); } else if (block instanceof VineBlock) { - return dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors.getFoliageColor(EmptyBlockView.INSTANCE.getBiome(BlockPos.ORIGIN)); + return dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors.getFoliageColor(EmptyBlockView.INSTANCE.getBiome(BlockPos.ORIGIN)); } return 0xFFFFFF; } diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 75% rename from 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index 3b020082..fca5440a 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; @@ -7,8 +7,8 @@ import java.util.Iterator; public class BiomeColors { - private static final ColorProvider GRASS_COLOR = (biome, pos) -> biome.getGrassColor(pos); - private static final ColorProvider FOLIAGE_COLOR = (biome, pos) -> biome.getFoliageColor(pos); + private static final ColorProvider GRASS_COLOR = Biome::getGrassColor; + private static final ColorProvider FOLIAGE_COLOR = Biome::getFoliageColor; private static final ColorProvider WATER_COLOR = (biome, pos) -> biome.waterColor; private static int getColor(BlockView view, BlockPos pos, ColorProvider provider) { @@ -17,7 +17,7 @@ private static int getColor(BlockView view, BlockPos pos, ColorProvider provider int k = 0; int l; - for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { + for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { BlockPos.Mutable mutable = (BlockPos.Mutable) iterator.next(); l = provider.getColorAtPos(view.getBiome(mutable), mutable); i += (l & 16711680) >> 16; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 94% rename from 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index c137d32d..1a55df05 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 92% rename from 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 112d816c..ff015f9a 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java similarity index 92% rename from 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java rename to 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java index 1572a082..75c9f89c 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index 6d025605..38ec86b6 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -96,31 +96,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index 7ade8308..e0e9e745 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -55,7 +55,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -65,7 +65,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index c69b3cb6..4412712d 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -3,10 +3,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BiomeBlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BiomeBlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java index 8290f2b2..4bf760f8 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java @@ -8,9 +8,12 @@ import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Unique; @Mixin(CocoaBlock.class) public class CocoaBlockOverwrite { + @Unique + @Unique private static Box collisionBox(BlockState state) { Direction direction = state.get(CocoaBlock.FACING); int i = state.get(CocoaBlock.AGE); diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java index 538eba50..97e8fb72 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java @@ -6,9 +6,12 @@ import net.minecraft.util.math.Box; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; @Mixin(SkeletonSkullBlock.class) public class SkeletonSkullBlockOverwrite { + @Unique + @Unique private static Box boundingBox(BlockState state) { return switch (state.get(SkeletonSkullBlock.FACING)) { default -> new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f); @@ -19,6 +22,8 @@ private static Box boundingBox(BlockState state) { }; } + @Unique + @Unique public Box getCollisionBox(World world, BlockPos pos, BlockState state) { return boundingBox(state); } diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/StairBlockOverwrite.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/StairBlockOverwrite.java index bf64f53e..2da77868 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/StairBlockOverwrite.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/StairBlockOverwrite.java @@ -14,6 +14,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import java.util.List; @@ -53,6 +54,7 @@ public BlockState getBlockState(BlockPos pos) { this.setBoundingBox(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f); } + @Unique public Box someFuncThatIRemade(BlockState state) { if (state.get(HALF) == StairsBlock.Half.TOP) { return new Box(0.0f, 0.5f, 0.0f, 1.0f, 1.0f, 1.0f); @@ -61,6 +63,7 @@ public Box someFuncThatIRemade(BlockState state) { } } + @Unique public boolean calculateWhichTypeOfStairThisIsButDoesntWorkBecauseWeDontHaveAdjBlocks(BlockState state) { EmptyBlockView blockView = new EmptyBlockView() { @Override diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java deleted file mode 100644 index 1572a082..00000000 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/ServerSideRedstoneWireBlock.java +++ /dev/null @@ -1,28 +0,0 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; - -import net.minecraft.util.math.MathHelper; - -public class ServerSideRedstoneWireBlock { - public static int getWireColor(int powerLevel) { - float f = (float) powerLevel / 15.0F; - float g = f * 0.6F + 0.4F; - if (powerLevel == 0) { - g = 0.3F; - } - - float h = f * f * 0.7F - 0.5F; - float j = f * f * 0.6F - 0.7F; - if (h < 0.0F) { - h = 0.0F; - } - - if (j < 0.0F) { - j = 0.0F; - } - - int k = MathHelper.clamp((int) (g * 255.0F), 0, 255); - int l = MathHelper.clamp((int) (h * 255.0F), 0, 255); - int m = MathHelper.clamp((int) (j * 255.0F), 0, 255); - return -16777216 | k << 16 | l << 8 | m; - } -} diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java similarity index 75% rename from 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java rename to 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java index 257db1a9..f42641fb 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BiomeColors.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BiomeColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.util.math.BlockPos; @@ -7,8 +7,8 @@ import java.util.Iterator; public class BiomeColors { - private static final ColorProvider GRASS_COLOR = (biome, pos) -> biome.getGrassColor(pos); - private static final ColorProvider FOLIAGE_COLOR = (biome, pos) -> biome.getFoliageColor(pos); + private static final ColorProvider GRASS_COLOR = Biome::getGrassColor; + private static final ColorProvider FOLIAGE_COLOR = Biome::getFoliageColor; private static final ColorProvider WATER_COLOR = (biome, pos) -> biome.getWaterColor(); private static int getColor(EmptyBlockView view, BlockPos pos, ColorProvider provider) { @@ -17,7 +17,7 @@ private static int getColor(EmptyBlockView view, BlockPos pos, ColorProvider pro int k = 0; int l; - for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { + for (Iterator iterator = BlockPos.mutableIterate(pos.add(-1, 0, -1), pos.add(1, 0, 1)).iterator(); iterator.hasNext(); k += l & 255) { BlockPos.Mutable mutable = (BlockPos.Mutable) iterator.next(); l = provider.getColorAtPos(view.getBiome(mutable), mutable); i += (l & 16711680) >> 16; diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java similarity index 84% rename from 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java rename to 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java index 3e3e044c..b6819227 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColorable.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColorable.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.BlockState; diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java similarity index 84% rename from 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java rename to 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java index 4df7551c..2bd090ca 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/BlockColors.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/BlockColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import net.minecraft.block.*; @@ -19,7 +19,7 @@ public BlockColors() { public static BlockColors create() { final BlockColors blockColors = new BlockColors(); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - DoublePlantBlock.DoublePlantType doublePlantType = (DoublePlantBlock.DoublePlantType) blockState.get(DoublePlantBlock.VARIANT); + DoublePlantBlock.DoublePlantType doublePlantType = blockState.get(DoublePlantBlock.VARIANT); return blockView == null || blockPos == null || doublePlantType != DoublePlantBlock.DoublePlantType.GRASS && doublePlantType != DoublePlantBlock.DoublePlantType.FERN ? -1 : BiomeColors.getGrassColor(blockView, blockPos); }, Blocks.DOUBLE_PLANT); blockColors.method_12158((blockState, blockView, blockPos, i) -> { @@ -38,7 +38,7 @@ public static BlockColors create() { }, Blocks.FLOWER_POT); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : GrassColors.getColor(0.5D, 1.0D), Blocks.GRASS); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - PlanksBlock.WoodType woodType = (PlanksBlock.WoodType) blockState.get(Leaves1Block.VARIANT); + PlanksBlock.WoodType woodType = blockState.get(Leaves1Block.VARIANT); if (woodType == PlanksBlock.WoodType.SPRUCE) { return FoliageColors.getSpruceColor(); } else if (woodType == PlanksBlock.WoodType.BIRCH) { @@ -49,10 +49,10 @@ public static BlockColors create() { }, Blocks.LEAVES); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getFoliageColor(blockView, blockPos) : FoliageColors.getDefaultColor(), Blocks.LEAVES2); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getWaterColor(blockView, blockPos) : -1, Blocks.WATER, Blocks.FLOWING_WATER); - blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877((Integer) blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); + blockColors.method_12158((blockState, blockView, blockPos, i) -> RedstoneWireBlock.method_8877(blockState.get(RedstoneWireBlock.POWER)), Blocks.REDSTONE_WIRE); blockColors.method_12158((blockState, blockView, blockPos, i) -> blockView != null && blockPos != null ? BiomeColors.getGrassColor(blockView, blockPos) : -1, Blocks.SUGARCANE); blockColors.method_12158((blockState, blockView, blockPos, i) -> { - int j = (Integer) blockState.get(AttachedStemBlock.AGE); + int j = blockState.get(AttachedStemBlock.AGE); int k = j * 32; int l = 255 - j * 8; int m = j * 4; @@ -71,9 +71,9 @@ public static BlockColors create() { } public int method_13410(BlockState blockState) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); if (blockColorable != null) { - return blockColorable.method_12155(blockState, (EmptyBlockView) null, (BlockPos) null, 0); + return blockColorable.method_12155(blockState, null, null, 0); } else { MaterialColor materialColor = blockState.getMaterialColor(); return materialColor != null ? materialColor.color : -1; @@ -81,15 +81,14 @@ public int method_13410(BlockState blockState) { } public int method_12157(BlockState blockState, @Nullable EmptyBlockView blockView, @Nullable BlockPos blockPos, int i) { - BlockColorable blockColorable = (BlockColorable) this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); + BlockColorable blockColorable = this.BlockColor2Id.fromId(Block.getIdByBlock(blockState.getBlock())); return blockColorable == null ? -1 : blockColorable.method_12155(blockState, blockView, blockPos, i); } public void method_12158(BlockColorable blockColorable, Block... blocks) { int i = blocks.length; - for (int j = 0; j < i; ++j) { - Block block = blocks[j]; + for (Block block : blocks) { this.BlockColor2Id.set(blockColorable, Block.getIdByBlock(block)); } diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java similarity index 78% rename from 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java rename to 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java index 8c32f48f..b63e543b 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/FoliageColors.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/FoliageColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; @@ -30,8 +30,8 @@ public static int getDefaultColor() { } public static int getFoliageColor(Biome biome) { - double d = (double) MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return FoliageColors.getColor(d, e); } } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java similarity index 74% rename from 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java rename to 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java index 88687071..afee2b70 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/ClientSideAnnoyances/GrassColors.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/GrassColors.java @@ -1,4 +1,4 @@ -package dev.u9g.minecraftdatagenerator.ClientSideAnnoyances; +package dev.u9g.minecraftdatagenerator.clientsideannoyances; import net.minecraft.util.math.MathHelper; import net.minecraft.world.biome.Biome; @@ -19,8 +19,8 @@ public static int getColor(double temperature, double humidity) { } public static int getGrassColor(Biome biome) { - double d = (double) MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); - double e = (double) MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); + double d = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F); + double e = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F); return GrassColors.getColor(d, e); } } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java new file mode 100644 index 00000000..75c9f89c --- /dev/null +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/clientsideannoyances/ServerSideRedstoneWireBlock.java @@ -0,0 +1,28 @@ +package dev.u9g.minecraftdatagenerator.clientsideannoyances; + +import net.minecraft.util.math.MathHelper; + +public class ServerSideRedstoneWireBlock { + public static int getWireColor(int powerLevel) { + float f = (float) powerLevel / 15.0F; + float g = f * 0.6F + 0.4F; + if (powerLevel == 0) { + g = 0.3F; + } + + float h = f * f * 0.7F - 0.5F; + float j = f * f * 0.6F - 0.7F; + if (h < 0.0F) { + h = 0.0F; + } + + if (j < 0.0F) { + j = 0.0F; + } + + int k = MathHelper.clamp((int) (g * 255.0F), 0, 255); + int l = MathHelper.clamp((int) (h * 255.0F), 0, 255); + int m = MathHelper.clamp((int) (j * 255.0F), 0, 255); + return -16777216 | k << 16 | l << 8 | m; + } +} diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java index b2789fd0..2bb5a0be 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlockCollisionShapesDataGenerator.java @@ -96,31 +96,22 @@ public JsonObject toJSON() { return shapes; } - private static class Shapes { - final List boxes; - - public Shapes(List boxes) { - this.boxes = boxes; - } + private record Shapes(List boxes) { public JsonArray toJSON() { - JsonArray arr = new JsonArray(); - boxes.forEach(box -> arr.add(jsonOf(box))); - return arr; - } + JsonArray arr = new JsonArray(); + boxes.forEach(box -> arr.add(jsonOf(box))); + return arr; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Shapes shapes = (Shapes) o; - return Objects.equals(boxes, shapes.boxes); - } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Shapes shapes = (Shapes) o; + return Objects.equals(boxes, shapes.boxes); + } - @Override - public int hashCode() { - return boxes != null ? boxes.hashCode() : 0; - } } } } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java index 6a33b00d..d5ef72ef 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java @@ -55,7 +55,7 @@ private static Entity makeEntity(Class type) { private static String getCategoryFrom(@NotNull Class entityClass) { if (entityClass == PlayerEntity.class) return "other"; // fail early for player entities String packageName = entityClass.getPackage().getName(); - String category = switch (packageName) { + return switch (packageName) { case "net.minecraft.entity.decoration", "net.minecraft.entity.decoration.painting" -> "Immobile"; case "net.minecraft.entity.boss", "net.minecraft.entity.mob", "net.minecraft.entity.boss.dragon" -> "Hostile mobs"; @@ -65,7 +65,6 @@ private static String getCategoryFrom(@NotNull Class entityClass) { case "net.minecraft.entity" -> "other"; default -> throw new Error("Unexpected entity type: " + packageName); }; - return category; } //Honestly, both "type" and "category" fields in the schema and examples do not contain any useful information diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java index a4f970c9..8d1b2a84 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java @@ -3,10 +3,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.BlockColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.FoliageColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.GrassColors; -import dev.u9g.minecraftdatagenerator.ClientSideAnnoyances.ServerSideRedstoneWireBlock; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.BlockColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.FoliageColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.GrassColors; +import dev.u9g.minecraftdatagenerator.clientsideannoyances.ServerSideRedstoneWireBlock; import dev.u9g.minecraftdatagenerator.mixin.BiomeAccessor; import dev.u9g.minecraftdatagenerator.util.EmptyBlockView; import dev.u9g.minecraftdatagenerator.util.Registries; diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java index a71961c9..e27fb68f 100644 --- a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java +++ b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java @@ -75,7 +75,7 @@ public static JsonObject generateEnchantment(Registry registry, Enc List incompatibleEnchantments = registry.stream() .filter(other -> !enchantment.canCombine(other)) .filter(other -> other != enchantment) - .collect(Collectors.toList()); + .toList(); JsonArray excludes = new JsonArray(); for (Enchantment excludedEnchantment : incompatibleEnchantments) { From 50e0eb9e9ca314d656ba4308978431e536b505fa Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:25:56 +0100 Subject: [PATCH 09/12] Fix compilation --- .../mixin/overwrite/CocoaBlockOverwrite.java | 1 - .../mixin/overwrite/SkeletonSkullBlockOverwrite.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java index 4bf760f8..5158ecd6 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/CocoaBlockOverwrite.java @@ -12,7 +12,6 @@ @Mixin(CocoaBlock.class) public class CocoaBlockOverwrite { - @Unique @Unique private static Box collisionBox(BlockState state) { Direction direction = state.get(CocoaBlock.FACING); diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java index 97e8fb72..c0e76338 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/overwrite/SkeletonSkullBlockOverwrite.java @@ -10,7 +10,6 @@ @Mixin(SkeletonSkullBlock.class) public class SkeletonSkullBlockOverwrite { - @Unique @Unique private static Box boundingBox(BlockState state) { return switch (state.get(SkeletonSkullBlock.FACING)) { @@ -22,7 +21,6 @@ private static Box boundingBox(BlockState state) { }; } - @Unique @Unique public Box getCollisionBox(World world, BlockPos pos, BlockState state) { return boundingBox(state); From 1ef470d775141b19ad36262d5d34c1724d772085 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:39:54 +0100 Subject: [PATCH 10/12] Add job timeout --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9901111c..7bd61505 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,13 +9,14 @@ on: jobs: build: - runs-on: ubuntu-latest - strategy: matrix: version: ["1.7", "1.8.9", "1.9.4", "1.10.2", "1.11.2", "1.12.2", "1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "22w19a", "1.19", "1.19.2", "1.20"] name: Build ${{ matrix.version }} + timeout-minutes: 10 + + runs-on: ubuntu-latest steps: - name: Checkout repository From 1fd0a07ecb54937ca523741c3347053fc920d639 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:44:57 +0100 Subject: [PATCH 11/12] Revert "Remove all shutdown hook, we do not care about generator worlds" This reverts commit 44117795360c9d67fab15566e2fc6436bfe9ac6f. --- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 3 +-- .../minecraftdatagenerator/mixin/StopMixin.java | 15 --------------- .../minecraft-data-generator.mixins.json | 1 - 32 files changed, 10 insertions(+), 266 deletions(-) delete mode 100644 1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java delete mode 100644 22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.10.2/src/main/resources/minecraft-data-generator.mixins.json b/1.10.2/src/main/resources/minecraft-data-generator.mixins.json index 743298f2..4dd13158 100644 --- a/1.10.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.10.2/src/main/resources/minecraft-data-generator.mixins.json @@ -15,8 +15,7 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.11.2/src/main/resources/minecraft-data-generator.mixins.json b/1.11.2/src/main/resources/minecraft-data-generator.mixins.json index f67dcb78..fcdcd1a0 100644 --- a/1.11.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.11.2/src/main/resources/minecraft-data-generator.mixins.json @@ -13,8 +13,7 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.12.2/src/main/resources/minecraft-data-generator.mixins.json b/1.12.2/src/main/resources/minecraft-data-generator.mixins.json index f67dcb78..fcdcd1a0 100644 --- a/1.12.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.12.2/src/main/resources/minecraft-data-generator.mixins.json @@ -13,8 +13,7 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.13/src/main/resources/minecraft-data-generator.mixins.json b/1.13/src/main/resources/minecraft-data-generator.mixins.json index f1c9fe0a..ea255f59 100644 --- a/1.13/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.13/src/main/resources/minecraft-data-generator.mixins.json @@ -6,8 +6,7 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.14/src/main/resources/minecraft-data-generator.mixins.json b/1.14/src/main/resources/minecraft-data-generator.mixins.json index f1c9fe0a..ea255f59 100644 --- a/1.14/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.14/src/main/resources/minecraft-data-generator.mixins.json @@ -6,8 +6,7 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.15/src/main/resources/minecraft-data-generator.mixins.json b/1.15/src/main/resources/minecraft-data-generator.mixins.json index f1c9fe0a..ea255f59 100644 --- a/1.15/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.15/src/main/resources/minecraft-data-generator.mixins.json @@ -6,8 +6,7 @@ "mixins": [ "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.16/src/main/resources/minecraft-data-generator.mixins.json b/1.16/src/main/resources/minecraft-data-generator.mixins.json index 16feca5b..7154c902 100644 --- a/1.16/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.16/src/main/resources/minecraft-data-generator.mixins.json @@ -8,8 +8,7 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.17/src/main/resources/minecraft-data-generator.mixins.json b/1.17/src/main/resources/minecraft-data-generator.mixins.json index 4bc8f8d3..0b916b11 100644 --- a/1.17/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.17/src/main/resources/minecraft-data-generator.mixins.json @@ -6,8 +6,7 @@ "mixins": [ "ClientPlayerInteractionManagerMixin", "MiningToolItemAccessor", - "ReadyMixin", - "StopMixin" + "ReadyMixin" ], "client": [ ], diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.18/src/main/resources/minecraft-data-generator.mixins.json b/1.18/src/main/resources/minecraft-data-generator.mixins.json index a2a44b55..5d80b76e 100644 --- a/1.18/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.18/src/main/resources/minecraft-data-generator.mixins.json @@ -7,8 +7,7 @@ "ClientPlayerInteractionManagerMixin", "EULAMixin", "MiningToolItemAccessor", - "ReadyMixin", - "StopMixin" + "ReadyMixin" ], "client": [ ], diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.19.2/src/main/resources/minecraft-data-generator.mixins.json b/1.19.2/src/main/resources/minecraft-data-generator.mixins.json index 4b1310f7..f3afe061 100644 --- a/1.19.2/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.19.2/src/main/resources/minecraft-data-generator.mixins.json @@ -8,7 +8,6 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", - "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.19/src/main/resources/minecraft-data-generator.mixins.json b/1.19/src/main/resources/minecraft-data-generator.mixins.json index 4b1310f7..f3afe061 100644 --- a/1.19/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.19/src/main/resources/minecraft-data-generator.mixins.json @@ -8,7 +8,6 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", - "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.20/src/main/resources/minecraft-data-generator.mixins.json b/1.20/src/main/resources/minecraft-data-generator.mixins.json index 4b1310f7..f3afe061 100644 --- a/1.20/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.20/src/main/resources/minecraft-data-generator.mixins.json @@ -8,7 +8,6 @@ "EULAMixin", "MiningToolItemAccessor", "ReadyMixin", - "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.7/src/main/resources/minecraft-data-generator.mixins.json b/1.7/src/main/resources/minecraft-data-generator.mixins.json index f995162f..804329be 100644 --- a/1.7/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.7/src/main/resources/minecraft-data-generator.mixins.json @@ -6,7 +6,6 @@ "mixins": [ "BlocksMixin", "ReadyMixin", - "StopMixin", "VariantBlockItemAccessor", "accessor.BiomeAccessor", "accessor.BlockAccessor", diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.8.9/src/main/resources/minecraft-data-generator.mixins.json b/1.8.9/src/main/resources/minecraft-data-generator.mixins.json index c92fb692..90389267 100644 --- a/1.8.9/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.8.9/src/main/resources/minecraft-data-generator.mixins.json @@ -13,7 +13,6 @@ "NoteBlockAccessor", "ReadyMixin", "StatusEffectAccessor", - "StopMixin", "overwrite.CocoaBlockOverwrite", "overwrite.EndPortalFrameBlockOverwrite", "overwrite.ItemEntityOverwrite", diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index f20088fd..00000000 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "stopServer()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/1.9.4/src/main/resources/minecraft-data-generator.mixins.json b/1.9.4/src/main/resources/minecraft-data-generator.mixins.json index 743298f2..4dd13158 100644 --- a/1.9.4/src/main/resources/minecraft-data-generator.mixins.json +++ b/1.9.4/src/main/resources/minecraft-data-generator.mixins.json @@ -15,8 +15,7 @@ "NoteBlockAccessor", "ReadyMixin", "SoundAccessor", - "StatusEffectAccessor", - "StopMixin" + "StatusEffectAccessor" ], "client": [ ], diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java deleted file mode 100644 index 742fb94c..00000000 --- a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/StopMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.u9g.minecraftdatagenerator.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class StopMixin { - @Inject(method = "shutdown()V", at = @At("HEAD"), cancellable = true) - private void init(CallbackInfo cir) { - cir.cancel(); - } -} diff --git a/22w19a/src/main/resources/minecraft-data-generator.mixins.json b/22w19a/src/main/resources/minecraft-data-generator.mixins.json index fed4d5c0..9e8d4163 100644 --- a/22w19a/src/main/resources/minecraft-data-generator.mixins.json +++ b/22w19a/src/main/resources/minecraft-data-generator.mixins.json @@ -7,7 +7,6 @@ "ClientPlayerInteractionManagerMixin", "MiningToolItemAccessor", "ReadyMixin", - "StopMixin", "TheEndBiomeDataAccessor" ], "client": [ From 02934845b6e6a35c74bfa7b978f981af2265990f Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:48:36 +0100 Subject: [PATCH 12/12] More aggressive server stopping --- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 7 +++---- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 7 +++---- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../generators/DataGenerators.java | 12 ++++++------ .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 6 +++--- .../u9g/minecraftdatagenerator/mixin/ReadyMixin.java | 2 +- 26 files changed, 96 insertions(+), 98 deletions(-) diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 273d67ca..249c6308 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..f5608f0a 100644 --- a/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.10.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,12 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 273d67ca..249c6308 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..f5608f0a 100644 --- a/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.11.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,12 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 273d67ca..249c6308 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 5e22dfed..f5608f0a 100644 --- a/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.12.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,13 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stopServer(); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 3c05c30f..e726601e 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -44,16 +44,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -64,16 +64,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 5e22dfed..f5608f0a 100644 --- a/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.13/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,13 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stopServer(); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 3c05c30f..e726601e 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -44,16 +44,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -64,16 +64,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 24804499..53d51123 100644 --- a/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.14/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -17,12 +17,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = MinecraftVersion.create().getName(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 3c05c30f..e726601e 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -44,16 +44,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -64,16 +64,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 24804499..53d51123 100644 --- a/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.15/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -17,12 +17,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = MinecraftVersion.create().getName(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 3c05c30f..e726601e 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -44,16 +44,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -64,16 +64,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 97356444..3fe886a3 100644 --- a/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.16/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -17,12 +17,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = MinecraftVersion.field_25319.getName(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index f83555bb..b0b039f7 100644 --- a/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.17/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } } diff --git a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..ba3b26b4 100644 --- a/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.18/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } } diff --git a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..ba3b26b4 100644 --- a/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19.2/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } } diff --git a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..ba3b26b4 100644 --- a/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.19/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } } diff --git a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..ba3b26b4 100644 --- a/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.20/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } } diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index d8986bd9..c2ac739c 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 1e9185fb..7ea7dcbf 100644 --- a/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.7/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -19,12 +19,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { Registries.init(); - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = (new File(".")).toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 273d67ca..249c6308 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..f5608f0a 100644 --- a/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.8.9/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,12 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java index 273d67ca..249c6308 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java @@ -45,16 +45,16 @@ public static boolean runDataGenerators(Path outputDirectory) { try { Files.createDirectories(outputDirectory); } catch (IOException exception) { - logger.log(Level.INFO, "Failed to create data generator output directory at " + outputDirectory); + logger.info("Failed to create data generator output directory at " + outputDirectory); exception.printStackTrace(); return false; } int generatorsFailed = 0; - logger.log(Level.INFO, MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); + logger.info(MessageFormat.format("Running minecraft data generators, output at {0}", outputDirectory)); for (IDataGenerator dataGenerator : GENERATORS) { - logger.log(Level.INFO, MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Running generator {0}", dataGenerator.getDataName())); try { String outputFileName = String.format("%s.json", dataGenerator.getDataName()); JsonElement outputElement = dataGenerator.generateDataJson(); @@ -65,16 +65,16 @@ public static boolean runDataGenerators(Path outputDirectory) { jsonWriter.setIndent(" "); Streams.write(outputElement, jsonWriter); } - logger.log(Level.INFO, MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); + logger.info(MessageFormat.format("Generator: {0} -> {1}", dataGenerator.getDataName(), outputFileName)); } catch (Throwable exception) { - logger.log(Level.INFO, MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); + logger.info(MessageFormat.format("Failed to run data generator {0}", dataGenerator.getDataName())); exception.printStackTrace(); generatorsFailed++; } } - logger.log(Level.INFO, "Finishing running data generators"); + logger.info("Finishing running data generators"); return generatorsFailed == 0; } } diff --git a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 32871cc3..f5608f0a 100644 --- a/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/1.9.4/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -16,12 +16,12 @@ public class ReadyMixin { @Inject(method = "setupServer()Z", at = @At("TAIL")) private void init(CallbackInfoReturnable cir) { - Main.LOGGER.log(Level.INFO, "Starting data generation!"); + Main.LOGGER.info("Starting data generation!"); String versionName = DGU.getCurrentlyRunningServer().getVersion(); Path serverRootDirectory = DGU.getCurrentlyRunningServer().getRunDirectory().toPath().toAbsolutePath(); Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); - Main.LOGGER.log(Level.INFO, "Done data generation!"); - System.exit(0); + Main.LOGGER.info("Done data generation!"); + Runtime.getRuntime().halt(0); } } diff --git a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java index 6d9415eb..ba3b26b4 100644 --- a/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java +++ b/22w19a/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java @@ -22,6 +22,6 @@ private void init(CallbackInfoReturnable cir) { Path dataDumpDirectory = serverRootDirectory.resolve("minecraft-data").resolve(versionName); DataGenerators.runDataGenerators(dataDumpDirectory); Main.LOGGER.info("Done data generation!"); - DGU.getCurrentlyRunningServer().stop(false); + Runtime.getRuntime().halt(0); } }