Search in sources :

Example 31 with World

use of net.minecraft.server.v1_15_R1.World in project RoseStacker by Rosewood-Development.

the class StackedSpawnerTileImpl method updateTile.

private void updateTile() {
    World level = this.a();
    if (level != null) {
        level.b(this.blockPos, this.blockEntity);
        IBlockData var1 = this.a().getType(this.b());
        this.a().notify(this.blockPos, var1, var1, 3);
    }
}
Also used : IBlockData(net.minecraft.server.v1_16_R3.IBlockData) World(net.minecraft.server.v1_16_R3.World)

Example 32 with World

use of net.minecraft.server.v1_15_R1.World in project SSB-OneBlock by BG-Software-LLC.

the class NMSAdapter_v1_15_R1 method setChestName.

@Override
public void setChestName(Location chest, String name) {
    assert chest.getWorld() != null;
    World world = ((CraftWorld) chest.getWorld()).getHandle();
    BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
    TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
    assert tileEntityChest != null;
    tileEntityChest.setCustomName(CraftChatMessage.fromString(name)[0]);
}
Also used : TileEntityChest(net.minecraft.server.v1_15_R1.TileEntityChest) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) World(net.minecraft.server.v1_15_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld)

Example 33 with World

use of net.minecraft.server.v1_15_R1.World in project SSB-OneBlock by BG-Software-LLC.

the class NMSAdapter_v1_8_R3 method setChestName.

@Override
public void setChestName(Location chest, String name) {
    World world = ((CraftWorld) chest.getWorld()).getHandle();
    BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
    TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
    tileEntityChest.a(name);
}
Also used : TileEntityChest(net.minecraft.server.v1_8_R3.TileEntityChest) BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) World(net.minecraft.server.v1_8_R3.World) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

Example 34 with World

use of net.minecraft.server.v1_15_R1.World in project Atlas by funkemunky.

the class BlockBox1_15_R1 method getCollisionBox.

@Override
public CollisionBox getCollisionBox(org.bukkit.block.Block block) {
    final net.minecraft.server.v1_15_R1.World world = ((org.bukkit.craftbukkit.v1_15_R1.CraftWorld) block.getWorld()).getHandle();
    final int x = block.getX(), y = block.getY(), z = block.getZ();
    net.minecraft.server.v1_15_R1.IBlockData iblockData = ((CraftBlock) block).getNMS();
    net.minecraft.server.v1_15_R1.Block vblock = iblockData.getBlock();
    BlockPosition blockPos = new BlockPosition(x, y, z);
    VoxelShape shape = vblock.a(iblockData, world, blockPos, VoxelShapeCollision.a());
    List<AxisAlignedBB> boxes = shape.d();
    if (boxes.size() == 0) {
        return BlockData.getData(block.getType()).getBox(block, ProtocolVersion.getGameVersion());
    } else if (boxes.size() == 1) {
        AxisAlignedBB box = boxes.get(0);
        return new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ);
    } else {
        ComplexCollisionBox complexBox = new ComplexCollisionBox();
        for (AxisAlignedBB box : boxes) {
            complexBox.add(new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ));
        }
        return complexBox;
    }
}
Also used : ComplexCollisionBox(cc.funkemunky.api.utils.world.types.ComplexCollisionBox) CraftBlock(org.bukkit.craftbukkit.v1_15_R1.block.CraftBlock) World(net.minecraft.server.v1_15_R1.World) SimpleCollisionBox(cc.funkemunky.api.utils.world.types.SimpleCollisionBox) net.minecraft.server.v1_15_R1(net.minecraft.server.v1_15_R1) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld)

Example 35 with World

use of net.minecraft.server.v1_15_R1.World in project Atlas by funkemunky.

the class BlockBox1_16_R2 method getCollisionBox.

@Override
public CollisionBox getCollisionBox(org.bukkit.block.Block block) {
    final net.minecraft.server.v1_16_R2.World world = ((org.bukkit.craftbukkit.v1_16_R2.CraftWorld) block.getWorld()).getHandle();
    final int x = block.getX(), y = block.getY(), z = block.getZ();
    net.minecraft.server.v1_16_R2.IBlockData iblockData = ((CraftBlock) block).getNMS();
    net.minecraft.server.v1_16_R2.Block vblock = iblockData.getBlock();
    BlockPosition blockPos = new BlockPosition(x, y, z);
    VoxelShape shape = vblock.a(iblockData, world, blockPos, VoxelShapeCollision.a());
    List<AxisAlignedBB> boxes = shape.d();
    if (boxes.size() == 0) {
        return BlockData.getData(block.getType()).getBox(block, ProtocolVersion.getGameVersion());
    } else if (boxes.size() == 1) {
        AxisAlignedBB box = boxes.get(0);
        return new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ);
    } else {
        ComplexCollisionBox complexBox = new ComplexCollisionBox();
        for (AxisAlignedBB box : boxes) {
            complexBox.add(new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ));
        }
        return complexBox;
    }
}
Also used : ComplexCollisionBox(cc.funkemunky.api.utils.world.types.ComplexCollisionBox) CraftBlock(org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock) SimpleCollisionBox(cc.funkemunky.api.utils.world.types.SimpleCollisionBox) net.minecraft.server.v1_16_R2(net.minecraft.server.v1_16_R2) World(net.minecraft.server.v1_16_R2.World) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld)

Aggregations

Location (org.bukkit.Location)27 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)12 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 CraftWorld (org.bukkit.craftbukkit.v1_15_R1.CraftWorld)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