Initial Commit
This commit is contained in:
47
src/com/fpghoti/classicswords/util/Functions.java
Normal file
47
src/com/fpghoti/classicswords/util/Functions.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.fpghoti.classicswords.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Functions {
|
||||
|
||||
public Player playerGet(String uuid){
|
||||
UUID id = UUID.fromString(uuid);
|
||||
Player p = Bukkit.getPlayer(id);
|
||||
return p;
|
||||
}
|
||||
|
||||
public static Player getEP(String playername){
|
||||
Player p = null;
|
||||
for(Player item : Bukkit.getOnlinePlayers()){
|
||||
if(playername.equalsIgnoreCase(item.getName())){
|
||||
p = item;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
public static boolean isDigit(String s){
|
||||
return s.matches("[0-9]+");
|
||||
}
|
||||
|
||||
|
||||
public static boolean isInteger(String str, int r){
|
||||
if(str.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
for(int i = 0; i < str.length(); i++){
|
||||
if((i == 0) && (str.charAt(i) == '-')){
|
||||
if(str.length() == 1) {
|
||||
return false;
|
||||
}
|
||||
}else if(Character.digit(str.charAt(i), r) < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
33
src/com/fpghoti/classicswords/util/Storage.java
Normal file
33
src/com/fpghoti/classicswords/util/Storage.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.fpghoti.classicswords.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import io.netty.util.internal.ConcurrentSet;
|
||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
||||
|
||||
public class Storage {
|
||||
public static ConcurrentHashMap<String, Boolean> bools = new ConcurrentHashMap<>();
|
||||
public static HashMap<String, NBTTagCompound> damagetag = new HashMap<>();
|
||||
public static Set<Material> instabreaks = new HashSet<>();
|
||||
public static Set<Player> inInv = new HashSet<>();
|
||||
public static ConcurrentSet<Player> blockers = new ConcurrentSet<>();
|
||||
public static ConcurrentSet<Player> swingers = new ConcurrentSet<>();
|
||||
public static ConcurrentSet<Player> bswingers = new ConcurrentSet<>();
|
||||
public static Random random = new Random();
|
||||
public static Map<UUID, Long> regens = new HashMap<>();
|
||||
public static ConcurrentHashMap<Player, Player> recent = new ConcurrentHashMap<>();
|
||||
public static ConcurrentHashMap<Player, Double> recenthealth = new ConcurrentHashMap<>();
|
||||
public static ConcurrentSet<Player> kb = new ConcurrentSet<>();
|
||||
public static ConcurrentSet<Player> great = new ConcurrentSet<>();
|
||||
public static ConcurrentSet<Player> perfect = new ConcurrentSet<>();
|
||||
}
|
||||
Reference in New Issue
Block a user