Archiviert
13
0

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.
Dieser Commit ist enthalten in:
Sam Wilson 2011-12-25 22:13:25 -08:00 committet von EvilSeph
Ursprung f2d9d4174f
Commit cc2e721ffc
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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()) {

Datei anzeigen

@ -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;