basic property interfaces

This commit is contained in:
dfsek 2021-06-25 19:12:43 -07:00
parent 3386570439
commit 002c7037f1
4 changed files with 33 additions and 1 deletions

View File

@ -1,5 +1,11 @@
package com.dfsek.terra.api.block.data.properties;
public interface Property<T> {
import java.util.Collection;
public interface Property<T> {
Class<T> getType();
String getName();
Collection<T> values();
}

View File

@ -0,0 +1,10 @@
package com.dfsek.terra.api.block.data.properties.base;
import com.dfsek.terra.api.block.data.properties.Property;
public interface BooleanProperty extends Property<Boolean> {
@Override
default Class<Boolean> getType() {
return Boolean.class;
}
}

View File

@ -0,0 +1,6 @@
package com.dfsek.terra.api.block.data.properties.base;
import com.dfsek.terra.api.block.data.properties.Property;
public interface EnumProperty<T extends Enum<T>> extends Property<T> {
}

View File

@ -0,0 +1,10 @@
package com.dfsek.terra.api.block.data.properties.base;
import com.dfsek.terra.api.block.data.properties.Property;
public interface IntProperty extends Property<Integer> {
@Override
default Class<Integer> getType() {
return Integer.class;
}
}