Search in sources :

Example 21 with CraftWorld

use of org.bukkit.craftbukkit.v1_19_R1.CraftWorld in project InteractionVisualizer by LOOHP.

the class V1_12 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_12_R1.BlockPosition blockpos = new net.minecraft.server.v1_12_R1.BlockPosition(pos.getX(), pos.getY(), pos.getZ());
    WorldServer world = ((CraftWorld) pos.getWorld()).getHandle();
    AxisAlignedBB box = world.getType(blockpos).d(world, blockpos);
    List<BoundingBox> boxes = new ArrayList<>(1);
    boxes.add(new BoundingBox(box.a + pos.getX(), box.b + pos.getY(), box.c + pos.getZ(), box.d + pos.getX(), box.e + pos.getY(), box.f + pos.getZ()));
    return boxes;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_12_R1.AxisAlignedBB) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) ArrayList(java.util.ArrayList) WorldServer(net.minecraft.server.v1_12_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 22 with CraftWorld

use of org.bukkit.craftbukkit.v1_19_R1.CraftWorld in project InteractionVisualizer by LOOHP.

the class V1_13_1 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_13_R2.BlockPosition blockpos = new net.minecraft.server.v1_13_R2.BlockPosition(pos.getX(), pos.getY(), pos.getZ());
    WorldServer world = ((CraftWorld) pos.getWorld()).getHandle();
    VoxelShape shape = world.getType(blockpos).getShape(world, blockpos);
    return shape.d().stream().map(each -> new BoundingBox(each.minX + pos.getX(), each.minY + pos.getY(), each.minZ + pos.getZ(), each.maxX + pos.getX(), each.maxY + pos.getY(), each.maxZ + pos.getZ())).collect(Collectors.toList());
}
Also used : CraftMagicNumbers(org.bukkit.craftbukkit.v1_13_R2.util.CraftMagicNumbers) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) EntityItem(net.minecraft.server.v1_13_R2.EntityItem) CraftWorld(org.bukkit.craftbukkit.v1_13_R2.CraftWorld) Item(org.bukkit.entity.Item) VoxelShape(net.minecraft.server.v1_13_R2.VoxelShape) Block(org.bukkit.block.Block) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) World(org.bukkit.World) CraftChunk(org.bukkit.craftbukkit.v1_13_R2.CraftChunk) WrappedIterable(com.loohp.interactionvisualizer.objectholders.WrappedIterable) WorldServer(net.minecraft.server.v1_13_R2.WorldServer) Material(org.bukkit.Material) EquipmentSlot(org.bukkit.inventory.EquipmentSlot) CraftItem(org.bukkit.craftbukkit.v1_13_R2.entity.CraftItem) ChunkPosition(com.loohp.interactionvisualizer.objectholders.ChunkPosition) InteractionVisualizer(com.loohp.interactionvisualizer.InteractionVisualizer) Entity(org.bukkit.entity.Entity) ValuePairs(com.loohp.interactionvisualizer.objectholders.ValuePairs) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) ItemSlot(com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot) TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) PacketType(com.comphenix.protocol.PacketType) Collectors(java.util.stream.Collectors) ItemStack(org.bukkit.inventory.ItemStack) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) PacketContainer(com.comphenix.protocol.events.PacketContainer) List(java.util.List) VoxelShape(net.minecraft.server.v1_13_R2.VoxelShape) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) WorldServer(net.minecraft.server.v1_13_R2.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_13_R2.CraftWorld)

Example 23 with CraftWorld

use of org.bukkit.craftbukkit.v1_19_R1.CraftWorld in project InteractionVisualizer by LOOHP.

the class V1_14 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_14_R1.BlockPosition blockpos = new net.minecraft.server.v1_14_R1.BlockPosition(pos.getX(), pos.getY(), pos.getZ());
    WorldServer world = ((CraftWorld) pos.getWorld()).getHandle();
    VoxelShape shape = world.getType(blockpos).getShape(world, blockpos);
    return shape.d().stream().map(each -> new BoundingBox(each.minX + pos.getX(), each.minY + pos.getY(), each.minZ + pos.getZ(), each.maxX + pos.getX(), each.maxY + pos.getY(), each.maxZ + pos.getZ())).collect(Collectors.toList());
}
Also used : BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) VoxelShape(net.minecraft.server.v1_14_R1.VoxelShape) Item(org.bukkit.entity.Item) CraftItem(org.bukkit.craftbukkit.v1_14_R1.entity.CraftItem) EntityItem(net.minecraft.server.v1_14_R1.EntityItem) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld) CraftChunk(org.bukkit.craftbukkit.v1_14_R1.CraftChunk) Block(org.bukkit.block.Block) CraftMagicNumbers(org.bukkit.craftbukkit.v1_14_R1.util.CraftMagicNumbers) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) World(org.bukkit.World) WrappedIterable(com.loohp.interactionvisualizer.objectholders.WrappedIterable) Material(org.bukkit.Material) EquipmentSlot(org.bukkit.inventory.EquipmentSlot) ChunkPosition(com.loohp.interactionvisualizer.objectholders.ChunkPosition) WorldServer(net.minecraft.server.v1_14_R1.WorldServer) InteractionVisualizer(com.loohp.interactionvisualizer.InteractionVisualizer) Entity(org.bukkit.entity.Entity) ValuePairs(com.loohp.interactionvisualizer.objectholders.ValuePairs) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) ItemSlot(com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot) TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) PacketType(com.comphenix.protocol.PacketType) Collectors(java.util.stream.Collectors) ItemStack(org.bukkit.inventory.ItemStack) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) PacketContainer(com.comphenix.protocol.events.PacketContainer) List(java.util.List) VoxelShape(net.minecraft.server.v1_14_R1.VoxelShape) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) WorldServer(net.minecraft.server.v1_14_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld)

