make crafted weapons in SG unbreakable

This commit is contained in:
xXVevzZXx 2016-06-11 16:43:56 +02:00
parent a461e9cf1c
commit bc77605dcd

View File

@ -37,6 +37,7 @@ import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@ -1937,6 +1938,15 @@ public abstract class SurvivalGames extends Game
}
}
@EventHandler
public void craftedItems(CraftItemEvent event)
{
if (UtilItem.isWeapon(event.getCurrentItem()) || UtilItem.isArmor(event.getCurrentItem()))
{
UtilItem.makeUnbreakable(event.getCurrentItem());
}
}
@EventHandler
public void UpdateNametagVisibility(UpdateEvent event)
{