Search in sources :

Example 1 with VoxelShape

use of net.minecraft.server.v1_16_R3.VoxelShape 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 2 with VoxelShape

use of net.minecraft.server.v1_16_R3.VoxelShape 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 3 with VoxelShape

use of net.minecraft.server.v1_16_R3.VoxelShape 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 4 with VoxelShape

use of net.minecraft.server.v1_16_R3.VoxelShape 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)

Example 5 with VoxelShape

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

the class V1_16_4 method getBoundingBoxes.

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