From 1695d7c13839b2081446e7bc7288456e02cc290c Mon Sep 17 00:00:00 2001 From: Legitimoose Date: Wed, 28 Sep 2022 22:45:49 -0700 Subject: [PATCH] fix Jigsaw block kicking user --- .../block/entity/JigsawBlockEntity.java.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 paper-server/patches/sources/net/minecraft/world/level/block/entity/JigsawBlockEntity.java.patch diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/entity/JigsawBlockEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/entity/JigsawBlockEntity.java.patch new file mode 100644 index 0000000000..11519f80c2 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/level/block/entity/JigsawBlockEntity.java.patch @@ -0,0 +1,16 @@ +--- a/net/minecraft/world/level/block/entity/JigsawBlockEntity.java ++++ b/net/minecraft/world/level/block/entity/JigsawBlockEntity.java +@@ -131,7 +131,12 @@ + public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) { + BlockPos blockPos = this.getBlockPos().relative(this.getBlockState().getValue(JigsawBlock.ORIENTATION).front()); + Registry registry = world.registryAccess().lookupOrThrow(Registries.TEMPLATE_POOL); +- Holder holder = registry.getOrThrow(this.pool); ++ // Paper start - Replace getHolderOrThrow with a null check ++ Holder holder = registry.get(this.pool).orElse(null); ++ if (holder == null) { ++ return; ++ } ++ // Paper end - Replace getHolderOrThrow with a null check + JigsawPlacement.generateJigsaw(world, holder, this.target, maxDepth, blockPos, keepJigsaws); + } +