Merge branch 'clans-beta' of ssh://184.154.0.242:7999/min/Mineplex into clans-beta

Conflicts:
	Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java
This commit is contained in:
NewGarbo 2015-11-26 07:52:35 +00:00
commit af0df835b8
6 changed files with 33 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package mineplex.game.clans.items; package mineplex.game.clans.items;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; 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.smelting.SmeltingListener;
import mineplex.game.clans.items.ui.GearShop; import mineplex.game.clans.items.ui.GearShop;
import mineplex.serverdata.serialization.RuntimeTypeAdapterFactory; 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.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat; import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot; import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot;
@ -108,6 +111,9 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
private WeightSet<Class<? extends ItemAttribute>> _armorAttributes; private WeightSet<Class<? extends ItemAttribute>> _armorAttributes;
private WeightSet<Class<? extends ItemAttribute>> _bowAttributes; private WeightSet<Class<? extends ItemAttribute>> _bowAttributes;
// Attribute Masks
private EnumSet<Material> _maskAttributes;
private GearShop _shop; private GearShop _shop;
public GearManager(JavaPlugin plugin, PacketHandler packetHandler, CoreClientManager clientManager, DonationManager donationManager) public GearManager(JavaPlugin plugin, PacketHandler packetHandler, CoreClientManager clientManager, DonationManager donationManager)
@ -183,6 +189,9 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
packetHandler.addPacketHandler(this, PacketPlayOutSetSlot.class, PacketPlayOutWindowItems.class); packetHandler.addPacketHandler(this, PacketPlayOutSetSlot.class, PacketPlayOutWindowItems.class);
plugin.getServer().getScheduler().runTaskTimer(plugin, this, 1l, 1l); 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 @Override
@ -485,10 +494,27 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
itemsPacket.b[i] = maskItem(itemsPacket.b[i]); // Mask all itemsPacket.b[i] = maskItem(itemsPacket.b[i]); // Mask all
// out-going // out-going
// item packets // 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) private net.minecraft.server.v1_8_R3.ItemStack maskItem(net.minecraft.server.v1_8_R3.ItemStack item)
{ {
// Cannot mask a null item // Cannot mask a null item

View File

@ -27,7 +27,7 @@ public class AlligatorsTooth extends LegendaryItem
public AlligatorsTooth() 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(); _swimSpeed = boostGen.generateValue();
} }

View File

@ -19,7 +19,7 @@ public class GiantsBroadsword extends LegendaryItem
public GiantsBroadsword() 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 @Override

View File

@ -22,7 +22,7 @@ public class HyperAxe extends LegendaryItem
public HyperAxe() public HyperAxe()
{ {
super("Hyper Axe", "Increased attack speed!", Material.RECORD_5); super("Hyper Axe", "Increased attack speed!", Material.RECORD_3);
_speedAmount = amountGen.generateIntValue(); _speedAmount = amountGen.generateIntValue();
_speedDuration = durationGen.generateIntValue(); _speedDuration = durationGen.generateIntValue();
_lastAttack = 0; _lastAttack = 0;

View File

@ -18,7 +18,7 @@ public class MagneticMaul extends LegendaryItem
public MagneticMaul() 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 @Override
@ -39,6 +39,7 @@ public class MagneticMaul extends LegendaryItem
} }
} }
@Override @Override
public void onAttack(CustomDamageEvent event, Player wielder) public void onAttack(CustomDamageEvent event, Player wielder)
{ {

View File

@ -30,7 +30,7 @@ public class WindBlade extends LegendaryItem
public WindBlade() 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 @Override