diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java index 29141d926..c3a3acc07 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java @@ -1,6 +1,7 @@ package mineplex.game.clans.items; import java.util.ArrayList; +import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -63,6 +64,8 @@ import mineplex.game.clans.items.legendaries.WindBlade; import mineplex.game.clans.items.smelting.SmeltingListener; import mineplex.game.clans.items.ui.GearShop; import mineplex.serverdata.serialization.RuntimeTypeAdapterFactory; + +import net.minecraft.server.v1_8_R3.NBTTagCompound; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayOutChat; import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot; @@ -107,6 +110,9 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable private WeightSet> _weaponAttributes; private WeightSet> _armorAttributes; private WeightSet> _bowAttributes; + + // Attribute Masks + private EnumSet _maskAttributes; private GearShop _shop; @@ -183,6 +189,9 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable packetHandler.addPacketHandler(this, PacketPlayOutSetSlot.class, PacketPlayOutWindowItems.class); plugin.getServer().getScheduler().runTaskTimer(plugin, this, 1l, 1l); + + _maskAttributes = EnumSet.of(Material.GOLD_RECORD, Material.GREEN_RECORD, Material.RECORD_3, Material.RECORD_4, Material.RECORD_5, Material.RECORD_6, + Material.RECORD_7, Material.RECORD_8, Material.RECORD_9, Material.RECORD_10, Material.RECORD_11, Material.RECORD_12); } @Override @@ -485,9 +494,26 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable itemsPacket.b[i] = maskItem(itemsPacket.b[i]); // Mask all // out-going // item packets + ItemStack item = CraftItemStack.asCraftMirror(itemsPacket.b[i]); + if (item != null && _maskAttributes.contains(item.getType())) + itemsPacket.b[i] = removeAttributes(itemsPacket.b[i]); } } } + + private net.minecraft.server.v1_8_R3.ItemStack removeAttributes(net.minecraft.server.v1_8_R3.ItemStack item) + { + if (item == null) return null; + + if (item.getTag() == null) + { + item.setTag(new NBTTagCompound()); + } + + item.getTag().setInt("HideFlags", 62); + + return item; + } private net.minecraft.server.v1_8_R3.ItemStack maskItem(net.minecraft.server.v1_8_R3.ItemStack item) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/AlligatorsTooth.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/AlligatorsTooth.java index f4b98eb44..8bf3b2c9e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/AlligatorsTooth.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/AlligatorsTooth.java @@ -27,7 +27,7 @@ public class AlligatorsTooth extends LegendaryItem public AlligatorsTooth() { - super("Alligators Tooth", "Grants bonus damage in water and special ability to swim fast!", Material.RECORD_3); + super("Alligators Tooth", "Grants bonus damage in water and special ability to swim fast!", Material.RECORD_4); _swimSpeed = boostGen.generateValue(); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java index 1bb6c70db..2e5d654b5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java @@ -19,7 +19,7 @@ public class GiantsBroadsword extends LegendaryItem public GiantsBroadsword() { - super("Giants Broadsword", "Deal huge damage and block to gain defensive abilities!", Material.RECORD_4); + super("Giants Broadsword", "Deal huge damage and block to gain defensive abilities!", Material.GOLD_RECORD); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java index f91394a9a..27913bfd7 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java @@ -22,7 +22,7 @@ public class HyperAxe extends LegendaryItem public HyperAxe() { - super("Hyper Axe", "Increased attack speed!", Material.RECORD_5); + super("Hyper Axe", "Increased attack speed!", Material.RECORD_3); _speedAmount = amountGen.generateIntValue(); _speedDuration = durationGen.generateIntValue(); _lastAttack = 0; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/MagneticMaul.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/MagneticMaul.java index 8ba7e7b91..a260312e0 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/MagneticMaul.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/MagneticMaul.java @@ -18,7 +18,7 @@ public class MagneticMaul extends LegendaryItem public MagneticMaul() { - super("Magnetic Maul", "Pull enemies closer with special abilities!", Material.RECORD_6); + super("Magnetic Maul", "Pull enemies closer with special abilities!", Material.RECORD_5); } @Override @@ -38,7 +38,8 @@ public class MagneticMaul extends LegendaryItem pullEntities(wielder); } } - + + @Override public void onAttack(CustomDamageEvent event, Player wielder) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java index 8ad554eb8..32c153e88 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java @@ -30,7 +30,7 @@ public class WindBlade extends LegendaryItem public WindBlade() { - super("Wind Blade", "Activate flying ability to take flight!", Material.RECORD_8); + super("Wind Blade", "Activate flying ability to take flight!", Material.Material.GREEN_RECORD); } @Override