Added F Notifcations Command (Allows Players To Disable Notifications From Land Claiming)
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
/**
|
||||
* @author Saser
|
||||
*/
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ItemUtil {
|
||||
private static Map<String, ItemStack> cachedSkulls = new HashMap<>();
|
||||
|
||||
public ItemUtil() {
|
||||
}
|
||||
|
||||
public static int getItemCount(Inventory inventory) {
|
||||
if (inventory == null) {
|
||||
return 0;
|
||||
} else {
|
||||
int itemsFound = 0;
|
||||
|
||||
for (int i = 0; i < inventory.getSize(); ++i) {
|
||||
ItemStack item = inventory.getItem(i);
|
||||
if (item != null && item.getType() != Material.AIR) {
|
||||
++itemsFound;
|
||||
}
|
||||
}
|
||||
|
||||
return itemsFound;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack createPlayerHead(String name) {
|
||||
ItemStack skull = cachedSkulls.get(name);
|
||||
if (skull != null) {
|
||||
return skull.clone();
|
||||
} else {
|
||||
skull = new ItemStack(XMaterial.PLAYER_HEAD.parseMaterial());
|
||||
SkullMeta sm = (SkullMeta) skull.getItemMeta();
|
||||
sm.setOwner(name);
|
||||
skull.setItemMeta(sm);
|
||||
cachedSkulls.put(name, skull.clone());
|
||||
return skull;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
/**
|
||||
* Factions - Developed by FactionsUUID Team.
|
||||
*/
|
||||
public class Pair<Left, Right> {
|
||||
|
||||
private final Left left;
|
||||
private final Right right;
|
||||
private Pair(Left left, Right right) {
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public static <Left, Right> Pair<Left, Right> of(Left left, Right right) {
|
||||
return new Pair<>(left, right);
|
||||
}
|
||||
|
||||
public Left getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public Right getRight() {
|
||||
return this.right;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class RomanNumber {
|
||||
private static TreeMap<Integer, String> map;
|
||||
|
||||
static {
|
||||
(map = new TreeMap<>()).put(1000, "M");
|
||||
RomanNumber.map.put(900, "CM");
|
||||
RomanNumber.map.put(500, "D");
|
||||
RomanNumber.map.put(400, "CD");
|
||||
RomanNumber.map.put(100, "C");
|
||||
RomanNumber.map.put(90, "XC");
|
||||
RomanNumber.map.put(50, "L");
|
||||
RomanNumber.map.put(40, "XL");
|
||||
RomanNumber.map.put(10, "X");
|
||||
RomanNumber.map.put(9, "IX");
|
||||
RomanNumber.map.put(5, "V");
|
||||
RomanNumber.map.put(4, "IV");
|
||||
RomanNumber.map.put(1, "I");
|
||||
}
|
||||
|
||||
public static String toRoman(int number) {
|
||||
int l = RomanNumber.map.floorKey(number);
|
||||
if (number == l) {
|
||||
return RomanNumber.map.get(number);
|
||||
}
|
||||
return RomanNumber.map.get(l) + toRoman(number - l);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user