Search in sources :

Example 56 with CraftPlayer

use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project MyPet by xXKeyleXx.

the class PlatformHelper method getPlayerLanguage.

public String getPlayerLanguage(Player player) {
    if (!(player instanceof CraftPlayer)) {
        return "en_US";
    }
    EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    Object lang = ReflectionUtil.getFieldValue(EntityPlayer_locale_FIELD, entityPlayer);
    if (lang == null) {
        return "en_US";
    }
    return lang.toString();
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) JSONObject(org.json.simple.JSONObject)

Example 57 with CraftPlayer

use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_10_2 method sendColor.

public void sendColor(ParticleManager.Type type, Location loc, float speed, int count, Color color, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.valueOf(type.getName()), true, x, y, z, color.getRed(), color.getGreen(), color.getBlue(), speed, count, null);
    for (Player pl : players) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) PacketPlayOutWorldParticles(net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)

Example 58 with CraftPlayer

use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_11 method send.

public void send(ParticleManager.Type type, Location loc, float speed, int count, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.valueOf(type.getName()), true, x, y, z, 0.0F, 0.0F, 0.0F, speed, count, null);
    for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Example 59 with CraftPlayer

use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_12 method sendColor.

public void sendColor(ParticleManager.Type type, Location loc, float speed, int count, Color color, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.valueOf(type.getName()), true, x, y, z, color.getRed(), color.getGreen(), color.getBlue(), speed, count, null);
    for (Player pl : players) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)

Example 60 with CraftPlayer

use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_7_10 method send.

public void send(ParticleManager.Type type, Location loc, float speed, int count, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(type.getName(), x, y, z, 0.0F, 0.0F, 0.0F, speed, count);
    for (Player pl : players) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)76 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)32 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)26 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)26 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)23 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)19 MyPetPlayer (de.Keyle.MyPet.api.player.MyPetPlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)14 CraftPlayer (org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)14 UUID (java.util.UUID)12 PacketPlayOutTitle (net.minecraft.server.v1_12_R1.PacketPlayOutTitle)10 PacketPlayOutTitle (net.minecraft.server.v1_8_R3.PacketPlayOutTitle)10 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)10 GameProfile (com.mojang.authlib.GameProfile)8 HashSet (java.util.HashSet)8 Set (java.util.Set)8 PacketPlayOutTitle (net.minecraft.server.v1_10_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_11_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_8_R1.PacketPlayOutTitle)8