use of org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer in project Denizen-For-Bukkit by DenizenScript.
the class Handler_v1_10_R1 method getPlayerProfile.
@Override
public PlayerProfile getPlayerProfile(Player player) {
GameProfile gameProfile = ((CraftPlayer) player).getProfile();
Property property = Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
return new PlayerProfile(gameProfile.getName(), gameProfile.getId(), property != null ? property.getValue() : null, property != null ? property.getSignature() : null);
}
use of org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_10_R1 method forceInteraction.
/*
General Entity Methods
*/
@Override
public void forceInteraction(Player player, Location location) {
CraftPlayer craftPlayer = (CraftPlayer) player;
BlockPosition pos = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
Block.getById(location.getBlock().getType().getId()).interact(((CraftWorld) location.getWorld()).getHandle(), pos, ((CraftWorld) location.getWorld()).getHandle().getType(pos), craftPlayer != null ? craftPlayer.getHandle() : null, EnumHand.MAIN_HAND, null, EnumDirection.NORTH, 0f, 0f, 0f);
}
use of org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_10_R1 method unhideEntity.
@Override
public void unhideEntity(Player player, Entity entity) {
// Use Bukkit API for Player entities
if (entity instanceof Player) {
player.showPlayer((Player) entity);
return;
}
CraftPlayer craftPlayer = (CraftPlayer) player;
EntityPlayer entityPlayer = craftPlayer.getHandle();
UUID playerUUID = player.getUniqueId();
if (entityPlayer.playerConnection != null && !craftPlayer.equals(entity) && hiddenEntities.containsKey(playerUUID)) {
Set hidden = hiddenEntities.get(playerUUID);
UUID entityUUID = entity.getUniqueId();
if (hidden.contains(entityUUID)) {
hidden.remove(entityUUID);
EntityTracker tracker = ((WorldServer) craftPlayer.getHandle().world).tracker;
net.minecraft.server.v1_10_R1.Entity other = ((CraftEntity) entity).getHandle();
EntityTrackerEntry entry = tracker.trackedEntities.get(other.getId());
if (entry != null && !entry.trackedPlayers.contains(entityPlayer)) {
entry.updatePlayer(entityPlayer);
}
}
}
}
use of org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_9_R2 method forceInteraction.
/*
General Entity Methods
*/
@Override
public void forceInteraction(Player player, Location location) {
CraftPlayer craftPlayer = (CraftPlayer) player;
BlockPosition pos = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
Block.getById(location.getBlock().getType().getId()).interact(((CraftWorld) location.getWorld()).getHandle(), pos, ((CraftWorld) location.getWorld()).getHandle().getType(pos), craftPlayer != null ? craftPlayer.getHandle() : null, EnumHand.MAIN_HAND, null, EnumDirection.NORTH, 0f, 0f, 0f);
}
use of org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelper_v1_9_R2 method unhideEntity.
@Override
public void unhideEntity(Player player, Entity entity) {
// Use Bukkit API for Player entities
if (entity instanceof Player) {
player.showPlayer((Player) entity);
return;
}
CraftPlayer craftPlayer = (CraftPlayer) player;
EntityPlayer entityPlayer = craftPlayer.getHandle();
UUID playerUUID = player.getUniqueId();
if (entityPlayer.playerConnection != null && !craftPlayer.equals(entity) && hiddenEntities.containsKey(playerUUID)) {
Set hidden = hiddenEntities.get(playerUUID);
UUID entityUUID = entity.getUniqueId();
if (hidden.contains(entityUUID)) {
hidden.remove(entityUUID);
EntityTracker tracker = ((WorldServer) craftPlayer.getHandle().world).tracker;
net.minecraft.server.v1_9_R2.Entity other = ((CraftEntity) entity).getHandle();
EntityTrackerEntry entry = tracker.trackedEntities.get(other.getId());
if (entry != null && !entry.trackedPlayers.contains(entityPlayer)) {
entry.updatePlayer(entityPlayer);
}
}
}
}
Aggregations