From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: ishland Date: Sun, 23 Aug 2020 10:57:44 +0200 Subject: [PATCH] Fix MC-197271 This patch only fixes an issue for servers running OpenJ9. diff --git a/src/main/java/net/minecraft/data/BuiltinRegistries.java b/src/main/java/net/minecraft/data/BuiltinRegistries.java index d64cebb4431664762a14670c7d9d782dd7894ed5..0c403ea85f7ea20f2f978e06313f8675abf204b6 100644 --- a/src/main/java/net/minecraft/data/BuiltinRegistries.java +++ b/src/main/java/net/minecraft/data/BuiltinRegistries.java @@ -48,11 +48,11 @@ public class BuiltinRegistries { public static final Registry PROCESSOR_LIST = registerSimple(Registry.PROCESSOR_LIST_REGISTRY, () -> { return ProcessorLists.b; }); - public static final Registry TEMPLATE_POOL = registerSimple(Registry.TEMPLATE_POOL_REGISTRY, Pools::bootstrap); + public static final Registry TEMPLATE_POOL = registerSimple(Registry.TEMPLATE_POOL_REGISTRY, () -> Pools.bootstrap()); // Paper - MC-197271 public static final Registry BIOME = registerSimple(Registry.BIOME_REGISTRY, () -> { return Biomes.PLAINS; }); - public static final Registry NOISE_GENERATOR_SETTINGS = registerSimple(Registry.NOISE_GENERATOR_SETTINGS_REGISTRY, NoiseGeneratorSettings::bootstrap); + public static final Registry NOISE_GENERATOR_SETTINGS = registerSimple(Registry.NOISE_GENERATOR_SETTINGS_REGISTRY, () -> NoiseGeneratorSettings.bootstrap()); // Paper - MC-197271 private static Registry registerSimple(ResourceKey> registryRef, Supplier defaultValueSupplier) { return registerSimple(registryRef, Lifecycle.stable(), defaultValueSupplier); @@ -66,9 +66,9 @@ public class BuiltinRegistries { ResourceLocation minecraftkey = registryRef.location(); BuiltinRegistries.LOADERS.put(minecraftkey, defaultValueSupplier); - WritableRegistry iregistrywritable = BuiltinRegistries.WRITABLE_REGISTRY; + WritableRegistry iregistrywritable = (WritableRegistry) BuiltinRegistries.WRITABLE_REGISTRY; // Paper - decompile fix - return (WritableRegistry) iregistrywritable.register(registryRef, (Object) registry, lifecycle); + return (R) iregistrywritable.register((ResourceKey) registryRef, registry, lifecycle); // Paper - decompile fix } public static T register(Registry registry, String id, T object) { @@ -76,11 +76,11 @@ public class BuiltinRegistries { } public static T register(Registry registry, ResourceLocation id, T object) { - return ((WritableRegistry) registry).register(ResourceKey.create(registry.key(), id), object, Lifecycle.stable()); + return (T) ((WritableRegistry) registry).register(ResourceKey.create(registry.key(), id), object, Lifecycle.stable()); // Paper - decompile fix } public static T registerMapping(Registry iregistry, int rawId, ResourceKey resourcekey, T object) { - return ((WritableRegistry) iregistry).registerMapping(rawId, resourcekey, object, Lifecycle.stable()); + return (T) ((WritableRegistry) iregistry).registerMapping(rawId, resourcekey, object, Lifecycle.stable()); // Paper - decompile fix } public static void bootstrap() {}