mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Remove redundant populate method and remove BLOCKS_JSON after last use
This commit is contained in:
parent
4ab26e0717
commit
4d78503b7c
2 changed files with 4 additions and 10 deletions
|
@ -118,7 +118,7 @@ public class BlockRegistries {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
CustomSkullRegistryPopulator.populate();
|
CustomSkullRegistryPopulator.populate();
|
||||||
BlockRegistryPopulator.populate();
|
BlockRegistryPopulator.registerJavaBlocks();
|
||||||
COLLISIONS = IntMappedRegistry.create(Pair.of("org.geysermc.geyser.translator.collision.CollisionRemapper", "mappings/collision.json"), CollisionRegistryLoader::new);
|
COLLISIONS = IntMappedRegistry.create(Pair.of("org.geysermc.geyser.translator.collision.CollisionRemapper", "mappings/collision.json"), CollisionRegistryLoader::new);
|
||||||
CustomBlockRegistryPopulator.registerCustomBedrockBlocks();
|
CustomBlockRegistryPopulator.registerCustomBedrockBlocks();
|
||||||
BlockRegistryPopulator.registerBedrockBlocks();
|
BlockRegistryPopulator.registerBedrockBlocks();
|
||||||
|
|
|
@ -74,14 +74,6 @@ public final class BlockRegistryPopulator {
|
||||||
*/
|
*/
|
||||||
private static JsonNode BLOCKS_JSON;
|
private static JsonNode BLOCKS_JSON;
|
||||||
|
|
||||||
public static void populate() {
|
|
||||||
registerJavaBlocks();
|
|
||||||
// CustomBlockRegistryPopulator.registerCustomBedrockBlocks() and registerBedrockBlocks() moved to BlockRegistries to ensure correct load order
|
|
||||||
|
|
||||||
// Needs to be placed somewhere at some point
|
|
||||||
//BLOCKS_JSON = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBedrockBlocks() {
|
public static void registerBedrockBlocks() {
|
||||||
BiFunction<String, NbtMapBuilder, String> emptyMapper = (bedrockIdentifier, statesBuilder) -> null;
|
BiFunction<String, NbtMapBuilder, String> emptyMapper = (bedrockIdentifier, statesBuilder) -> null;
|
||||||
ImmutableMap<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> blockMappers = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
|
ImmutableMap<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> blockMappers = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
|
||||||
|
@ -262,9 +254,11 @@ public final class BlockRegistryPopulator {
|
||||||
.customBlockStateIds(customBlockStateIds)
|
.customBlockStateIds(customBlockStateIds)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BLOCKS_JSON = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerJavaBlocks() {
|
public static void registerJavaBlocks() {
|
||||||
JsonNode blocksJson;
|
JsonNode blocksJson;
|
||||||
try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("mappings/blocks.json")) {
|
try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("mappings/blocks.json")) {
|
||||||
blocksJson = GeyserImpl.JSON_MAPPER.readTree(stream);
|
blocksJson = GeyserImpl.JSON_MAPPER.readTree(stream);
|
||||||
|
|
Loading…
Reference in a new issue