mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
fix Jigsaw block kicking user
This commit is contained in:
parent
084e7e62ad
commit
1695d7c138
1 changed files with 16 additions and 0 deletions
|
@ -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<StructureTemplatePool> registry = world.registryAccess().lookupOrThrow(Registries.TEMPLATE_POOL);
|
||||
- Holder<StructureTemplatePool> holder = registry.getOrThrow(this.pool);
|
||||
+ // Paper start - Replace getHolderOrThrow with a null check
|
||||
+ Holder<StructureTemplatePool> 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);
|
||||
}
|
||||
|
Loading…
Reference in a new issue