mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
[trunk] Renamed infinite to unlimited
Please change your permissions and config if you have used this. New Command: /unlimited [item] <player> Allows a player to enable unlimited placing for one item. Can be used on other players. The permission essentials.unlimited.placing still enables it for all items. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1110 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
51f0955c88
commit
bc243cb7df
@ -708,13 +708,15 @@ public class User extends PlayerExtension implements Comparable<User>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void setUnlimited(ItemStack stack, boolean b) {
|
public void setUnlimited(ItemStack stack, boolean state) {
|
||||||
List<Integer> items = new ArrayList<Integer>();
|
List<Integer> items = new ArrayList<Integer>();
|
||||||
if (data.containsKey("unlimited")) {
|
if (data.containsKey("unlimited")) {
|
||||||
items = (List<Integer>)data.get("unlimited");
|
items = (List<Integer>)data.get("unlimited");
|
||||||
}
|
}
|
||||||
items.remove(stack.getTypeId());
|
if (items.contains(stack.getTypeId())) {
|
||||||
if (b) {
|
items.remove(Integer.valueOf(stack.getTypeId()));
|
||||||
|
}
|
||||||
|
if (state) {
|
||||||
items.add(stack.getTypeId());
|
items.add(stack.getTypeId());
|
||||||
}
|
}
|
||||||
data.put("unlimited", items);
|
data.put("unlimited", items);
|
||||||
|
Loading…
Reference in New Issue
Block a user