geforkt von Mirrors/Paper
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9590b610 SPIGOT-6749: Library Loader does not correctly isolate dependencies CraftBukkit Changes: 11c9299f #940: Fixed a NPE during CraftBlockEntityState#update. 960f3109 #937: Fixes related to unplaced BlockStates and the recent world generation changes. 4faf479e SPIGOT-6754: We ignore any still present TileEntity now when we create a BlockState for a block of type AIR. a72d5404 SPIGOT-6754: Temporarily restore previous behaviour for tile entities with removed blocks Spigot Changes: dc75aca8 Remove redundant 'Log null TileEntity Owner' patch
Dieser Commit ist enthalten in:
Ursprung
871bc4e895
Commit
26639f1397
@ -43,12 +43,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public InventoryHolder getOwner(boolean useSnapshot) {
|
||||
+ // Paper end
|
||||
if (this.level == null) return null;
|
||||
// Spigot start
|
||||
org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
|
||||
return null;
|
||||
}
|
||||
// Spigot end
|
||||
if (block.getType() == org.bukkit.Material.AIR) return null;
|
||||
- org.bukkit.block.BlockState state = block.getState();
|
||||
+ org.bukkit.block.BlockState state = block.getState(useSnapshot); // Paper
|
||||
if (state instanceof InventoryHolder) return (InventoryHolder) state;
|
||||
|
@ -9,11 +9,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBeehive extends CraftBlockEntityState<BeehiveBlockEntity> impl
|
||||
|
||||
@Override
|
||||
public List<Bee> releaseEntities() {
|
||||
- Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't release entities during world generation");
|
||||
|
||||
List<Bee> bees = new ArrayList<>();
|
||||
|
||||
if (isPlaced()) {
|
||||
@ -21,37 +16,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
BeehiveBlockEntity beehive = ((BeehiveBlockEntity) this.getTileEntityFromWorld());
|
||||
for (Entity bee : beehive.releaseBees(this.getHandle(), BeeReleaseStatus.BEE_RELEASED, true)) {
|
||||
bees.add((Bee) bee.getBukkitEntity());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlockState implements BlockState {
|
||||
|
||||
public LevelAccessor getWorldHandle() {
|
||||
if (this.weakWorld == null) {
|
||||
+ requirePlaced(); // Paper
|
||||
return this.world.getHandle();
|
||||
}
|
||||
|
||||
LevelAccessor access = this.weakWorld.get();
|
||||
if (access == null) {
|
||||
this.weakWorld = null;
|
||||
+ requirePlaced(); // Paper
|
||||
return this.world.getHandle();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
|
||||
@@ -0,0 +0,0 @@ public class CraftChest extends CraftLootable<ChestBlockEntity> implements Chest
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
- Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't get inventory during world generation, use getBlockInventory() instead");
|
||||
|
||||
CraftInventory inventory = (CraftInventory) this.getBlockInventory();
|
||||
if (!isPlaced()) {
|
||||
if (!isPlaced() || isWorldGeneration()) {
|
||||
return inventory;
|
||||
}
|
||||
+ Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't get inventory during world generation, use getBlockInventory() instead"); // Paper - move after placed check
|
||||
|
@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Tue, 12 Oct 2021 13:32:52 -0700
|
||||
Subject: [PATCH] Null check isApplicable for CraftBlockEntityState#update
|
||||
|
||||
If the update call removed the TE, then isApplicable would
|
||||
have NPE'd.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft
|
||||
}
|
||||
|
||||
protected boolean isApplicable(BlockEntity tileEntity) {
|
||||
- return this.tileEntity.getClass() == tileEntity.getClass();
|
||||
+ return tileEntity != null && this.tileEntity.getClass() == tileEntity.getClass(); // Paper - fix NPE if the TE was removed
|
||||
}
|
||||
|
||||
@Override
|
@ -1 +1 @@
|
||||
Subproject commit 6be36d3638f97e6e0dc053f3e0fd0e68e8ec93f0
|
||||
Subproject commit 9590b610cfa705b082c0593b595a7d563a89dc85
|
@ -1 +1 @@
|
||||
Subproject commit 1df303e70742418fd30760a750a9545f3dea5b9b
|
||||
Subproject commit 11c9299fbb8f559c1ba38e8f0e1695c4d33109ba
|
@ -1 +1 @@
|
||||
Subproject commit 8e907441bde900ddc564d3a5fac831287a1a8b75
|
||||
Subproject commit dc75aca85361e65679880f2abd5c92f6db448ae2
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren