SPIGOT-2903: Add Structure API

By: Sander Knauff <sanderknauff@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2021-10-05 11:55:20 +11:00
parent 8b6e67635a
commit 6882afca7b
6 changed files with 410 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package org.bukkit.structure;
import java.util.List;
import org.bukkit.block.BlockState;
import org.jetbrains.annotations.NotNull;
/**
* Represent a variation of a structure.
*
* Most structures, like the ones generated with structure blocks, only have a
* single variant.
*/
public interface Palette {
/**
* Gets a copy of the blocks this Palette is made of.
*
* The {@link BlockState#getLocation() positions} of the returned block
* states are offsets relative to the structure's position that is provided
* once the structure is placed into the world.
*
* @return The blocks in this palette
*/
@NotNull
List<BlockState> getBlocks();
/**
* Gets the number of blocks stored in this palette.
*
* @return The number of blocks in this palette
*/
int getBlockCount();
}