mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 12:07:42 +01:00
Add experimental Block#possibleStates
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
c9f52397cb
commit
1b4e0519ee
@ -5,10 +5,7 @@ import net.minestom.server.registry.Registry;
|
||||
import net.minestom.server.tag.Tag;
|
||||
import net.minestom.server.tag.TagReadable;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
import org.jetbrains.annotations.*;
|
||||
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -122,6 +119,10 @@ public sealed interface Block extends ProtocolObject, TagReadable, Blocks permit
|
||||
return properties().get(property);
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@ApiStatus.Experimental
|
||||
@NotNull Collection<@NotNull Block> possibleStates();
|
||||
|
||||
/**
|
||||
* Returns the block registry.
|
||||
* <p>
|
||||
|
@ -132,6 +132,11 @@ final class BlockImpl implements Block {
|
||||
return Collections.unmodifiableMap(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<@NotNull Block> possibleStates() {
|
||||
return propertyEntry.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Registry.BlockEntry registry() {
|
||||
return registry;
|
||||
|
Loading…
Reference in New Issue
Block a user