blob: 3c71935feff3aee2b1d69a11d64b7d422cf0e182 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package org.bukkit.event.world;
import org.bukkit.block.Block;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import java.util.ArrayList;
import java.util.Collection;
/**
* Called when the world attempts to create a matching end to a portal
*/
@SuppressWarnings("serial")
public class PortalCreateEvent extends WorldEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancel = false;
private ArrayList<Block> blocks = new ArrayList<Block>();
public PortalCreateEvent(final Collection<Block> blocks, final World world) {
super(Type.PORTAL_CREATE, world);
this.blocks.addAll(blocks);
}
/**
* Gets an array list of all the blocks associated with the created portal
*
* @return array list of all the blocks associated with the created portal
*/
public ArrayList<Block> getBlocks() {
return this.blocks;
}
public boolean isCancelled() {
return cancel;
}
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
|