aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRemynfv <[email protected]>2022-09-29 04:37:56 -0700
committerGitHub <[email protected]>2022-09-29 12:37:56 +0100
commit21661a7557e70908b1c4dbb815c04646ae9579af (patch)
treea38c91a1b145fbad61009d361cae93baed26408b
parent79f2aa3eed8ea50f600f83e64b65bc6c413b58b5 (diff)
downloadPaper-21661a7557e70908b1c4dbb815c04646ae9579af.tar.gz
Paper-21661a7557e70908b1c4dbb815c04646ae9579af.zip
Fix jigsaw block kicking user (#8404)
-rw-r--r--patches/server/0917-fix-Jigsaw-block-kicking-user.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0917-fix-Jigsaw-block-kicking-user.patch b/patches/server/0917-fix-Jigsaw-block-kicking-user.patch
new file mode 100644
index 0000000000..78ddb867de
--- /dev/null
+++ b/patches/server/0917-fix-Jigsaw-block-kicking-user.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Legitimoose <[email protected]>
+Date: Wed, 28 Sep 2022 22:45:49 -0700
+Subject: [PATCH] fix Jigsaw block kicking user
+
+
+diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
+index de7435f6596e200c8511224a0479c2ad499b2a97..bcf9eb1096b09748bcabba05bc9ffac494d3c611 100644
+--- a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
++++ b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
+@@ -89,7 +89,13 @@ public class StructureTemplatePool {
+ }
+
+ public StructurePoolElement getRandomTemplate(RandomSource random) {
++ //Paper start - Prevent random.nextInt throwing an IllegalArgumentException
++ if (this.templates.size() == 0) {
++ return EmptyPoolElement.INSTANCE;
++ } else {
+ return this.templates.get(random.nextInt(this.templates.size()));
++ }
++ // Paper end
+ }
+
+ public List<StructurePoolElement> getShuffledTemplates(RandomSource random) {