mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
SPIGOT-7746: Server Crashing when Players Getting into End Portals
By: md_5 <git@md-5.net>
This commit is contained in:
parent
8a61d81e90
commit
df2a17df77
1 changed files with 8 additions and 2 deletions
|
@ -27,7 +27,7 @@
|
|||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
||||
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
@@ -29,16 +42,27 @@
|
||||
@@ -29,16 +42,33 @@
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i);
|
||||
Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
|
||||
|
||||
|
@ -47,8 +47,14 @@
|
|||
}
|
||||
}
|
||||
+ // 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;
|
||||
+ }
|
||||
+
|
||||
+ org.bukkit.World bworld = worldaccess.getLevel().getWorld();
|
||||
+ PortalCreateEvent portalEvent = new PortalCreateEvent((List<BlockState>) (List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
|
||||
+ 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()) {
|
||||
|
|
Loading…
Reference in a new issue