Example 24 with CraftWorld

use of org.bukkit.craftbukkit.v1_19_R1.CraftWorld in project InteractionVisualizer by LOOHP.

the class V1_15 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_15_R1.BlockPosition blockpos = new net.minecraft.server.v1_15_R1.BlockPosition(pos.getX(), pos.getY(), pos.getZ());
    WorldServer world = ((CraftWorld) pos.getWorld()).getHandle();
    VoxelShape shape = world.getType(blockpos).getShape(world, blockpos);
    return shape.d().stream().map(each -> new BoundingBox(each.minX + pos.getX(), each.minY + pos.getY(), each.minZ + pos.getZ(), each.maxX + pos.getX(), each.maxY + pos.getY(), each.maxZ + pos.getZ())).collect(Collectors.toList());
}
Also used : CraftMagicNumbers(org.bukkit.craftbukkit.v1_15_R1.util.CraftMagicNumbers) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) Item(org.bukkit.entity.Item) Block(org.bukkit.block.Block) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) World(org.bukkit.World) WrappedIterable(com.loohp.interactionvisualizer.objectholders.WrappedIterable) Material(org.bukkit.Material) EquipmentSlot(org.bukkit.inventory.EquipmentSlot) ChunkPosition(com.loohp.interactionvisualizer.objectholders.ChunkPosition) InteractionVisualizer(com.loohp.interactionvisualizer.InteractionVisualizer) EntityItem(net.minecraft.server.v1_15_R1.EntityItem) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) Entity(org.bukkit.entity.Entity) ValuePairs(com.loohp.interactionvisualizer.objectholders.ValuePairs) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) ItemSlot(com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot) TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) PacketType(com.comphenix.protocol.PacketType) VoxelShape(net.minecraft.server.v1_15_R1.VoxelShape) CraftItem(org.bukkit.craftbukkit.v1_15_R1.entity.CraftItem) Collectors(java.util.stream.Collectors) ItemStack(org.bukkit.inventory.ItemStack) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) PacketContainer(com.comphenix.protocol.events.PacketContainer) List(java.util.List) CraftChunk(org.bukkit.craftbukkit.v1_15_R1.CraftChunk) WorldServer(net.minecraft.server.v1_15_R1.WorldServer) VoxelShape(net.minecraft.server.v1_15_R1.VoxelShape) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) WorldServer(net.minecraft.server.v1_15_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld)

Example 25 with CraftWorld

use of org.bukkit.craftbukkit.v1_19_R1.CraftWorld in project InteractionVisualizer by LOOHP.

the class V1_16_2 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_16_R2.BlockPosition blockpos = new net.minecraft.server.v1_16_R2.BlockPosition(pos.getX(), pos.getY(), pos.getZ());
    WorldServer world = ((CraftWorld) pos.getWorld()).getHandle();
    VoxelShape shape = world.getType(blockpos).getShape(world, blockpos);
    return shape.d().stream().map(each -> new BoundingBox(each.minX + pos.getX(), each.minY + pos.getY(), each.minZ + pos.getZ(), each.maxX + pos.getX(), each.maxY + pos.getY(), each.maxZ + pos.getZ())).collect(Collectors.toList());
}
Also used : BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) Item(org.bukkit.entity.Item) WorldServer(net.minecraft.server.v1_16_R2.WorldServer) EnumItemSlot(net.minecraft.server.v1_16_R2.EnumItemSlot) ArrayList(java.util.ArrayList) Block(org.bukkit.block.Block) CraftItemStack(org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) World(org.bukkit.World) CraftMagicNumbers(org.bukkit.craftbukkit.v1_16_R2.util.CraftMagicNumbers) WrappedIterable(com.loohp.interactionvisualizer.objectholders.WrappedIterable) Material(org.bukkit.Material) EquipmentSlot(org.bukkit.inventory.EquipmentSlot) PacketPlayOutEntityEquipment(net.minecraft.server.v1_16_R2.PacketPlayOutEntityEquipment) ChunkPosition(com.loohp.interactionvisualizer.objectholders.ChunkPosition) Entity(org.bukkit.entity.Entity) ValuePairs(com.loohp.interactionvisualizer.objectholders.ValuePairs) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) CraftChunk(org.bukkit.craftbukkit.v1_16_R2.CraftChunk) TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) Collectors(java.util.stream.Collectors) Pair(com.mojang.datafixers.util.Pair) ItemStack(org.bukkit.inventory.ItemStack) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld) PacketContainer(com.comphenix.protocol.events.PacketContainer) List(java.util.List) EntityItem(net.minecraft.server.v1_16_R2.EntityItem) CraftItem(org.bukkit.craftbukkit.v1_16_R2.entity.CraftItem) VoxelShape(net.minecraft.server.v1_16_R2.VoxelShape) VoxelShape(net.minecraft.server.v1_16_R2.VoxelShape) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) WorldServer(net.minecraft.server.v1_16_R2.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld)

Aggregations

ServerLevel (net.minecraft.server.level.ServerLevel)147 Location (org.bukkit.Location)131 CraftWorld (org.bukkit.craftbukkit.v1_18_R2.CraftWorld)111 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)103 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)95 BlockPos (net.minecraft.core.BlockPos)83 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)74 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)66 ItemStack (org.bukkit.inventory.ItemStack)61 Block (org.bukkit.block.Block)57 LivingEntity (org.bukkit.entity.LivingEntity)54 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)53 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)47 ArrayList (java.util.ArrayList)43 World (org.bukkit.World)41 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)39 Entity (org.bukkit.entity.Entity)39 Level (net.minecraft.world.level.Level)38 List (java.util.List)34 GameProfile (com.mojang.authlib.GameProfile)32