SPIGOT-4966: Provide access to Entity in PortalCreateEvent

This commit is contained in:
md_5 2019-05-21 12:08:19 +10:00
parent 49e15b4d9a
commit 0e4ca96e47
3 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@
+ }
+ }
+
+ PortalCreateEvent event = new PortalCreateEvent(blocks, bworld, PortalCreateEvent.CreateReason.FIRE);
+ PortalCreateEvent event = new PortalCreateEvent(blocks, bworld, null, PortalCreateEvent.CreateReason.FIRE);
+ this.a.getMinecraftWorld().getMinecraftServer().server.getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {

View file

@ -454,7 +454,7 @@
+ // CraftBukkit start
+ org.bukkit.World bworld = worldserver1.getWorld();
+ org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List<org.bukkit.block.BlockState>) (List) blockList.getList(), bworld, org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
+ org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List<org.bukkit.block.BlockState>) (List) blockList.getList(), bworld, this.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
+
+ this.world.getServer().getPluginManager().callEvent(portalEvent);
+ if (!portalEvent.isCancelled()) {

View file

@ -37,7 +37,7 @@
+ // CraftBukkit start
+ org.bukkit.World bworld = this.world.getWorld();
+ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List<org.bukkit.block.BlockState>) (java.util.List) blockList.getList(), bworld, org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR);
+ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List<org.bukkit.block.BlockState>) (java.util.List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR);
+
+ this.world.getServer().getPluginManager().callEvent(event);
+ if (!event.isCancelled()) {