diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml
index 3baa71886..6fce5b033 100644
--- a/Plugins/.idea/compiler.xml
+++ b/Plugins/.idea/compiler.xml
@@ -30,9 +30,7 @@
-
-
-
+
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilGear.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilGear.java
index a1028c25f..1f9153646 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilGear.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilGear.java
@@ -126,6 +126,10 @@ public class UtilGear
{
goldSet.add(Material.GOLD_SWORD);
goldSet.add(Material.GOLD_AXE);
+ goldSet.add(Material.GOLD_HELMET);
+ goldSet.add(Material.GOLD_CHESTPLATE);
+ goldSet.add(Material.GOLD_LEGGINGS);
+ goldSet.add(Material.GOLD_BOOTS);
}
return goldSet.contains(item.getType());
diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansAdmin.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansAdmin.java
index c327bce64..67273393c 100644
--- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansAdmin.java
+++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansAdmin.java
@@ -25,6 +25,11 @@ public class ClansAdmin
public void command(Player caller, String[] args)
{
+ if (Clans.getClientManager().hasRank(caller, Rank.ADMIN))
+ {
+ return;
+ }
+
if (args.length == 1)
help(caller);
diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java
index e8a1a0517..44b09c45e 100644
--- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java
+++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java
@@ -6,19 +6,27 @@ import java.util.TimeZone;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
+import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
+import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.event.player.PlayerItemBreakEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
+import net.minecraft.server.v1_7_R4.EnumToolMaterial;
+import net.minecraft.server.v1_7_R4.Item;
+import net.minecraft.server.v1_7_R4.ItemSword;
+
import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
@@ -35,6 +43,7 @@ import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.energy.Energy;
import mineplex.core.explosion.Explosion;
+import mineplex.core.gui.SimpleGuiItem;
import mineplex.core.movement.Movement;
import mineplex.core.npc.NpcManager;
import mineplex.core.packethandler.PacketHandler;
@@ -679,15 +688,53 @@ public class ClansManager extends MiniClientPlugin implements IRelat
_worldEvent.onDisable();
}
+// @EventHandler
+ public void itemBreak(PlayerItemBreakEvent event)
+ {
+ Bukkit.broadcastMessage("Item Break: " + event.getPlayer());
+
+ Thread.dumpStack();
+
+ }
+
+// @EventHandler
+ public void blockBreak(BlockBreakEvent event)
+ {
+ Bukkit.broadcastMessage("dur: " + event.getPlayer().getItemInHand().getDurability());
+// Item item = ((CraftItemStack) event.getPlayer().getItemInHand()).getHandle().getItem();
+ Item item = CraftMagicNumbers.getItem(Material.IRON_SWORD);
+ Class clazz = ItemSword.class;
+ try
+ {
+ java.lang.reflect.Field field = clazz.getDeclaredField("b");
+ field.setAccessible(true);
+ EnumToolMaterial material = (EnumToolMaterial) field.get(item);
+ Bukkit.broadcastMessage("Material: " + material.name());
+ Bukkit.broadcastMessage("Dur: " + material.a());
+ }
+ catch (NoSuchFieldException e)
+ {
+ e.printStackTrace();
+ }
+ catch (IllegalAccessException e)
+ {
+ e.printStackTrace();
+ }
+
+ Bukkit.broadcastMessage("name: " + item.getName() + " max dur: " + item.getMaxDurability());
+
+
+ }
+
@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerLoginEvent event)
{
Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
- if (/*!rank.Has(Rank.MAPDEV) &&*/ !event.getPlayer().isWhitelisted())
+ if (!rank.Has(Rank.MAPDEV) && !event.getPlayer().isWhitelisted())
{
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
- event.setKickMessage("This server is whitelisted!");
-// event.setKickMessage("Only Builder+ can join this server");
+// event.setKickMessage("This server is whitelisted!");
+ event.setKickMessage("Only Builder+ can join this server");
}
}
}
diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java
index 7c9ef49a8..ee4c0fabe 100644
--- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java
+++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java
@@ -49,6 +49,7 @@ import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
public class Gameplay extends MiniPlugin
@@ -522,13 +523,7 @@ public class Gameplay extends MiniPlugin
}
int repairs = ItemStackFactory.Instance.GetLoreVar(item, "Repaired", 0);
- boolean gold = UtilGear.isGold(item);
- boolean canRepair = true;
-
- if (repairs >= 3 && gold)
- canRepair = false;
- else if (repairs >= 2 && !gold)
- canRepair = false;
+ boolean canRepair = canRepair(item);
if (!canRepair)
{
@@ -566,12 +561,32 @@ public class Gameplay extends MiniPlugin
}
//Record
- ItemStackFactory.Instance.SetLoreVar(item, "Repaired", "" + repairs + 1);
+ ItemStackFactory.Instance.SetLoreVar(item, "Repaired", (repairs + 1) + "");
+ if (!canRepair(item))
+ {
+ ItemMeta meta = item.getItemMeta();
+ meta.getLore().add(ChatColor.BLUE + "Nonfixable");
+ item.setItemMeta(meta);
+ }
//Effect
player.playSound(player.getLocation(), Sound.ANVIL_USE, 1f, 1f);
}
+ private boolean canRepair(ItemStack item)
+ {
+ int repairs = ItemStackFactory.Instance.GetLoreVar(item, "Repaired", 0);
+ boolean gold = UtilGear.isGold(item);
+ boolean canRepair = true;
+
+ if (repairs >= 3 && gold)
+ canRepair = false;
+ else if (repairs >= 2 && !gold)
+ canRepair = false;
+
+ return canRepair;
+ }
+
public DamageManager getDamageManager()
{
return _damageManager;
diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java
index ee42ca500..abf34b4b8 100644
--- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java
+++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java
@@ -186,21 +186,21 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
System.out.println("Item Factory: Ignored " + newItem.GetName());
return;
}
-
- try
- {
- _itemMaxDurability.setInt(net.minecraft.server.v1_7_R4.Item.getById(newItem.GetType().getId()), 56);
- }
- catch (IllegalArgumentException e)
- {
- e.printStackTrace();
- }
- catch (IllegalAccessException e)
- {
- e.printStackTrace();
- }
-
- _items.put(newItem.GetName(), newItem);
+
+// try
+// {
+// _itemMaxDurability.setInt(net.minecraft.server.v1_7_R4.Item.getById(newItem.GetType().getId()), 56);
+// }
+// catch (IllegalArgumentException e)
+// {
+// e.printStackTrace();
+// }
+// catch (IllegalAccessException e)
+// {
+// e.printStackTrace();
+// }
+
+ _items.put(newItem.GetName(), newItem);
}
public BlockRestore BlockRestore()
diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java
index b35f4b59e..04ad1d889 100644
--- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java
+++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java
@@ -2,9 +2,11 @@ package mineplex.minecraft.game.core.condition;
import org.bukkit.Bukkit;
import org.bukkit.Material;
+import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
+import net.minecraft.server.v1_7_R4.MobEffect;
public class Condition
{
@@ -124,14 +126,23 @@ public class Condition
{
PotionEffectType type = PotionEffectType.getByName(_type.toString());
- //Remove
- _ent.removePotionEffect(type);
+ boolean remove = false;
+ for (PotionEffect effect : _ent.getActivePotionEffects())
+ {
+ if (effect.getType() == type && effect.getAmplifier() != _mult)
+ remove = true;
+ }
+
+ // Remove
+ if (remove)
+ _ent.removePotionEffect(type);
//Add
+ PotionEffect effect = new PotionEffect(type, _ticks, _mult, _ambient);
if (_ticks == -1)
_ent.addPotionEffect(new PotionEffect(type, 72000, _mult, _ambient), true);
else
- _ent.addPotionEffect(new PotionEffect(type, _ticks, _mult, _ambient), true);
+ ((CraftLivingEntity) _ent).getHandle().addEffect(new MobEffect(effect.getType().getId(), effect.getDuration(), effect.getAmplifier(), effect.isAmbient()));
}
catch (Exception e)
{