use of net.minecraft.server.v1_16_R2.EntityPlayer in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_16_R3 method openPage.
@Override
public void openPage(Player player, com.bgsoftware.wildchests.objects.inventory.CraftWildInventory inventory) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
String title = inventory.getTitle();
Container container = createContainer(entityPlayer.nextContainerCounter(), entityPlayer.inventory, inventory);
container.setTitle(new ChatComponentText(title));
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), container.getTitle()));
entityPlayer.activeContainer = container;
entityPlayer.activeContainer.addSlotListener(entityPlayer);
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project CokesAddon by Cokes86.
the class v1_14_R1 method isChanged.
@Override
public boolean isChanged(Player player) {
CraftPlayer cp = (CraftPlayer) player;
boolean skin = false;
boolean nameTag = false;
Iterator<Property> iterator = cp.getProfile().getProperties().get("textures").iterator();
if (iterator.hasNext() && origin.containsKey(player.getUniqueId())) {
Property property = iterator.next();
skin = property != origin.get(player.getUniqueId()).getRight();
EntityPlayer enp = cp.getHandle();
nameTag = !origin.get(player.getUniqueId()).getLeft().equals(enp.getProfile().getName());
}
return skin || nameTag;
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project CokesAddon by Cokes86.
the class v1_15_R1 method isChanged.
@Override
public boolean isChanged(Player player) {
CraftPlayer cp = (CraftPlayer) player;
boolean skin = false;
boolean nameTag = false;
Iterator<Property> iterator = cp.getProfile().getProperties().get("textures").iterator();
if (iterator.hasNext() && origin.containsKey(player.getUniqueId())) {
Property property = iterator.next();
skin = property != origin.get(player.getUniqueId()).getRight();
EntityPlayer enp = cp.getHandle();
nameTag = !origin.get(player.getUniqueId()).getLeft().equals(enp.getProfile().getName());
}
return skin || nameTag;
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project CokesAddon by Cokes86.
the class v1_16_R3 method setPlayerNameTag.
@Override
public void setPlayerNameTag(Player p, UUID uuid) {
if (origin.containsKey(uuid)) {
try {
EntityPlayer enp = ((CraftPlayer) p).getHandle();
Object obj = enp.getClass().getMethod("getProfile", new Class[0]).invoke(enp);
Field nameField = obj.getClass().getDeclaredField("name");
nameField.setAccessible(true);
nameField.set(obj, origin.get(uuid).getLeft());
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project CokesAddon by Cokes86.
the class v1_16_R3 method isChanged.
@Override
public boolean isChanged(Player player) {
CraftPlayer cp = (CraftPlayer) player;
boolean skin = false;
boolean nameTag = false;
Iterator<Property> iterator = cp.getProfile().getProperties().get("textures").iterator();
if (iterator.hasNext() && origin.containsKey(player.getUniqueId())) {
Property property = iterator.next();
skin = property != origin.get(player.getUniqueId()).getRight();
EntityPlayer enp = cp.getHandle();
nameTag = !origin.get(player.getUniqueId()).getLeft().equals(enp.getProfile().getName());
}
return skin || nameTag;
}
Aggregations