Added fake skin data

+Moved hats to use fake non-changing skin data
+Added Rudolph hat
+Added Grinch hat
+Added suport for fake skins on DisguisePlayer
+Tweaked PartyPopper
This commit is contained in:
xGamingDudex 2015-12-13 23:09:25 +01:00
parent 6d1e4b6cab
commit 64fb2b11d8
13 changed files with 212 additions and 57 deletions

View File

@ -0,0 +1,84 @@
package mineplex.core.common.skin;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.minecraft.server.v1_8_R3.Item;
import net.minecraft.server.v1_8_R3.MinecraftKey;
import net.minecraft.server.v1_8_R3.NBTTagCompound;
import net.minecraft.server.v1_8_R3.NBTTagList;
import net.minecraft.server.v1_8_R3.NBTTagString;
public class SkinData
{
private static long _nameCount = -99999999999999L;
public final static SkinData MOOSHROOM = new SkinData("eyJ0aW1lc3RhbXAiOjE0NDk4NzI0OTU0MTcsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIxOWJlYTU0Y2FkN2Q1OGFiNWRhNDA2YjBhOTJhYjNhODI0MjI1MjY2Nzc3ZTUzNGI3ZGI2YzM3MmRkZmY3ZiJ9fX0=","UoSif81+UyvkcaanU8KAMYBpw9mefAmWehE2liDUFvk+y0X/9NovsxTYVpIDCltTSpLW3sNgamvbj4Ybs+s6DbudPiEkvh0ER7Bv2v29UJw7RzIdr6/1g548X12zcnh5iPGz/P75uNRnSfTFQx0ed8P/GNkPIjWpDuJFxEj6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JKQMno/Buc12C0foQw39XI8GjvlSkFN2eH4Fp16RLu8/hf7SqJQC3L1KacvzMW1d8BWEIgACCJDni29+YqxflSqSyYrV4Z+D66S0jYvUUL/vM4/q/p/YWX/vs/FtMtHQTj4PCpAmMNTgfkahuhb6rCvKHukbjA+WhUdwyxSqXU5YnpXCu1M2dzZgiXjIi+fnyn4CmXKindWCQtSwu+mCA2ILv/6vEHoYJgdlz+DXyRkFx+DH4Sl74HBCOXTOq5AGjq5h3LYfsre+UjCCUv8VgxbVprOyj35So7K0m+6faCFVSt35T3RgicDQfdiWUrW7kmHQVvJpvaq9Vu+63F/0X93cwqwaR0buMirxRx7qkFrRunSI4T+9fsN02t1fAieeu80lBSv83wr7BFneSsLsdVAND9xttTb6fClg7anr8/XVEVIkylB4B+ZcWQbH61XP1nn7oFP2VBg1h6XuuLp8FGSgYf/LW+54/KZci/MnanqQE6QQ=");
private Property _skinProperty;
public SkinData(String value, String signature)
{
_skinProperty = new Property("textures", value, signature);
}
public SkinData(GameProfile profile)
{
_skinProperty = profile.getProperties().get("textures").iterator().next();
}
public SkinData(Player player)
{
this(((CraftPlayer)player).getProfile());
}
public ItemStack getSkull()
{
NBTTagCompound arrayElement = new NBTTagCompound();
arrayElement.setString("Value", _skinProperty.getValue());
arrayElement.setString("Signature", _skinProperty.getSignature());
NBTTagList textures = new NBTTagList();
textures.add(arrayElement);
NBTTagCompound properties = new NBTTagCompound();
properties.set("textures", textures);
NBTTagCompound skullOwner = new NBTTagCompound();
skullOwner.set("Properties", properties);
skullOwner.set("Name", new NBTTagString(getUnusedSkullName()));
NBTTagCompound tag = new NBTTagCompound();
tag.set("SkullOwner", skullOwner);
net.minecraft.server.v1_8_R3.ItemStack nmsItem = new net.minecraft.server.v1_8_R3.ItemStack(Item.REGISTRY.get(new MinecraftKey("skull")), 1, 3);
nmsItem.setTag(tag);
return CraftItemStack.asBukkitCopy(nmsItem);
}
public Property getProperty()
{
return new Property(_skinProperty.getName(), _skinProperty.getValue(), _skinProperty.getSignature());
}
public static String getUnusedSkullName()
{
_nameCount++;
return "_" + _nameCount;
}
}

View File

