mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
SPIGOT-7856, #1483: End platform not dropping items after replacing blocks
By: Miles Holder <mwholder@proton.me>
This commit is contained in:
parent
2c7ce2505b
commit
08fdfd6434
1 changed files with 14 additions and 11 deletions
|
@ -27,7 +27,7 @@
|
|||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
||||
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
@@ -29,16 +42,33 @@
|
||||
@@ -29,16 +42,36 @@
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i);
|
||||
Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
|
||||
|
||||
|
@ -47,19 +47,22 @@
|
|||
}
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ if (entity == null) {
|
||||
+ // SPIGOT-7746: Entity will only be null during world generation, which is async, so just generate without event
|
||||
+ blockList.updateList();
|
||||
+ return;
|
||||
+ // SPIGOT-7746: Entity will only be null during world generation, which is async, so just generate without event
|
||||
+ if (entity != null) {
|
||||
+ org.bukkit.World bworld = worldaccess.getLevel().getWorld();
|
||||
+ PortalCreateEvent portalEvent = new PortalCreateEvent((List<BlockState>) (List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
|
||||
+
|
||||
+ worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent);
|
||||
+ if (portalEvent.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ org.bukkit.World bworld = worldaccess.getLevel().getWorld();
|
||||
+ PortalCreateEvent portalEvent = new PortalCreateEvent((List<BlockState>) (List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
|
||||
+
|
||||
+ worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent);
|
||||
+ if (!portalEvent.isCancelled()) {
|
||||
+ blockList.updateList();
|
||||
+ // SPIGOT-7856: End platform not dropping items after replacing blocks
|
||||
+ if (flag) {
|
||||
+ blockList.getList().forEach((state) -> worldaccess.destroyBlock(state.getPosition(), true, null));
|
||||
+ }
|
||||
+ blockList.updateList();
|
||||
+ // CraftBukkit end
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue