Files
Purpur/patches/server/0226-Fix-Important-Issue-Crash-with-Plugin-or-Datapack-Ge.patch
Encode42 d5d756bc32 Updated Upstream (Paper & Airplane)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c1b4899 Fix dupe uuid check on entity add (#6735)
PaperMC/Paper@3f043f7 Async catch modifications to critical entity state
PaperMC/Paper@bc43f40 Update jline and TCA (#6829)
PaperMC/Paper@d9e2817 Update paperweight to 1.1.13 (#6866)
PaperMC/Paper@3e310e0 Remove redundant and unneeded repos, reorder repos (#6867)
PaperMC/Paper@485d15f Update paperweight to 1.1.14 (#6868)
PaperMC/Paper@09d50a9 Added missing mappings (#6810)
PaperMC/Paper@0968cdd Move async catches back to where they were (#6869)
PaperMC/Paper@6f71b7c Deduplicate strings in ObfHelper (#6841)
PaperMC/Paper@ada930b Updated Upstream (Bukkit/CraftBukkit) (#6872)
PaperMC/Paper@06d82e0 Cache palette array (#6767)
PaperMC/Paper@70fe58d Expose the potential player cause of a lightning (#6782)
PaperMC/Paper@c20c9d3 Fix CraftNamespacedKey shenanigans (#6825)
PaperMC/Paper@29bb5a9 Add PlayerDeathEvent#getPlayer for clarity (#6859)
PaperMC/Paper@124d079 Fix issues with mob conversion (#6831)
PaperMC/Paper@22b0238 Add API for checking if a zombie has the option to break doors (#6855)
PaperMC/Paper@5af80b0 Add isCollidable methods to various places (#6870)
PaperMC/Paper@32ba088 Fix setPatternColor on tropical fish bucket meta (#6877)
PaperMC/Paper@87121ce Move `getTrackedPlayers` up from Player to Entity (#6569)
PaperMC/Paper@a923e33 Make despawn distance configs per-category, improve per category spawn limit config (#6717)
PaperMC/Paper@3f17694 Goat ram API (#6336)
PaperMC/Paper@cc2ecbc Add Raw Byte Entity Serialization (#6826)

Airplane Changes:
TECHNOVE/Airplane@e47949b Ty Penple <3
TECHNOVE/Airplane@86fee6b Update upstream
2021-11-11 02:03:29 -05:00

47 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
Date: Tue, 20 Jul 2021 02:18:23 +0200
Subject: [PATCH] Fix Important Issue Crash with Plugin or Datapack Generation
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/DecoratedFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/DecoratedFeature.java
index ae11f1ecf23b38b84ab09f66796d1509a21bfbd8..0a4a0a3d81753a7dea6a6483f601254928c697fb 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/DecoratedFeature.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/DecoratedFeature.java
@@ -24,12 +24,16 @@ public class DecoratedFeature extends Feature<DecoratedFeatureConfiguration> {
Random random = context.random();
BlockPos blockPos = context.origin();
ConfiguredFeature<?, ?> configuredFeature = decoratedFeatureConfiguration.feature.get();
- decoratedFeatureConfiguration.decorator.getPositions(new DecorationContext(worldGenLevel, chunkGenerator), random, blockPos).forEach((blockPosx) -> {
- if (configuredFeature.place(worldGenLevel, chunkGenerator, random, blockPosx)) {
- mutableBoolean.setTrue();
- }
-
- });
+ // Purpur Start - Change forEach to Iterator for check with try catch error with caves 1.18
+ java.util.Iterator<BlockPos> blockPosIterator = decoratedFeatureConfiguration.decorator.getPositions(new DecorationContext(worldGenLevel, chunkGenerator), random, blockPos).iterator();
+ while (blockPosIterator.hasNext()) {
+ try {
+ if (configuredFeature.place(worldGenLevel, chunkGenerator, random, blockPosIterator.next())) {
+ mutableBoolean.setTrue();
+ }
+ } catch (Exception ignored) {} // No need set false (Exception Possible : NullPointerException and RuntimeException
+ }
+ // Purpur End
return mutableBoolean.isTrue();
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/TreeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/TreeFeature.java
index 0be9ce0734e3ba72893a7349bb9f83a94f4af30c..f1a04ef36ee5e898529e99d98905b74607a16177 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/TreeFeature.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/TreeFeature.java
@@ -147,7 +147,7 @@ public class TreeFeature extends Feature<TreeConfiguration> {
worldGenLevel.setBlock(pos, state, 19);
};
boolean bl = this.doPlace(worldGenLevel, random, blockPos, biConsumer, biConsumer2, treeConfiguration);
- if (bl && (!set.isEmpty() || !set2.isEmpty())) {
+ if (bl && !set.isEmpty() && !set2.isEmpty()) { // Purpur - Fix Paper#6068
if (!treeConfiguration.decorators.isEmpty()) {
List<BlockPos> list = Lists.newArrayList(set);
List<BlockPos> list2 = Lists.newArrayList(set2);