use of net.minecraft.server.v1_8_R1.World in project acidisland by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_8_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_8_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_8_R1.Block.getByCombinedId(combined);
chunk.a(bp, ibd);
if (applyPhysics) {
net.minecraft.server.v1_8_R1.Block block = chunk.getType(bp);
w.update(bp, block);
}
}
use of net.minecraft.server.v1_8_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 + Util.getClassName(entityClass) + "(" + pet.getPetType() + ") is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_8_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 + Util.getClassName(entityClass) + "(" + pet.getPetType() + ") is no valid MyPet(Entity)!");
e.printStackTrace();
}
return petEntity;
}
use of net.minecraft.server.v1_8_R1.World in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_8_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_8_R1.Block block = net.minecraft.server.v1_8_R1.Block.getById(id);
if (block == null) {
// TODO: Convention for null bounds -> full ?
return null;
}
block.updateShape(world, new BlockPosition(x, y, z));
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { block.z(), block.B(), block.D(), block.A(), block.C(), block.E() };
}
Aggregations