Search in sources :

Example 46 with World

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);
}
Also used : CraftBlockData(org.bukkit.craftbukkit.v1_14_R1.block.data.CraftBlockData) IBlockData(net.minecraft.server.v1_14_R1.IBlockData) BlockPosition(net.minecraft.server.v1_14_R1.BlockPosition) World(net.minecraft.server.v1_14_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld)

Example 47 with World

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;
}
Also used : BlockPosition(net.minecraft.server.v1_13_R1.BlockPosition) PacketPlayOutBlockChange(net.minecraft.server.v1_13_R1.PacketPlayOutBlockChange)

Example 48 with World

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();
}
Also used : TileEntity(net.minecraft.server.v1_8_R1.TileEntity) TileEntityChest(net.minecraft.server.v1_8_R1.TileEntityChest) Chest(org.bukkit.block.Chest) TileEntityChest(net.minecraft.server.v1_8_R1.TileEntityChest) BlockPosition(net.minecraft.server.v1_8_R1.BlockPosition) World(net.minecraft.server.v1_8_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_8_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_8_R1.CraftWorld)

Example 49 with World

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));
}
Also used : EntityRabbit(net.minecraft.server.v1_12_R1.EntityRabbit) PathfinderGoalSelector(net.minecraft.server.v1_12_R1.PathfinderGoalSelector) World(net.minecraft.server.v1_12_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 50 with World

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;
}
Also used : World(net.minecraft.server.v1_8_R3.World) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

Aggregations

Location (org.bukkit.Location)26 World (net.minecraft.server.v1_16_R3.World)16 World (net.minecraft.server.v1_12_R1.World)15 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)15 World (net.minecraft.server.v1_8_R3.World)14 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)14 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)14 ArrayList (java.util.ArrayList)11 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)11 List (java.util.List)10 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)10 BlockPosition (net.minecraft.server.v1_16_R3.BlockPosition)10 WildLoadersPlugin (com.bgsoftware.wildloaders.WildLoadersPlugin)8 Hologram (com.bgsoftware.wildloaders.api.holograms.Hologram)8 ChunkLoader (com.bgsoftware.wildloaders.api.loaders.ChunkLoader)8 ChunkLoaderNPC (com.bgsoftware.wildloaders.api.npc.ChunkLoaderNPC)8 ITileEntityChunkLoader (com.bgsoftware.wildloaders.loaders.ITileEntityChunkLoader)8 WChunkLoader (com.bgsoftware.wildloaders.loaders.WChunkLoader)8 Collection (java.util.Collection)8 Collections (java.util.Collections)8