Bukkit-API
1.7.9-R0.2
The inofficial Bukkit-API
Main Page
Related Pages
Packages
Classes
Files
File List
PortalCreateEvent.java
1
package
org.bukkit.event.world;
2
3
import
org
.
bukkit
.
block
.
Block
;
4
import
org
.
bukkit
.
World
;
5
import
org
.
bukkit
.
event
.
Cancellable
;
6
import
org
.
bukkit
.
event
.
HandlerList
;
7
8
import
java.util.ArrayList;
9
import
java.util.Collection;
10
11
/**
12
* Called when a portal is created
13
*/
14
public
class
PortalCreateEvent
extends
WorldEvent
implements
Cancellable
{
15
private
static
final
HandlerList
handlers =
new
HandlerList
();
16
private
boolean
cancel =
false
;
17
private
final
ArrayList<Block> blocks =
new
ArrayList<Block>();
18
private
CreateReason
reason =
CreateReason
.
FIRE
;
19
20
public
PortalCreateEvent
(
final
Collection<Block> blocks,
final
World
world,
CreateReason
reason) {
21
super(world);
22
23
this.blocks.addAll(blocks);
24
this.reason = reason;
25
}
26
27
/**
28
* Gets an array list of all the blocks associated with the created portal
29
*
30
* @return array list of all the blocks associated with the created portal
31
*/
32
public
ArrayList<Block>
getBlocks
() {
33
return
this.blocks;
34
}
35
36
public
boolean
isCancelled
() {
37
return
cancel;
38
}
39
40
public
void
setCancelled
(
boolean
cancel) {
41
this.cancel = cancel;
42
}
43
44
/**
45
* Gets the reason for the portal's creation
46
*
47
* @return CreateReason for the portal's creation
48
*/
49
public
CreateReason
getReason
() {
50
return
reason;
51
}
52
53
@Override
54
public
HandlerList
getHandlers() {
55
return
handlers;
56
}
57
58
public
static
HandlerList
getHandlerList() {
59
return
handlers;
60
}
61
62
/**
63
* An enum to specify the various reasons for a portal's creation
64
*/
65
public
enum
CreateReason
{
66
/**
67
* When a portal is created 'traditionally' due to a portal frame
68
* being set on fire.
69
*/
70
FIRE
,
71
/**
72
* When a portal is created as a destination for an existing portal
73
* when using the custom PortalTravelAgent
74
*/
75
OBC_DESTINATION
76
}
77
}
org.bukkit.event.world.WorldEvent
Definition:
WorldEvent.java:9
org.bukkit.block
Definition:
Beacon.java:1
org.bukkit.event.world.PortalCreateEvent.CreateReason
Definition:
PortalCreateEvent.java:65
org
org.bukkit.event.world.PortalCreateEvent.isCancelled
boolean isCancelled()
Definition:
PortalCreateEvent.java:36
org.bukkit.event.world.PortalCreateEvent.setCancelled
void setCancelled(boolean cancel)
Definition:
PortalCreateEvent.java:40
org.bukkit.event.Cancellable
Definition:
Cancellable.java:3
org.bukkit.World
Definition:
World.java:23
org.bukkit.event.world.PortalCreateEvent.CreateReason.FIRE
FIRE
Definition:
PortalCreateEvent.java:70
org.bukkit.event.world.PortalCreateEvent.getReason
CreateReason getReason()
Definition:
PortalCreateEvent.java:49
org.bukkit.event.HandlerList
Definition:
HandlerList.java:12
org.bukkit.event
org.bukkit
Definition:
Achievement.java:1
org.bukkit.event.world.PortalCreateEvent
Definition:
PortalCreateEvent.java:14
org.bukkit.event.world.PortalCreateEvent.getBlocks
ArrayList< Block > getBlocks()
Definition:
PortalCreateEvent.java:32
org.bukkit.block.Block
Definition:
Block.java:18