use of net.minecraft.server.v1_9_R1.World in project MyPet by xXKeyleXx.
the class EntityRegistry method createMinecraftEntity.
@Override
public MyPetMinecraftEntity createMinecraftEntity(MyPet pet, org.bukkit.World bukkitWorld) {
EntityMyPet petEntity = null;
Class<? extends MyPetMinecraftEntity> entityClass = entityClasses.get(pet.getPetType());
World world = ((CraftWorld) bukkitWorld).getHandle();
try {
Constructor<?> ctor = entityClass.getConstructor(World.class, MyPet.class);
Object obj = ctor.newInstance(world, pet);
if (obj instanceof EntityMyPet) {
petEntity = (EntityMyPet) obj;
}
} catch (Exception e) {
MyPetApi.getLogger().info(ChatColor.RED + entityClass.getName() + " is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_9_R1.World in project MyPet by xXKeyleXx.
the class EntityRegistry method createMinecraftEntity.
@Override
public MyPetMinecraftEntity createMinecraftEntity(MyPet pet, org.bukkit.World bukkitWorld) {
EntityMyPet petEntity = null;
Class<? extends MyPetMinecraftEntity> entityClass = entityClasses.get(pet.getPetType());
World world = ((CraftWorld) bukkitWorld).getHandle();
try {
Constructor<?> ctor = entityClass.getConstructor(World.class, MyPet.class);
Object obj = ctor.newInstance(world, pet);
if (obj instanceof EntityMyPet) {
petEntity = (EntityMyPet) obj;
}
} catch (Exception e) {
MyPetApi.getLogger().info(ChatColor.RED + entityClass.getName() + " is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_9_R1.World in project MyPet by xXKeyleXx.
the class EntityRegistry method createMinecraftEntity.
@Override
public MyPetMinecraftEntity createMinecraftEntity(MyPet pet, org.bukkit.World bukkitWorld) {
EntityMyPet petEntity = null;
Class<? extends MyPetMinecraftEntity> entityClass = entityClasses.get(pet.getPetType());
World world = ((CraftWorld) bukkitWorld).getHandle();
try {
Constructor<?> ctor = entityClass.getConstructor(World.class, MyPet.class);
Object obj = ctor.newInstance(world, pet);
if (obj instanceof EntityMyPet) {
petEntity = (EntityMyPet) obj;
}
} catch (Exception e) {
MyPetApi.getLogger().info(ChatColor.RED + entityClass.getName() + " is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_9_R1.World in project MyPet by xXKeyleXx.
the class EntityRegistry method createMinecraftEntity.
@Override
public MyPetMinecraftEntity createMinecraftEntity(MyPet pet, org.bukkit.World bukkitWorld) {
EntityMyPet petEntity = null;
Class<? extends MyPetMinecraftEntity> entityClass = entityClasses.get(pet.getPetType());
World world = ((CraftWorld) bukkitWorld).getHandle();
try {
Constructor<?> ctor = entityClass.getConstructor(World.class, MyPet.class);
Object obj = ctor.newInstance(world, pet);
if (obj instanceof EntityMyPet) {
petEntity = (EntityMyPet) obj;
}
} catch (Exception e) {
MyPetApi.getLogger().info(ChatColor.RED + entityClass.getName() + " is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_9_R1.World in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_9_R1 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_9_R1.Block block = net.minecraft.server.v1_9_R1.Block.getById(id);
if (block == null) {
// TODO: Convention for null blocks -> full ?
return null;
}
final BlockPosition pos = new BlockPosition(x, y, z);
final AxisAlignedBB bb = block.a(world.getType(pos), world, pos);
if (bb == null) {
// Special case.
return new double[] { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 };
// return null;
}
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { bb.a, bb.b, bb.c, bb.d, bb.e, bb.f };
}
Aggregations