use of net.minecraft.server.v1_8_R3.WorldServer in project Citizens2 by CitizensDev.
the class NMSImpl method replaceTrackerEntry.
@Override
public void replaceTrackerEntry(Player player) {
WorldServer server = (WorldServer) NMSImpl.getHandle(player).getWorld();
EntityTrackerEntry entry = server.getTracker().trackedEntities.get(player.getEntityId());
if (entry == null)
return;
PlayerlistTrackerEntry replace = new PlayerlistTrackerEntry(entry);
server.getTracker().trackedEntities.a(player.getEntityId(), replace);
if (TRACKED_ENTITY_SET != null) {
try {
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
set.remove(entry);
set.add(replace);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
use of net.minecraft.server.v1_8_R3.WorldServer in project Citizens2 by CitizensDev.
the class EggController method createEntity.
@Override
protected Entity createEntity(Location at, NPC npc) {
WorldServer ws = ((CraftWorld) at.getWorld()).getHandle();
final EntityEggNPC handle = new EntityEggNPC(ws, npc, at.getX(), at.getY(), at.getZ());
return handle.getBukkitEntity();
}
use of net.minecraft.server.v1_8_R3.WorldServer in project Citizens2 by CitizensDev.
the class LlamaSpitController method createEntity.
@Override
protected Entity createEntity(Location at, NPC npc) {
WorldServer ws = ((CraftWorld) at.getWorld()).getHandle();
final EntityLlamaSpitNPC handle = new EntityLlamaSpitNPC(ws, npc);
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getPitch(), at.getYaw());
return handle.getBukkitEntity();
}
use of net.minecraft.server.v1_8_R3.WorldServer in project Citizens2 by CitizensDev.
the class LlamaSpitController method createEntity.
@Override
protected Entity createEntity(Location at, NPC npc) {
WorldServer ws = ((CraftWorld) at.getWorld()).getHandle();
final EntityLlamaSpitNPC handle = new EntityLlamaSpitNPC(ws, npc);
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getPitch(), at.getYaw());
return handle.getBukkitEntity();
}
use of net.minecraft.server.v1_8_R3.WorldServer in project MyPet by xXKeyleXx.
the class EntityMyEnderDragon method onLivingUpdate.
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (Configuration.MyPet.EnderDragon.CAN_GLIDE) {
if (!this.onGround && this.getMot().y < 0.0D) {
this.setMot(getMot().d(1, 0.6D, 1));
}
}
if (!registered && this.valid) {
if (this.getWorld() instanceof WorldServer) {
WorldServer world = (WorldServer) this.getWorld();
Arrays.stream(this.children).forEach(entityMyPetPart -> world.entitiesById.put(entityMyPetPart.getId(), entityMyPetPart));
}
this.registered = true;
}
}
Aggregations