use of net.minecraft.server.v1_14_R1.IBlockData in project MechanicsMain by WeaponMechanics.
the class Block_1_14_R1 method getMultiBlockMaskPacket.
@Override
@NotNull
public List<Object> getMultiBlockMaskPacket(@NotNull List<Block> blocks, @Nullable Material mask, byte data) {
if (blocks == null || blocks.isEmpty()) {
throw new IllegalArgumentException("No blocks are being changed!");
}
Map<Chunk, List<Block>> sortedBlocks = new HashMap<>();
for (Block block : blocks) {
List<Block> list = sortedBlocks.computeIfAbsent(block.getChunk(), chunk -> new ArrayList<>());
list.add(block);
}
List<Object> packets = new ArrayList<>(sortedBlocks.size());
IBlockData theMask = mask == null ? null : ((CraftBlockData) mask.createBlockData()).getState();
for (List<Block> entry : sortedBlocks.values()) {
packets.add(getMultiBlockMaskPacket(entry, theMask));
}
return packets;
}
use of net.minecraft.server.v1_14_R1.IBlockData in project MechanicsMain by WeaponMechanics.
the class Block_1_15_R1 method getMultiBlockMaskPacket.
@Override
@NotNull
public List<Object> getMultiBlockMaskPacket(@NotNull List<Block> blocks, @Nullable BlockState mask) {
if (blocks == null || blocks.isEmpty()) {
throw new IllegalArgumentException("No blocks are being changed!");
}
Map<org.bukkit.Chunk, List<Block>> sortedBlocks = new HashMap<>();
for (Block block : blocks) {
List<Block> list = sortedBlocks.computeIfAbsent(block.getChunk(), chunk -> new ArrayList<>());
list.add(block);
}
List<Object> packets = new ArrayList<>(sortedBlocks.size());
IBlockData theMask = mask == null ? null : ((CraftBlockState) mask).getHandle();
for (List<Block> entry : sortedBlocks.values()) {
packets.add(getMultiBlockMaskPacket(entry, theMask));
}
return packets;
}
use of net.minecraft.server.v1_14_R1.IBlockData in project MechanicsMain by WeaponMechanics.
the class Block_1_16_R3 method getMultiBlockMaskPacket.
@Override
@NotNull
public List<Object> getMultiBlockMaskPacket(@NotNull List<Block> blocks, @Nullable BlockState mask) {
if (blocks == null || blocks.isEmpty()) {
throw new IllegalArgumentException("No blocks are being changed!");
}
Map<SubChunk, List<Block>> sortedBlocks = new HashMap<>();
for (Block block : blocks) {
List<Block> list = sortedBlocks.computeIfAbsent(SubChunk.byBlock(block), chunk -> new ArrayList<>());
list.add(block);
}
List<Object> packets = new ArrayList<>(sortedBlocks.size());
IBlockData theMask = mask == null ? null : ((CraftBlockState) mask).getHandle();
for (List<Block> entry : sortedBlocks.values()) {
packets.add(getMultiBlockMaskPacket(entry, theMask));
}
return packets;
}
use of net.minecraft.server.v1_14_R1.IBlockData in project MechanicsMain by WeaponMechanics.
the class Block_1_13_R2 method getMultiBlockMaskPacket.
@Override
@NotNull
public List<Object> getMultiBlockMaskPacket(@NotNull List<Block> blocks, @Nullable Material mask, byte data) {
if (blocks == null || blocks.isEmpty()) {
throw new IllegalArgumentException("No blocks are being changed!");
}
Map<Chunk, List<Block>> sortedBlocks = new HashMap<>();
for (Block block : blocks) {
List<Block> list = sortedBlocks.computeIfAbsent(block.getChunk(), chunk -> new ArrayList<>());
list.add(block);
}
List<Object> packets = new ArrayList<>(sortedBlocks.size());
IBlockData theMask = mask == null ? null : ((CraftBlockData) mask.createBlockData()).getState();
for (List<Block> entry : sortedBlocks.values()) {
packets.add(getMultiBlockMaskPacket(entry, theMask));
}
return packets;
}
use of net.minecraft.server.v1_14_R1.IBlockData in project MechanicsMain by WeaponMechanics.
the class Block_1_13_R2 method getMultiBlockMaskPacket.
@Override
@NotNull
public List<Object> getMultiBlockMaskPacket(@NotNull List<Block> blocks, @Nullable BlockState mask) {
if (blocks == null || blocks.isEmpty()) {
throw new IllegalArgumentException("No blocks are being changed!");
}
Map<Chunk, List<Block>> sortedBlocks = new HashMap<>();
for (Block block : blocks) {
List<Block> list = sortedBlocks.computeIfAbsent(block.getChunk(), chunk -> new ArrayList<>());
list.add(block);
}
List<Object> packets = new ArrayList<>(sortedBlocks.size());
IBlockData theMask = mask == null ? null : ((CraftBlockState) mask).getHandle();
for (List<Block> entry : sortedBlocks.values()) {
packets.add(getMultiBlockMaskPacket(entry, theMask));
}
return packets;
}
Aggregations