diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 3e4f2a8..94db3a8 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 7c7cb0e..2d8ec0c 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -7,6 +7,7 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.DyeColor; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.command.CommandSender; @@ -85,6 +86,7 @@ public class GenericFunctions { if (p!=null && break_count==0) { p.sendMessage(ChatColor.GOLD+"WARNING!"+ChatColor.GREEN+ " Your "+ChatColor.YELLOW+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.WHITE+" is going to break soon! You should let it recharge by waiting 24 hours!"); } + p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); return breakObscureHardenedItem(item); } else { lore.set(i, ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+(break_count-1)); @@ -101,10 +103,12 @@ public class GenericFunctions { if (p!=null && break_count==0) { p.sendMessage(ChatColor.GOLD+"WARNING!"+ChatColor.GREEN+ " Your "+ChatColor.YELLOW+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.WHITE+" is going to break soon!"); } + p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); return item; //By setting the amount to 1, you refresh the item in the player's inventory. } else { //This item is technically destroyed. + p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); return new ItemStack(Material.AIR); } } diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index bb376ad..e0b06f9 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -2578,6 +2578,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } },15); } + } else { + if (ev.getItemDrop().getItemStack().getType().toString().contains("SWORD") && + ev.getPlayer().isSneaking()) { + ev.setCancelled(true); + } } } @@ -4306,6 +4311,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { GenericFunctions.breakHardenedItem(item,p); } else { + p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.DARK_RED+" has broken!"); } @@ -4636,7 +4642,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ev.setCancelled(true); } else if (armor.getType().toString().contains("SHIELD") && - p.getInventory().getExtraContents()[0]==null) { + p.getInventory().getExtraContents()[0]==null && + !GenericFunctions.isStriker(p)) { p.getInventory().setExtraContents(new ItemStack[]{armor}); p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack()))); p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);