blob: af9205f7eaf140402a4a5640c625a223bf4d6f2a (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
package net.ess3.settings.antibuild;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import lombok.*;
import net.ess3.storage.Comment;
import net.ess3.storage.ListType;
import net.ess3.storage.StorageObject;
import org.bukkit.Material;
@Data
@EqualsAndHashCode(callSuper = false)
public class BlackList implements StorageObject
{
@Comment(
{
"Which blocks should people be prevented from placing"
})
@ListType(Material.class)
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private Set<Material> placement = new HashSet<Material>();
@Comment(
{
"Which items should people be prevented from using"
})
@ListType(Material.class)
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private Set<Material> usage = new HashSet<Material>();
@Comment(
{
"Which blocks should people be prevented from breaking"
})
@ListType(Material.class)
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private Set<Material> breaking = new HashSet<Material>();
@Comment(
{
"Which blocks should not be pushed by pistons"
})
@ListType(Material.class)
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private Set<Material> piston = new HashSet<Material>();
public void setupDefaults()
{
Material[] mat = {
Material.LAVA, Material.STATIONARY_LAVA, Material.TNT, Material.LAVA_BUCKET
};
placement.addAll(Arrays.asList(mat));
}
public boolean getPlacement(Material mat)
{
if (placement == null)
{
return false;
}
return placement.contains(mat);
}
public boolean getUsage(Material mat)
{
if (usage == null)
{
return false;
}
return usage.contains(mat);
}
public boolean getBreaking(Material mat)
{
if (breaking == null)
{
return false;
}
return breaking.contains(mat);
}
public boolean getPiston(Material mat)
{
if (piston == null)
{
return false;
}
return piston.contains(mat);
}
}
|