mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 15:07:36 +02: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);
|
<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);
|
<T> @NotNull Block withTag(@NotNull Tag<T> tag, @Nullable T value);
|
||||||
|
|
||||||
@NotNull Block withNbt(@Nullable NBTCompound compound);
|
@NotNull Block withNbt(@Nullable NBTCompound compound);
|
||||||
|
|
||||||
@NotNull Block withHandler(@Nullable BlockHandler handler);
|
@NotNull Block withHandler(@Nullable BlockHandler handler);
|
||||||
|
|
||||||
|
<T> @NotNull T getProperty(@NotNull BlockProperty<T> property);
|
||||||
|
|
||||||
|
@NotNull String getProperty(@NotNull String property);
|
||||||
|
|
||||||
@Nullable BlockHandler getHandler();
|
@Nullable BlockHandler getHandler();
|
||||||
|
|
||||||
@NotNull Block getDefaultBlock();
|
@NotNull Block getDefaultBlock();
|
||||||
|
@ -96,6 +96,12 @@ class BlockImpl implements Block {
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull Block withProperty(@NotNull String property, @NotNull String value) {
|
||||||
|
// TODO
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
||||||
return tag.read(compound);
|
return tag.read(compound);
|
||||||
@ -136,6 +142,17 @@ class BlockImpl implements Block {
|
|||||||
return 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
|
@Override
|
||||||
public @NotNull Block getDefaultBlock() {
|
public @NotNull Block getDefaultBlock() {
|
||||||
return original;
|
return original;
|
||||||
|
Loading…
Reference in New Issue
Block a user