diff options
author | Sam Wilson <sam.wilson@gmail.com> | 2011-12-25 22:13:25 -0800 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-26 15:20:09 -0500 |
commit | cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f (patch) | |
tree | de48f675b50605f90b3285bc1235d72fddd9568e /src | |
parent | f2d9d4174f9e9472a84ecebb20a18ff6b1a89abb (diff) | |
download | craftbukkit-cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f.tar craftbukkit-cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f.tar.gz craftbukkit-cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f.tar.lz craftbukkit-cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f.tar.xz craftbukkit-cc2e721ffcc0e3ff642b1ffc5310d5b0b1dfa46f.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPortal.java | 2 | ||||
-rw-r--r-- | 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 e5fd92f2..7e8717d7 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 0e3fbda8..8abe81e1 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; |