SPIGOT-7856, #1483: End platform not dropping items after replacing blocks
This commit is contained in:
parent
2a5572b52b
commit
c7d6428f28
@ -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;
|
||||
+ }
|
||||
+
|
||||
+ 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()) {
|
||||
+ blockList.updateList();
|
||||
+ if (portalEvent.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // 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…
x
Reference in New Issue
Block a user