Search in sources :

Example 1 with BlockPosition

use of com.loohp.interactionvisualizer.objectholders.BlockPosition in project InteractionVisualizer by LOOHP.

the class V1_11 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_11_R1.BlockPosition blockpos = new net.minecraft.server.v1_11_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_11_R1.AxisAlignedBB) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) ArrayList(java.util.ArrayList) WorldServer(net.minecraft.server.v1_11_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld)

Example 2 with BlockPosition

use of com.loohp.interactionvisualizer.objectholders.BlockPosition 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 3 with BlockPosition

use of com.loohp.interactionvisualizer.objectholders.BlockPosition 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 4 with BlockPosition

use of com.loohp.interactionvisualizer.objectholders.BlockPosition 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 5 with BlockPosition

use of com.loohp.interactionvisualizer.objectholders.BlockPosition 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)

Aggregations

BlockPosition (com.loohp.interactionvisualizer.objectholders.BlockPosition)13 BoundingBox (com.loohp.interactionvisualizer.objectholders.BoundingBox)13 List (java.util.List)11 Material (org.bukkit.Material)11 PacketContainer (com.comphenix.protocol.events.PacketContainer)10 ChunkPosition (com.loohp.interactionvisualizer.objectholders.ChunkPosition)10 NMSTileEntitySet (com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet)10 TileEntity (com.loohp.interactionvisualizer.objectholders.TileEntity)10 TileEntityType (com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType)10 ValuePairs (com.loohp.interactionvisualizer.objectholders.ValuePairs)10 WrappedIterable (com.loohp.interactionvisualizer.objectholders.WrappedIterable)10 Collectors (java.util.stream.Collectors)10 World (org.bukkit.World)10 Block (org.bukkit.block.Block)10 Entity (org.bukkit.entity.Entity)10 Item (org.bukkit.entity.Item)10 EquipmentSlot (org.bukkit.inventory.EquipmentSlot)10 ItemStack (org.bukkit.inventory.ItemStack)10 ArrayList (java.util.ArrayList)9 PacketType (com.comphenix.protocol.PacketType)7