13
0
geforkt von Mirrors/Paper
Paper/patches/unapplied/server/0660-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch

20 Zeilen
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 7 Sep 2021 21:29:38 +0100
Subject: [PATCH] Fix CocaoDecorator causing a crash when trying to generate
without logs
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
index 05a874404daec8d7194e0d5bc8d17f76d3cc94ef..961a772eecb759c8c2a2e1461988fdb3f06dd1b0 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
@@ -26,6 +26,7 @@ public class CocoaDecorator extends TreeDecorator {
@Override
2022-06-08 13:44:30 +02:00
public void place(TreeDecorator.Context generator) {
+ if (generator.logs().isEmpty()) return; // Paper - Fix crash when trying to generate without logs
2022-06-08 13:44:30 +02:00
RandomSource randomSource = generator.random();
if (!(randomSource.nextFloat() >= this.probability)) {
List<BlockPos> list = generator.logs();