mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-08 11:50:36 +01:00
WIP property retrieval
This commit is contained in:
parent
5a485a3aab
commit
8b0991139d
@ -17,12 +17,18 @@ public interface Block extends Keyed, TagReadable, BlockConstants {
|
||||
|
||||
<T> @NotNull Block withProperty(@NotNull BlockProperty<T> property, @NotNull T value);
|
||||
|
||||
@NotNull Block withProperty(@NotNull String property, @NotNull String value);
|
||||
|
||||
<T> @NotNull Block withTag(@NotNull Tag<T> tag, @Nullable T value);
|
||||
|
||||
@NotNull Block withNbt(@Nullable NBTCompound compound);
|
||||
|
||||
@NotNull Block withHandler(@Nullable BlockHandler handler);
|
||||
|
||||
<T> @NotNull T getProperty(@NotNull BlockProperty<T> property);
|
||||
|
||||
@NotNull String getProperty(@NotNull String property);
|
||||
|
||||
@Nullable BlockHandler getHandler();
|
||||
|
||||
@NotNull Block getDefaultBlock();
|
||||
|
@ -96,6 +96,12 @@ class BlockImpl implements Block {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Block withProperty(@NotNull String property, @NotNull String value) {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
||||
return tag.read(compound);
|
||||
@ -136,6 +142,17 @@ class BlockImpl implements Block {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> @NotNull T getProperty(@NotNull BlockProperty<T> property) {
|
||||
return (T) propertiesMap.get(property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getProperty(@NotNull String property) {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Block getDefaultBlock() {
|
||||
return original;
|
||||
|
Loading…
Reference in New Issue
Block a user