Skip to content

Commit 779d472

Browse files
committed
feat: Add StringRepresentable
For some usages it's helpful to have the serializable name that gets used and assists with interpreting values from user parsed files.
1 parent 791f262 commit 779d472

25 files changed

+85
-22
lines changed

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@ public final class Keys {
563563
*/
564564
public static final Key<Value<Ticks>> BREEDING_COOLDOWN = Keys.key(ResourceKey.sponge("breeding_cooldown"), Ticks.class);
565565

566+
/**
567+
* Whether a {@link BlockState} can be lit on fire by things like spreading lava,
568+
* or sometimes a {@link ServerLocation} to be directionally specific.
569+
*/
570+
public static final Key<Value<Boolean>> BURNABLE = Keys.key(ResourceKey.sponge("burnable"), Boolean.class);
571+
566572
/**
567573
* The burntime of an {@link ItemStack} fuel in a furnace.
568574
* See {@link #FUEL} for the time

src/main/java/org/spongepowered/api/data/type/AttachmentSurface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
* Represents a block surface.
3232
*/
3333
@CatalogedBy(AttachmentSurfaces.class)
34-
public interface AttachmentSurface extends DefaultedRegistryValue, Comparable<AttachmentSurface> {
34+
public interface AttachmentSurface extends DefaultedRegistryValue, Comparable<AttachmentSurface>, StringRepresentable {
3535

3636
}

src/main/java/org/spongepowered/api/data/type/BambooLeavesType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
* Represents the type of leaves of a {@link BlockTypes#BAMBOO} block.
3333
*/
3434
@CatalogedBy(BambooLeavesTypes.class)
35-
public interface BambooLeavesType extends DefaultedRegistryValue, Comparable<BambooLeavesType> {
35+
public interface BambooLeavesType extends DefaultedRegistryValue, Comparable<BambooLeavesType>, StringRepresentable {
3636

3737
}

src/main/java/org/spongepowered/api/data/type/BellAttachmentType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
* Represents the attachment-type of a {@link BlockTypes#BELL} block.
3333
*/
3434
@CatalogedBy(BellAttachmentTypes.class)
35-
public interface BellAttachmentType extends DefaultedRegistryValue, Comparable<BellAttachmentType> {
35+
public interface BellAttachmentType extends DefaultedRegistryValue, Comparable<BellAttachmentType>, StringRepresentable {
3636

3737
}

src/main/java/org/spongepowered/api/data/type/ChestAttachmentType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
* chests into a double chests.
3535
*/
3636
@CatalogedBy(ChestAttachmentTypes.class)
37-
public interface ChestAttachmentType extends DefaultedRegistryValue, Comparable<ChestAttachmentType> {
37+
public interface ChestAttachmentType extends DefaultedRegistryValue, Comparable<ChestAttachmentType>, StringRepresentable {
3838

3939
}

src/main/java/org/spongepowered/api/data/type/ComparatorMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
import org.spongepowered.api.util.annotation.CatalogedBy;
2929

3030
@CatalogedBy(ComparatorModes.class)
31-
public interface ComparatorMode extends DefaultedRegistryValue, Comparable<ComparatorMode> {
31+
public interface ComparatorMode extends DefaultedRegistryValue, Comparable<ComparatorMode>, StringRepresentable {
3232

3333
}

src/main/java/org/spongepowered/api/data/type/DoorHinge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
* Represents a side of a hinge.
3333
*/
3434
@CatalogedBy(DoorHinges.class)
35-
public interface DoorHinge extends DefaultedRegistryValue, Cycleable<DoorHinge>, Comparable<DoorHinge> {
35+
public interface DoorHinge extends DefaultedRegistryValue, Cycleable<DoorHinge>, Comparable<DoorHinge>, StringRepresentable {
3636

3737
}

src/main/java/org/spongepowered/api/data/type/DripstoneSegment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
import org.spongepowered.api.util.annotation.CatalogedBy;
2929

3030
@CatalogedBy(DripstoneSegments.class)
31-
public interface DripstoneSegment extends DefaultedRegistryValue, Comparable<DripstoneSegment> {
31+
public interface DripstoneSegment extends DefaultedRegistryValue, Comparable<DripstoneSegment>, StringRepresentable {
3232

3333
}

src/main/java/org/spongepowered/api/data/type/InstrumentType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Represents a type of instrument.
3333
*/
3434
@CatalogedBy(InstrumentTypes.class)
35-
public interface InstrumentType extends DefaultedRegistryValue, Comparable<InstrumentType> {
35+
public interface InstrumentType extends DefaultedRegistryValue, Comparable<InstrumentType>, StringRepresentable {
3636

3737
/**
3838
* Gets the {@link SoundType} that is used by

src/main/java/org/spongepowered/api/data/type/JigsawBlockOrientation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Represents the front and top orientation of {@link BlockTypes#JIGSAW} blocks.
3434
*/
3535
@CatalogedBy(JigsawBlockOrientations.class)
36-
public interface JigsawBlockOrientation extends DefaultedRegistryValue, Comparable<JigsawBlockOrientation> {
36+
public interface JigsawBlockOrientation extends DefaultedRegistryValue, Comparable<JigsawBlockOrientation>, StringRepresentable {
3737

3838
/**
3939
* The front facing direction of a jigsaw block.

0 commit comments

Comments
 (0)