SPIGOT-7746: Server Crashing when Players Getting into End Portals
This commit is contained in:
parent
8d842e2509
commit
8078294bca
@ -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()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user