Search in sources :

Example 16 with VoxelShape

use of net.minecraft.server.v1_16_R1.VoxelShape in project InteractionVisualizer by LOOHP.

the class V1_16 method getBoundingBoxes.

public List<BoundingBox> getBoundingBoxes(BlockPosition pos) {
    net.minecraft.server.v1_16_R1.BlockPosition blockpos = new net.minecraft.server.v1_16_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) EntityItem(net.minecraft.server.v1_16_R1.EntityItem) Item(org.bukkit.entity.Item) CraftChunk(org.bukkit.craftbukkit.v1_16_R1.CraftChunk) CraftWorld(org.bukkit.craftbukkit.v1_16_R1.CraftWorld) VoxelShape(net.minecraft.server.v1_16_R1.VoxelShape) CraftItem(org.bukkit.craftbukkit.v1_16_R1.entity.CraftItem) WorldServer(net.minecraft.server.v1_16_R1.WorldServer) ArrayList(java.util.ArrayList) 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) Entity(org.bukkit.entity.Entity) ValuePairs(com.loohp.interactionvisualizer.objectholders.ValuePairs) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) Collectors(java.util.stream.Collectors) Pair(com.mojang.datafixers.util.Pair) CraftItemStack(org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack) ItemStack(org.bukkit.inventory.ItemStack) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) PacketContainer(com.comphenix.protocol.events.PacketContainer) List(java.util.List) EnumItemSlot(net.minecraft.server.v1_16_R1.EnumItemSlot) PacketPlayOutEntityEquipment(net.minecraft.server.v1_16_R1.PacketPlayOutEntityEquipment) CraftMagicNumbers(org.bukkit.craftbukkit.v1_16_R1.util.CraftMagicNumbers) VoxelShape(net.minecraft.server.v1_16_R1.VoxelShape) BlockPosition(com.loohp.interactionvisualizer.objectholders.BlockPosition) BoundingBox(com.loohp.interactionvisualizer.objectholders.BoundingBox) WorldServer(net.minecraft.server.v1_16_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_16_R1.CraftWorld)

Aggregations

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