From 99c48c8ee19c7b491f187eae9f5becdd7e8cc5db Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sun, 20 Sep 2020 14:54:03 +0200 Subject: [PATCH] Cave air and void air must be classified as air --- prismarine-minecraft-data | 2 +- .../java/net/minestom/server/instance/block/Block.java | 10 ++++------ .../java/net/minestom/codegen/AllGenerators.java | 2 +- .../java/net/minestom/codegen/RegistriesGenerator.java | 1 - .../minestom/codegen/blocks/BlockEnumGenerator.java | 3 ++- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/prismarine-minecraft-data b/prismarine-minecraft-data index 5466efe52..a805a48c9 160000 --- a/prismarine-minecraft-data +++ b/prismarine-minecraft-data @@ -1 +1 @@ -Subproject commit 5466efe528108c7228ebe737ad5ac70af243e2e7 +Subproject commit a805a48c98a345941c095aac7865f1af30c6abf0 diff --git a/src/autogenerated/java/net/minestom/server/instance/block/Block.java b/src/autogenerated/java/net/minestom/server/instance/block/Block.java index cdfe16148..4dadfc480 100644 --- a/src/autogenerated/java/net/minestom/server/instance/block/Block.java +++ b/src/autogenerated/java/net/minestom/server/instance/block/Block.java @@ -2,14 +2,12 @@ // AUTOGENERATED BY EnumGenerator //============================== package net.minestom.server.instance.block; - -import net.minestom.server.instance.block.states.*; import net.minestom.server.registry.Registries; import net.minestom.server.utils.NamespaceID; - +import java.util.List; import java.util.ArrayList; import java.util.Arrays; -import java.util.List; +import net.minestom.server.instance.block.states.*; @SuppressWarnings({"deprecation"}) public enum Block { @@ -637,8 +635,8 @@ public enum Block { BAMBOO_SAPLING("minecraft:bamboo_sapling", (short) 9655, 1.0, 1.0, false, false, null, true), BAMBOO("minecraft:bamboo", (short) 9656, 1.0, 1.0, false, true, null, false), POTTED_BAMBOO("minecraft:potted_bamboo", (short) 9668, 0.0, 0.0, false, true, null, true), - VOID_AIR("minecraft:void_air", (short) 9669, 0.0, 0.0, false, false, null, true), - CAVE_AIR("minecraft:cave_air", (short) 9670, 0.0, 0.0, false, false, null, true), + VOID_AIR("minecraft:void_air", (short) 9669, 0.0, 0.0, true, false, null, true), + CAVE_AIR("minecraft:cave_air", (short) 9670, 0.0, 0.0, true, false, null, true), BUBBLE_COLUMN("minecraft:bubble_column", (short) 9671, 0.0, 0.0, false, false, null, false), POLISHED_GRANITE_STAIRS("minecraft:polished_granite_stairs", (short) 9684, 0.0, 0.0, false, true, null, false), SMOOTH_RED_SANDSTONE_STAIRS("minecraft:smooth_red_sandstone_stairs", (short) 9764, 0.0, 0.0, false, true, null, false), diff --git a/src/generators/java/net/minestom/codegen/AllGenerators.java b/src/generators/java/net/minestom/codegen/AllGenerators.java index 7002cc328..d39bfa815 100644 --- a/src/generators/java/net/minestom/codegen/AllGenerators.java +++ b/src/generators/java/net/minestom/codegen/AllGenerators.java @@ -16,7 +16,7 @@ import java.io.IOException; public class AllGenerators { public static void main(String[] args) throws IOException { - //BlockEnumGenerator.main(args); + BlockEnumGenerator.main(args); ItemEnumGenerator.main(args); // must be done after block PotionEnumGenerator.main(args); EnchantmentEnumGenerator.main(args); diff --git a/src/generators/java/net/minestom/codegen/RegistriesGenerator.java b/src/generators/java/net/minestom/codegen/RegistriesGenerator.java index 78a882115..5004e0ee6 100644 --- a/src/generators/java/net/minestom/codegen/RegistriesGenerator.java +++ b/src/generators/java/net/minestom/codegen/RegistriesGenerator.java @@ -42,7 +42,6 @@ public class RegistriesGenerator implements CodeGenerator { "AIR", "AIR", null, - null, "PIG", null, null, diff --git a/src/generators/java/net/minestom/codegen/blocks/BlockEnumGenerator.java b/src/generators/java/net/minestom/codegen/blocks/BlockEnumGenerator.java index 7a875cdd8..8a16182d4 100644 --- a/src/generators/java/net/minestom/codegen/blocks/BlockEnumGenerator.java +++ b/src/generators/java/net/minestom/codegen/blocks/BlockEnumGenerator.java @@ -111,7 +111,8 @@ public class BlockEnumGenerator extends MinestomEnumGenerator { if (data.name.equals(NamespaceID.from("minecraft:water")) || data.name.equals(NamespaceID.from("minecraft:lava"))) { block.setLiquid(); } - if (data.name.equals(NamespaceID.from("minecraft:air"))) { + boolean isAir = data.name.equals(NamespaceID.from("minecraft:air")) || data.name.getPath().endsWith("_air"); + if (isAir) { block.setAir(); }