Skip to content

Commit a8c916b

Browse files
committed
BlockStateProperties are not in a registry
add missing API types for enum block states
1 parent a9f6309 commit a8c916b

31 files changed

+775
-2600
lines changed

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 {
34+
public interface AttachmentSurface extends DefaultedRegistryValue, Comparable<AttachmentSurface> {
3535

3636
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.block.BlockTypes;
28+
import org.spongepowered.api.registry.DefaultedRegistryValue;
29+
import org.spongepowered.api.util.annotation.CatalogedBy;
30+
31+
/**
32+
* Represents the type of leaves of a {@link BlockTypes#BAMBOO} block.
33+
*/
34+
@CatalogedBy(BambooLeavesTypes.class)
35+
public interface BambooLeavesType extends DefaultedRegistryValue, Comparable<BambooLeavesType> {
36+
37+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.ResourceKey;
28+
import org.spongepowered.api.Sponge;
29+
import org.spongepowered.api.registry.DefaultedRegistryReference;
30+
import org.spongepowered.api.registry.Registry;
31+
import org.spongepowered.api.registry.RegistryKey;
32+
import org.spongepowered.api.registry.RegistryScope;
33+
import org.spongepowered.api.registry.RegistryScopes;
34+
import org.spongepowered.api.registry.RegistryTypes;
35+
36+
@SuppressWarnings("unused")
37+
@RegistryScopes(scopes = RegistryScope.GAME)
38+
public final class BambooLeavesTypes {
39+
40+
// @formatter:off
41+
42+
public static final DefaultedRegistryReference<BambooLeavesType> NONE = BambooLeavesTypes.key(ResourceKey.sponge("none"));
43+
44+
public static final DefaultedRegistryReference<BambooLeavesType> SMALL = BambooLeavesTypes.key(ResourceKey.sponge("small"));
45+
46+
public static final DefaultedRegistryReference<BambooLeavesType> LARGE = BambooLeavesTypes.key(ResourceKey.sponge("large"));
47+
48+
// @formatter:on
49+
50+
private BambooLeavesTypes() {
51+
}
52+
53+
public static Registry<BambooLeavesType> registry() {
54+
return Sponge.game().registry(RegistryTypes.BAMBOO_LEAVES_TYPE);
55+
}
56+
57+
private static DefaultedRegistryReference<BambooLeavesType> key(final ResourceKey location) {
58+
return RegistryKey.of(RegistryTypes.BAMBOO_LEAVES_TYPE, location).asDefaultedReference(Sponge::game);
59+
}
60+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.block.BlockTypes;
28+
import org.spongepowered.api.registry.DefaultedRegistryValue;
29+
import org.spongepowered.api.util.annotation.CatalogedBy;
30+
31+
/**
32+
* Represents the attachment-type of a {@link BlockTypes#BELL} block.
33+
*/
34+
@CatalogedBy(BellAttachmentTypes.class)
35+
public interface BellAttachmentType extends DefaultedRegistryValue, Comparable<BellAttachmentType> {
36+
37+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.ResourceKey;
28+
import org.spongepowered.api.Sponge;
29+
import org.spongepowered.api.registry.DefaultedRegistryReference;
30+
import org.spongepowered.api.registry.Registry;
31+
import org.spongepowered.api.registry.RegistryKey;
32+
import org.spongepowered.api.registry.RegistryScope;
33+
import org.spongepowered.api.registry.RegistryScopes;
34+
import org.spongepowered.api.registry.RegistryTypes;
35+
36+
@SuppressWarnings("unused")
37+
@RegistryScopes(scopes = RegistryScope.GAME)
38+
public final class BellAttachmentTypes {
39+
40+
// @formatter:off
41+
42+
public static final DefaultedRegistryReference<BellAttachmentType> FLOOR = BellAttachmentTypes.key(ResourceKey.sponge("floor"));
43+
44+
public static final DefaultedRegistryReference<BellAttachmentType> CEILING = BellAttachmentTypes.key(ResourceKey.sponge("ceiling"));
45+
46+
public static final DefaultedRegistryReference<BellAttachmentType> SINGLE_WALL = BellAttachmentTypes.key(ResourceKey.sponge("single_wall"));
47+
48+
public static final DefaultedRegistryReference<BellAttachmentType> DOUBLE_WALL = BellAttachmentTypes.key(ResourceKey.sponge("double_wall"));
49+
50+
// @formatter:on
51+
52+
private BellAttachmentTypes() {
53+
}
54+
55+
public static Registry<BellAttachmentType> registry() {
56+
return Sponge.game().registry(RegistryTypes.BELL_ATTACHMENT_TYPE);
57+
}
58+
59+
private static DefaultedRegistryReference<BellAttachmentType> key(final ResourceKey location) {
60+
return RegistryKey.of(RegistryTypes.BELL_ATTACHMENT_TYPE, location).asDefaultedReference(Sponge::game);
61+
}
62+
}

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 {
37+
public interface ChestAttachmentType extends DefaultedRegistryValue, Comparable<ChestAttachmentType> {
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 {
31+
public interface ComparatorMode extends DefaultedRegistryValue, Comparable<ComparatorMode> {
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> {
35+
public interface DoorHinge extends DefaultedRegistryValue, Cycleable<DoorHinge>, Comparable<DoorHinge> {
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 {
31+
public interface DripstoneSegment extends DefaultedRegistryValue, Comparable<DripstoneSegment> {
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 {
35+
public interface InstrumentType extends DefaultedRegistryValue, Comparable<InstrumentType> {
3636

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

0 commit comments

Comments
 (0)