-
Notifications
You must be signed in to change notification settings - Fork 17
/
LWCBlockInteractEvent.java
51 lines (39 loc) · 1.2 KB
/
LWCBlockInteractEvent.java
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
51
package com.griefcraft.scripting.event;
import com.griefcraft.scripting.Module;
import com.griefcraft.scripting.ModuleLoader;
import org.bukkit.block.Block;
import org.bukkit.event.player.PlayerInteractEvent;
import java.util.List;
public class LWCBlockInteractEvent extends LWCPlayerEvent implements IResult {
private PlayerInteractEvent event;
private Block block;
private List<String> actions;
private Module.Result result = Module.Result.DEFAULT;
public LWCBlockInteractEvent(PlayerInteractEvent event, Block block, List<String> actions) {
super(ModuleLoader.Event.INTERACT_BLOCK, event.getPlayer());
this.event = event;
this.block = block;
this.actions = actions;
}
/**
* Check if the player's actions contains the action
*
* @param action
* @return
*/
public boolean hasAction(String action) {
return actions.contains(action);
}
public Block getBlock() {
return block;
}
public List<String> getActions() {
return actions;
}
public Module.Result getResult() {
return result;
}
public void setResult(Module.Result result) {
this.result = result;
}
}