public static boolean denyPotion(ItemStack result, Player p){
List<String> Pots = RPConfig.getStringList("server-protection.deny-potions");
if (result != null && Pots.size() > 0 && (result.getType().name().contains("POTION") || result.getType().name().contains("TIPPED"))){
String potname = "";
if (RedProtect.get().version >= 190){
PotionMeta pot = (PotionMeta) result.getItemMeta();
potname = pot.getBasePotionData().getType().name();
}
if (RedProtect.get().version <= 180 && Potion.fromItemStack(result) != null){
potname = Potion.fromItemStack(result).getType().name();
}
if (Pots.contains(potname)){
RPLang.sendMessage(p, "playerlistener.denypotion");
return true;
}
}
return false;
}
RPUtil.java 文件源码
java
阅读 51
收藏 0
点赞 0
评论 0
项目:RedProtect
作者:
评论列表
文章目录