legendary pickkup message fix (FINALLY FIXED NOW )

This commit is contained in:
NewGarbo 2016-01-07 10:31:23 +00:00
parent d88b14d9d6
commit e9789b2ee8
3 changed files with 17 additions and 7 deletions

View File

@ -57,6 +57,10 @@ public class OutpostManager extends MiniPlugin
{
event.getBlock().setData((byte) Outpost.OUTPOST_BLOCK_DATA);
}
else
{
event.setCancelled(true);
}
}
}

View File

@ -10,6 +10,10 @@ import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.game.clans.items.legendaries.LegendaryItem;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -56,6 +60,15 @@ public class PlayerGear
LegendaryItem legendary = (LegendaryItem) item;
legendary.preUpdate(getPlayer());
legendary.update(getPlayer());
if (legendary.OriginalOwner == null)
{
legendary.OriginalOwner = getPlayer().getUniqueId().toString();
UtilServer.broadcast(F.main("Clans", F.elem(getPlayer().getName()) + " has picked up " + F.vowelAN(legendary.getDisplayName()) + " " + legendary.getDisplayName() + C.mBody + "."));
UtilTextMiddle.display(C.cPurple + "Legendary", F.elem(getPlayer().getName()) + C.cWhite + " picked up " + F.vowelAN(legendary.getDisplayName()) + " " + legendary.getDisplayName() + C.cWhite + ".");
getPlayer().setItemInHand(legendary.toItemStack());
}
}
}
}

View File

@ -63,13 +63,6 @@ public class LegendaryItem extends CustomItem
_lastBlock = System.currentTimeMillis();
}
if (OriginalOwner == null)
{
OriginalOwner = event.getPlayer().getUniqueId().toString();
UtilServer.broadcast(F.main("Clans", F.elem(event.getPlayer().getName()) + " has picked up " + F.vowelAN(getDisplayName()) + " " + getDisplayName() + C.mBody + "."));
UtilTextMiddle.display(C.cPurple + "Legendary", F.elem(event.getPlayer().getName()) + C.cWhite + " picked up " + F.vowelAN(getDisplayName()) + " " + getDisplayName() + C.cWhite + ".");
}
super.onInteract(event);
}