More 1.19.3 registry fun (#8618)

This commit is contained in:
Noah van der Aa
2022-12-08 00:49:41 +01:00
parent 0e45eeb9d2
commit d654558a4e
8 changed files with 20 additions and 19 deletions

View File

@@ -209,7 +209,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import io.papermc.paper.configuration.type.EngineMode;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Direction;
+import net.minecraft.core.Registry;
+import net.minecraft.core.registries.BuiltInRegistries;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket;
+import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
+import net.minecraft.resources.ResourceLocation;
@@ -284,7 +285,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ List<BlockState> presetBlockStateList = new LinkedList<>();
+
+ for (String id : paperWorldConfig.hiddenBlocks) {
+ Block block = Registry.BLOCK.getOptional(new ResourceLocation(id)).orElse(null);
+ Block block = BuiltInRegistries.BLOCK.getOptional(new ResourceLocation(id)).orElse(null);
+
+ if (block != null && !(block instanceof EntityBlock)) {
+ toObfuscate.add(id);
@@ -315,7 +316,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ for (String id : toObfuscate) {
+ Block block = Registry.BLOCK.getOptional(new ResourceLocation(id)).orElse(null);
+ Block block = BuiltInRegistries.BLOCK.getOptional(new ResourceLocation(id)).orElse(null);
+
+ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
+ if (block != null && !block.defaultBlockState().isAir()) {
@@ -326,7 +327,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+
+ EmptyLevelChunk emptyChunk = new EmptyLevelChunk(level, new ChunkPos(0, 0), MinecraftServer.getServer().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getHolderOrThrow(Biomes.PLAINS));
+ EmptyLevelChunk emptyChunk = new EmptyLevelChunk(level, new ChunkPos(0, 0), MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.BIOME).getHolderOrThrow(Biomes.PLAINS));
+ BlockPos zeroPos = new BlockPos(0, 0, 0);
+
+ for (int i = 0; i < solidGlobal.length; i++) {