use of net.minecraft.server.v1_11_R1.EntityHuman in project Denizen-For-Bukkit by DenizenScript.
the class WorldHelper_v1_8_R3 method setWorldAccess.
@Override
public void setWorldAccess(World world, final WorldAccess worldAccess) {
if (worldAccessMap.containsKey(world)) {
removeWorldAccess(world);
}
IWorldAccess nmsWorldAccess = new IWorldAccess() {
@Override
public void a(BlockPosition blockPosition) {
}
@Override
public void b(BlockPosition blockPosition) {
}
@Override
public void a(int i, int i1, int i2, int i3, int i4, int i5) {
}
@Override
public void a(String s, double v, double v1, double v2, float v3, float v4) {
}
@Override
public void a(EntityHuman entityHuman, String s, double v, double v1, double v2, float v3, float v4) {
}
@Override
public void a(int i, boolean b, double v, double v1, double v2, double v3, double v4, double v5, int... ints) {
}
@Override
public void a(Entity entity) {
}
@Override
public void b(Entity entity) {
worldAccess.despawn(entity.getBukkitEntity());
}
@Override
public void a(String s, BlockPosition blockPosition) {
}
@Override
public void a(int i, BlockPosition blockPosition, int i1) {
}
@Override
public void a(EntityHuman entityHuman, int i, BlockPosition blockPosition, int i1) {
}
@Override
public void b(int i, BlockPosition blockPosition, int i1) {
}
};
worldAccessMap.put(world, nmsWorldAccess);
((CraftWorld) world).getHandle().addIWorldAccess(nmsWorldAccess);
}
use of net.minecraft.server.v1_11_R1.EntityHuman in project Village_Defense by Plajer.
the class RidableIronGolem method g.
@Override
public void g(float f, float f1) {
EntityLiving entityliving = (EntityLiving) bw();
if (entityliving == null) {
// search first human passenger
for (final Entity e : passengers) {
if (e instanceof EntityHuman) {
entityliving = (EntityLiving) e;
break;
}
}
if (entityliving == null) {
this.l((float) 0.12);
super.g(f, f1);
return;
}
}
this.lastYaw = this.yaw = entityliving.yaw;
this.pitch = entityliving.pitch * 0.5F;
this.setYawPitch(this.yaw, this.pitch);
this.aQ = this.aO = this.yaw;
f = entityliving.be * 0.75F;
f1 = entityliving.bf;
if (f1 <= 0.0f) {
f1 *= 0.25F;
}
this.l((float) 0.12);
super.g(f, f1);
P = (float) 1.0;
}
use of net.minecraft.server.v1_11_R1.EntityHuman in project Village_Defense by Plajer.
the class RidableIronGolem method a.
public void a(float f, float f1, float f2) {
EntityLiving entityliving = null;
for (final Entity e : passengers) {
if (e instanceof EntityHuman) {
entityliving = (EntityLiving) e;
break;
}
}
if (entityliving == null) {
this.P = 0.5F;
this.aR = 0.02F;
this.k((float) 0.12);
super.a(f, f1, f2);
return;
}
this.lastYaw = this.yaw = entityliving.yaw;
this.pitch = entityliving.pitch * 0.5F;
this.setYawPitch(this.yaw, this.pitch);
this.aO = this.aM = this.yaw;
f = entityliving.be * 0.5F * 0.75F;
f2 = entityliving.bg;
if (f2 <= 0.0f) {
f2 *= 0.25F;
}
k(0.12f);
super.a(f, f1, f2);
P = (float) 1.0;
}
use of net.minecraft.server.v1_11_R1.EntityHuman in project Citizens2 by CitizensDev.
the class NMSImpl method setHeadYaw.
@Override
public void setHeadYaw(org.bukkit.entity.Entity entity, float yaw) {
if (!(entity instanceof LivingEntity))
return;
EntityLiving handle = (EntityLiving) getHandle(entity);
yaw = Util.clampYaw(yaw);
handle.aP = yaw;
if (!(handle instanceof EntityHuman))
handle.aO = yaw;
handle.aQ = yaw;
}
use of net.minecraft.server.v1_11_R1.EntityHuman in project Citizens2 by CitizensDev.
the class NMSImpl method addOrRemoveFromPlayerList.
@Override
public void addOrRemoveFromPlayerList(org.bukkit.entity.Entity entity, boolean remove) {
if (entity == null)
return;
EntityHuman handle = (EntityHuman) getHandle(entity);
if (handle.world == null)
return;
if (remove) {
handle.world.players.remove(handle);
} else if (!handle.world.players.contains(handle)) {
handle.world.players.add(handle);
}
PlayerUpdateTask.addOrRemove(entity, remove);
}
Aggregations