mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
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
This commit is contained in:
@@ -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
|
Submodule work/Bukkit updated: 6be36d3638...9590b610cf
Submodule work/CraftBukkit updated: 1df303e707...11c9299fbb
Submodule work/Spigot updated: 8e907441bd...dc75aca853
Reference in New Issue
Block a user