@ -4,11 +4,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.CurrencyType;
@ -24,6 +25,7 @@ import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.HatGadget;
import mineplex.core.gadget.types.ItemGadget;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
@ -188,6 +190,35 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
return;
}
if(gadget instanceof HatGadget)
{
ItemStack item = ((HatGadget)gadget).getHelmetItem();
ItemMeta im = item.getItemMeta();
im.setDisplayName(C.cGreen + C.Bold + gadget.GetName());
if (gadget.GetActive().contains(getPlayer()))
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Disable");
im.setLore(itemLore);
item.setItemMeta(im);
addButton(slot, new ShopItem(item, false, false), new DeactivateGadgetButton(gadget, this));
}
else
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Enable");
im.setLore(itemLore);
item.setItemMeta(im);
addButton(slot, new ShopItem(item, false, false), new ActivateGadgetButton(gadget, this));
}
return;
}
//Standard
if (gadget.ownsGadget(getPlayer()))
{

View File

@ -5,8 +5,6 @@ import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
@ -15,7 +13,6 @@ import mineplex.core.cosmetic.ui.CosmeticShop;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.HatGadget;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
@ -40,14 +37,6 @@ public class HatPage extends GadgetPage
{
addGadget(gadget, slot);
ItemStack item = getItem(slot);
if(item.getType() == Material.SKULL_ITEM)
{
SkullMeta data = (SkullMeta) item.getItemMeta();
data.setOwner(((SkullMeta)((HatGadget)gadget).getHelmetItem().getItemMeta()).getOwner());
item.setItemMeta(data);
}
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget)
addGlow(slot);

View File

@ -9,35 +9,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import net.minecraft.server.v1_8_R3.Block;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.Chunk;
import net.minecraft.server.v1_8_R3.ChunkSection;
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
import net.minecraft.server.v1_8_R3.EntityPlayer;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutBed;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityStatus;
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk;
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunkBulk;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.PlayerInfoData;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityVelocity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_8_R3.PacketPlayOutUpdateAttributes;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
import net.minecraft.server.v1_8_R3.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@ -73,11 +44,39 @@ import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.disguise.disguises.DisguiseRabbit;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.packethandler.PacketVerifier;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.packethandler.PacketVerifier;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import net.minecraft.server.v1_8_R3.Block;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.Chunk;
import net.minecraft.server.v1_8_R3.ChunkSection;
import net.minecraft.server.v1_8_R3.EntityPlayer;
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
import net.minecraft.server.v1_8_R3.PacketPlayOutBed;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityStatus;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityVelocity;
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk;
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunkBulk;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.PlayerInfoData;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_8_R3.PacketPlayOutUpdateAttributes;
import net.minecraft.server.v1_8_R3.WorldServer;
public class DisguiseManager extends MiniPlugin implements IPacketHandler
{
@ -382,9 +381,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
for (Player player : players)
addViewerToDisguise(disguise, player, false);
if (disguise.GetEntity() instanceof Player && disguise instanceof DisguisePlayer)
if (disguise.GetEntity() instanceof EntityPlayer && disguise instanceof DisguisePlayer)
{
if (!((Player) disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName()))
if (!((EntityPlayer) disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName()))
{
_blockedNames.add(((Player) disguise.GetEntity()).getName());
}

View File

@ -2,29 +2,25 @@ package mineplex.core.disguise.disguises;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.skin.SkinData;
import net.minecraft.server.v1_8_R3.MathHelper;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayInSettings;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R3.WorldSettings;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import net.minecraft.server.v1_8_R3.WorldSettings;
public class DisguisePlayer extends DisguiseHuman
{
private GameProfile _profile;
private boolean _sneaking;
private BlockFace _sleeping;
private boolean _sendSkinToSelf;
public DisguisePlayer(org.bukkit.entity.Entity entity)
{
@ -46,6 +42,29 @@ public class DisguisePlayer extends DisguiseHuman
_profile = newProfile;
}
public GameProfile getProfile()
{
return _profile;
}
public void setSkinData(SkinData skin)
{
_profile.getProperties().put("textures", skin.getProperty());
}
/**
* Currently not working.
*/
public void setSendSkinDataToSelf(boolean sendToSelf)
{
_sendSkinToSelf = sendToSelf;
}
public boolean getSendSkinDataToSelf()
{
return _sendSkinToSelf;
}
public BlockFace getSleepingDirection()
{

View File

@ -205,6 +205,8 @@ public class GadgetManager extends MiniPlugin
addGadget(new HatSnowman(this));
addGadget(new HatPresent(this));
addGadget(new HatCoal(this));
addGadget(new HatRudolph(this));
addGadget(new HatGrinch(this));
// Music
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));

View File

@ -1,5 +1,6 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
@ -14,7 +15,7 @@ public class HatGrinch extends HatGadget
super(manager, "The Grinch",
UtilText.splitLineToArray(C.cGray + "Great! Now wheres the Roast Beast?!", LineFormat.LORE),
-3,
"christmasgift");
SkinData.THE_GRINCH.getSkull());
}
}

View File

@ -1,5 +1,6 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
@ -14,7 +15,7 @@ public class HatPresent extends HatGadget
super(manager, "Present",
UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE),
-3,
"christmasgift");
SkinData.PRESENT.getSkull());
}
}

View File

@ -0,0 +1,21 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
public class HatRudolph extends HatGadget
{
public HatRudolph(GadgetManager manager)
{
super(manager, "Rudolph",
UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE),
-3,
SkinData.RUDOLPH.getSkull());
}
}

View File

@ -1,5 +1,6 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
@ -14,7 +15,7 @@ public class HatSanta extends HatGadget
super(manager, "Santa",
UtilText.splitLineToArray(C.cGray + "Now you can work the Mall circuit!", LineFormat.LORE),
-3,
"Presents");
SkinData.SANTA.getSkull());
}
}

View File

@ -1,5 +1,6 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
@ -14,7 +15,7 @@ public class HatSnowman extends HatGadget
super(manager, "Snowmans Head",
UtilText.splitLineToArray(C.cGray + "Do you want to be a snowman?", LineFormat.LORE),
-3,
"snowman002");
SkinData.SNOWMAN.getSkull());
}
}

View File

@ -69,7 +69,7 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG);
}
/*
Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random()));
_items.add(ent);

View File

@ -4,8 +4,10 @@ import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.gadget.GadgetManager;
@ -19,6 +21,10 @@ public abstract class HatGadget extends OutfitGadget
{
super(manager, name, desc, cost, ArmorSlot.Helmet, item.getType(), item.getData().getData());
_hat = item;
ItemMeta im = _hat.getItemMeta();
im.setDisplayName(C.cGreen + C.Bold + name);
_hat.setItemMeta(im);
}
public HatGadget(GadgetManager manager, String name, String[] desc, int cost, String playerName)