Item Use Fix on other Items

This commit is contained in:
Kam committed 2024-03-16 00:52:43 -04:00
1 parent d818e466d0
commit cc38f9addf
2 files changed
+15 -13

No files matched your search

@@ -42,9 +42,10 @@ public class ItemNpcWand extends Item{
public boolean onItemUse(ItemStack par1ItemStack, final EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if(par3World.isRemote)
return true;
return false;
if(ConfigMain.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(player.getGameProfile())){
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
return false;
}
else if(CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.NPC_CREATE)){
EntityCustomNpc npc = new EntityCustomNpc(par3World);
@@ -56,10 +57,11 @@ public class ItemNpcWand extends Item{
npc.setHealth(npc.getMaxHealth());
NoppesUtilServer.sendOpenGuiNoDelay(player, EnumGuiType.MainMenuDisplay,npc);
return true;
}
else
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
return true;
return false;
}
@Override