mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 21:52:05 -07:00
SPIGOT-7746: Server Crashing when Players Getting into End Portals
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
||||||
|
|
||||||
for (int i = -2; i <= 2; ++i) {
|
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);
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i);
|
||||||
Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
|
Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
|
||||||
|
|
||||||
@@ -47,8 +47,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ // CraftBukkit start
|
+ // 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();
|
+ 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);
|
+ worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent);
|
||||||
+ if (!portalEvent.isCancelled()) {
|
+ if (!portalEvent.isCancelled()) {
|
||||||
|
Reference in New Issue
Block a user