From cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Sun, 25 Dec 2011 22:13:25 -0800 Subject: [PATCH] Implement PortalCreateEvent reason codes. Addresses BUKKIT-833 This commit modifies the construction of PortalCreateEvents to specify a reason for the event. Reasons are either: 1. FIRE: the portal is being created because a player set fire to an obsidian frame. 2. DESTINATION: the portal is being created as a destination for an existing portal. --- src/main/java/net/minecraft/server/BlockPortal.java | 2 +- src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java index e5fd92f235..7e8717d715 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java @@ -95,7 +95,7 @@ public class BlockPortal extends BlockHalfTransparant { } } - PortalCreateEvent event = new PortalCreateEvent(blocks, bworld); + PortalCreateEvent event = new PortalCreateEvent(blocks, bworld, PortalCreateEvent.CreateReason.FIRE); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java index 0e3fbda805..8abe81e148 100644 --- a/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java +++ b/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java @@ -341,7 +341,7 @@ public class PortalTravelAgent implements TravelAgent { } } - PortalCreateEvent event = new PortalCreateEvent(blocks, (org.bukkit.World) craftWorld); + PortalCreateEvent event = new PortalCreateEvent(blocks, (org.bukkit.World) craftWorld, PortalCreateEvent.CreateReason.OBC_DESTINATION); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return false;