diff options
author | Nassim Jahnke <[email protected]> | 2022-03-13 08:47:54 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-13 08:47:54 +0100 |
commit | 1358d1e9146ca80d0ff84a644c7796d20b39765c (patch) | |
tree | b387981c9a67bfad7e649813c1f1ea30fecfb4d9 /patches/server/0841-Reset-placed-block-on-exception.patch | |
parent | ab03538fa1af67a941ad0a9de75d367f13046c8d (diff) | |
download | Paper-1358d1e9146ca80d0ff84a644c7796d20b39765c.tar.gz Paper-1358d1e9146ca80d0ff84a644c7796d20b39765c.zip |
Updated Upstream (CraftBukkit/Spigot) (#7580)
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:
881e06e5 PR-725: Add Item Unlimited Lifetime APIs
CraftBukkit Changes:
74c08312 SPIGOT-6962: Call EntityChangeBlockEvent when when FallingBlockEntity starts to fall
64db5126 SPIGOT-6959: Make /loot command ignore empty items for spawn
2d760831 Increase outdated build delay
9ed7e4fb SPIGOT-6138, SPIGOT-6415: Don't call CreatureSpawnEvent after cross-dimensional travel
fc4ad813 SPIGOT-6895: Trees grown with applyBoneMeal() don't fire the StructureGrowthEvent
59733a2e SPIGOT-6961: Actually return a copy of the ItemMeta
Spigot Changes:
ffceeae3 SPIGOT-6956: Drop unload queue patch as attempt at fixing stop issue
e19ddabd PR-1011: Add Item Unlimited Lifetime APIs
34d40b0e SPIGOT-2942: give command fires PlayerDropItemEvent, cancelling it causes Item Duplication
Diffstat (limited to 'patches/server/0841-Reset-placed-block-on-exception.patch')
-rw-r--r-- | patches/server/0841-Reset-placed-block-on-exception.patch | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/patches/server/0841-Reset-placed-block-on-exception.patch b/patches/server/0841-Reset-placed-block-on-exception.patch deleted file mode 100644 index 7666ecdfe1..0000000000 --- a/patches/server/0841-Reset-placed-block-on-exception.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke <[email protected]> -Date: Fri, 7 Jan 2022 11:45:15 +0100 -Subject: [PATCH] Reset placed block on exception - - -diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index 8175bb6331727440da2232998bdad068a1c47ae8..893d5bf448ddbccb30db0ee751c7f4a4e83634b9 100644 ---- a/src/main/java/net/minecraft/world/item/BlockItem.java -+++ b/src/main/java/net/minecraft/world/item/BlockItem.java -@@ -78,6 +78,7 @@ public class BlockItem extends Item { - if (this instanceof WaterLilyBlockItem || this instanceof SolidBucketItem) { - blockstate = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos()); - } -+ final org.bukkit.block.BlockState oldBlockstate = blockstate != null ? blockstate : org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos()); // Paper - // CraftBukkit end - - if (iblockdata == null) { -@@ -93,7 +94,19 @@ public class BlockItem extends Item { - - if (iblockdata1.is(iblockdata.getBlock())) { - iblockdata1 = this.updateBlockStateFromTag(blockposition, world, itemstack, iblockdata1); -+ // Paper start - reset block on exception -+ try { - this.updateCustomBlockEntityTag(blockposition, world, entityhuman, itemstack, iblockdata1); -+ } catch (Exception e) { -+ oldBlockstate.update(true, false); -+ if (entityhuman instanceof ServerPlayer player) { -+ org.apache.logging.log4j.LogManager.getLogger().error("Player {} tried placing invalid block", player.getScoreboardName(), e); -+ player.getBukkitEntity().kickPlayer("Packet processing error"); -+ return InteractionResult.FAIL; -+ } -+ throw e; // Rethrow exception if not placed by a player -+ } -+ // Paper end - iblockdata1.getBlock().setPlacedBy(world, blockposition, iblockdata1, entityhuman, itemstack); - // CraftBukkit start - if (blockstate != null) { |