use of net.minecraft.server.v1_13_R1.World in project Movecraft by APDevTeam.
the class IWorldHandler method setBlockFast.
@Override
public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) {
IBlockData blockData;
if (data instanceof CraftBlockData) {
blockData = ((CraftBlockData) data).getState();
} else {
blockData = (IBlockData) data;
}
blockData = blockData.a(ROTATION[rotation.ordinal()]);
World world = ((CraftWorld) (location.getWorld())).getHandle();
BlockPosition blockPosition = locationToPosition(bukkit2MovecraftLoc(location));
setBlockFast(world, blockPosition, blockData);
}
use of net.minecraft.server.v1_13_R1.World in project TheAPI by TheDevTec.
the class v1_13_R1 method packetBlockChange.
@Override
public Object packetBlockChange(World world, int x, int y, int z) {
PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange();
packet.block = (IBlockData) getBlock(getChunk(world, x >> 4, z >> 4), x, y, z);
try {
pos.set(packet, new BlockPosition(x, y, z));
} catch (Exception e) {
}
return packet;
}
use of net.minecraft.server.v1_13_R1.World in project Slabbo by Sven65.
the class SlabboAPI_v1_8_R1 method setChestName.
public void setChestName(Block chestBlock, String name) {
Chest chest = (Chest) chestBlock.getState();
World nmsWorld = ((CraftWorld) chestBlock.getWorld()).getHandle();
TileEntity tileEntity = nmsWorld.getTileEntity(new BlockPosition(chestBlock.getX(), chestBlock.getY(), chestBlock.getZ()));
if (!(tileEntity instanceof TileEntityChest))
return;
((TileEntityChest) tileEntity).a(name);
chest.update();
}
use of net.minecraft.server.v1_13_R1.World in project PaperDev by Kamillaova.
the class CraftRabbit method setRabbitType.
@Override
public void setRabbitType(Type type) {
EntityRabbit entity = getHandle();
if (getRabbitType() == Type.THE_KILLER_BUNNY) {
// Reset goals and target finders.
World world = ((CraftWorld) this.getWorld()).getHandle();
entity.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
entity.targetSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
entity.initializePathFinderGoals();
}
entity.setRabbitType(CraftMagicMapping.toMagic(type));
}
use of net.minecraft.server.v1_13_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;
}
Aggregations