@EventHandler
public void onCraft(CraftItemEvent e)
{
Player p = (Player) e.getWhoClicked();
if(e.getRecipe() instanceof ShapedRecipe)
{
ShapedRecipe sr = (ShapedRecipe) e.getRecipe();
if(Bukkit.getBukkitVersion().contains("1.11"))
{
for(BagBase bb : Util.getBags())
{
if(((ShapedRecipe)bb.getRecipe()).getShape().equals(sr.getShape()))
{
if(!hasPermission(new Permission("bag.craft." + bb.getName(), PermissionDefault.TRUE), p))
e.setCancelled(true);
}
}
}
else
if(sr.getKey().getNamespace().startsWith("bag_"))
{
if(!hasPermission(new Permission("bag.craft." + sr.getKey().getKey(), PermissionDefault.TRUE), p))
e.setCancelled(true);
}
}
}
CraftListener.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:Bags2
作者:
评论列表
文章目录