Skip to content

Commit a9029e3

Browse files
committed
wip updating block state properties
1 parent 5bdb64e commit a9029e3

File tree

8 files changed

+315
-2
lines changed

8 files changed

+315
-2
lines changed

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import org.spongepowered.api.data.type.ChestAttachmentType;
5858
import org.spongepowered.api.data.type.ComparatorMode;
5959
import org.spongepowered.api.data.type.DoorHinge;
60+
import org.spongepowered.api.data.type.DripstoneSegment;
6061
import org.spongepowered.api.data.type.DyeColor;
6162
import org.spongepowered.api.data.type.FoxType;
6263
import org.spongepowered.api.data.type.HandPreference;
@@ -78,12 +79,14 @@
7879
import org.spongepowered.api.data.type.ProfessionType;
7980
import org.spongepowered.api.data.type.RabbitType;
8081
import org.spongepowered.api.data.type.RailDirection;
82+
import org.spongepowered.api.data.type.SculkSensorState;
8183
import org.spongepowered.api.data.type.SkinPart;
8284
import org.spongepowered.api.data.type.SlabPortion;
8385
import org.spongepowered.api.data.type.SpellType;
8486
import org.spongepowered.api.data.type.SpellTypes;
8587
import org.spongepowered.api.data.type.StairShape;
8688
import org.spongepowered.api.data.type.StructureMode;
89+
import org.spongepowered.api.data.type.Tilt;
8790
import org.spongepowered.api.data.type.TropicalFishShape;
8891
import org.spongepowered.api.data.type.VillagerType;
8992
import org.spongepowered.api.data.type.WireAttachmentType;
@@ -514,6 +517,11 @@ public final class Keys {
514517
*/
515518
public static final Key<Value<Boolean>> CAN_PLACE_AS_BLOCK = Keys.key(ResourceKey.sponge("can_place_as_block"), Boolean.class);
516519

520+
/**
521+
* The number of candles within a candle block.
522+
*/
523+
public static final Key<Value<Integer>> CANDLES = Keys.key(ResourceKey.sponge("candles"), Integer.class);
524+
517525
/**
518526
* The current casting time of a {@link Spellcaster}.
519527
*/
@@ -694,6 +702,11 @@ public final class Keys {
694702
*/
695703
public static final Key<Value<Boolean>> DO_EXACT_TELEPORT = Keys.key(ResourceKey.sponge("do_exact_teleport"), Boolean.class);
696704

705+
/**
706+
* The type of dripstone a certain {@link BlockTypes#DRIPSTONE_BLOCK} represents.
707+
*/
708+
public static final Key<Value<DripstoneSegment>> DRIPSTONE_SEGMENT = Keys.key(ResourceKey.sponge("dripstone_segment"), DripstoneSegment.class);
709+
697710
/**
698711
* The remaining duration (in ticks) of an {@link AreaEffectCloud}.
699712
*/
@@ -943,6 +956,12 @@ public final class Keys {
943956
*/
944957
public static final Key<Value<Boolean>> HAS_BASE_PLATE = Keys.key(ResourceKey.sponge("has_base_plate"), Boolean.class);
945958

959+
/**
960+
* Whether a {@link BlockTypes#CAVE_VINES} or
961+
* {@link BlockTypes#CAVE_VINES_PLANT} has glow berries.
962+
*/
963+
public static final Key<Value<Boolean>> HAS_BERRIES = Keys.key(ResourceKey.sponge("has_berries"), Boolean.class);
964+
946965
/**
947966
* Whether a {@link PackHorse} has a chest.
948967
*/
@@ -2287,6 +2306,11 @@ public final class Keys {
22872306
*/
22882307
public static final Key<SetValue<String>> SCOREBOARD_TAGS = Keys.setKey(ResourceKey.sponge("scoreboard_tags"), String.class);
22892308

2309+
/**
2310+
* The triggering state of a {@link BlockTypes#SCULK_SENSOR}.
2311+
*/
2312+
public static final Key<Value<SculkSensorState>> SCULK_SENSOR_STATE = Keys.key(ResourceKey.sponge("sculk_sensor_state"), SculkSensorState.class);
2313+
22902314
/**
22912315
* A {@link Beacon}'s secondary effect.
22922316
*/
@@ -2303,7 +2327,7 @@ public final class Keys {
23032327
public static final Key<Value<ProjectileSource>> SHOOTER = Keys.key(ResourceKey.sponge("shooter"), ProjectileSource.class);
23042328

23052329
/**
2306-
* Whether a {@link EndCrystal} should show it's bottom bedrock platform.
2330+
* Whether a {@link EndCrystal} should show its bottom bedrock platform.
23072331
*/
23082332
public static final Key<Value<Boolean>> SHOW_BOTTOM = Keys.key(ResourceKey.sponge("show_bottom"), Boolean.class);
23092333

@@ -2553,6 +2577,12 @@ public final class Keys {
25532577
*/
25542578
public static final Key<Value<Ticks>> TICKS_REMAINING = Keys.key(ResourceKey.sponge("ticks_remaining"), Ticks.class);
25552579

2580+
/**
2581+
* The tilt of a {@link BlockTypes#BIG_DRIPLEAF} block, as triggered by
2582+
* player motion.
2583+
*/
2584+
public static final Key<Value<Tilt>> TILT = Keys.key(ResourceKey.sponge("tilt"), Tilt.class);
2585+
25562586
/**
25572587
* The {@link ItemTier} of an {@link ItemStack} tool.
25582588
* Readonly
@@ -2606,9 +2636,16 @@ public final class Keys {
26062636
*/
26072637
public static final Key<Value<Boolean>> UNSTABLE = Keys.key(ResourceKey.sponge("unstable"), Boolean.class);
26082638

2639+
/**
2640+
* Whether a {@link BlockTypes#POINTED_DRIPSTONE} is facing up or down.
2641+
*
2642+
* <p>Only supports {@link Direction#UP} or {@link Direction#DOWN}</p>
2643+
*/
2644+
public static final Key<Value<Direction>> UP_OR_DOWN = Keys.key(ResourceKey.sponge("up_or_down"), Direction.class);
2645+
26092646
/**
26102647
* Whether changes to {@link Keys#SKIN_PROFILE_PROPERTY} should
2611-
* be reflected in an entitie's {@link GameProfile}.
2648+
* be reflected in an entity's {@link GameProfile}.
26122649
*/
26132650
public static final Key<Value<Boolean>> UPDATE_GAME_PROFILE = Keys.key(ResourceKey.sponge("update_game_profile"), Boolean.class);
26142651

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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.registry.DefaultedRegistryValue;
28+
import org.spongepowered.api.util.annotation.CatalogedBy;
29+
30+
@CatalogedBy(DripstoneSegments.class)
31+
public interface DripstoneSegment extends DefaultedRegistryValue {
32+
33+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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.RegistryKey;
31+
import org.spongepowered.api.registry.RegistryTypes;
32+
33+
public final class DripstoneSegments {
34+
35+
public static final DefaultedRegistryReference<DripstoneSegment> TIP_MERGE = DripstoneSegments.key(ResourceKey.sponge("tip_merge"));
36+
37+
public static final DefaultedRegistryReference<DripstoneSegment> TIP = DripstoneSegments.key(ResourceKey.sponge("tip"));
38+
39+
public static final DefaultedRegistryReference<DripstoneSegment> FRUSTUM = DripstoneSegments.key(ResourceKey.sponge("frustum"));
40+
41+
public static final DefaultedRegistryReference<DripstoneSegment> MIDDLE = DripstoneSegments.key(ResourceKey.sponge("middle"));
42+
43+
public static final DefaultedRegistryReference<DripstoneSegment> BASE = DripstoneSegments.key(ResourceKey.sponge("base"));
44+
45+
private DripstoneSegments() {
46+
}
47+
48+
private static DefaultedRegistryReference<DripstoneSegment> key(final ResourceKey location) {
49+
return RegistryKey.of(RegistryTypes.DRIPSTONE_SEGMENT, location).asDefaultedReference(() -> Sponge.game().registries());
50+
}
51+
52+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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.registry.DefaultedRegistryValue;
28+
import org.spongepowered.api.util.annotation.CatalogedBy;
29+
30+
@CatalogedBy(SculkSensorStates.class)
31+
public interface SculkSensorState extends DefaultedRegistryValue {
32+
33+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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.RegistryKey;
31+
import org.spongepowered.api.registry.RegistryTypes;
32+
33+
public final class SculkSensorStates {
34+
35+
// @formatter:off
36+
// SORTFIELDS:ON
37+
38+
public static final DefaultedRegistryReference<SculkSensorState> INACTIVE = SculkSensorStates.key(ResourceKey.sponge("inactive"));
39+
40+
public static final DefaultedRegistryReference<SculkSensorState> ACTIVE = SculkSensorStates.key(ResourceKey.sponge("active"));
41+
42+
public static final DefaultedRegistryReference<SculkSensorState> COOLDOWN = SculkSensorStates.key(ResourceKey.sponge("cooldown"));
43+
44+
// SORTFIELDS:OFF
45+
// @formatter:on
46+
47+
private SculkSensorStates() {
48+
}
49+
50+
private static DefaultedRegistryReference<SculkSensorState> key(final ResourceKey location) {
51+
return RegistryKey.of(RegistryTypes.SCULK_SENSOR_STATE, location).asDefaultedReference(() -> Sponge.game().registries());
52+
}
53+
54+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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.registry.DefaultedRegistryValue;
28+
import org.spongepowered.api.util.annotation.CatalogedBy;
29+
30+
@CatalogedBy(Tilts.class)
31+
public interface Tilt extends DefaultedRegistryValue {
32+
33+
/**
34+
* {@return Whether a block entering this tilt state will trigger any
35+
* vibration-based blocks}.
36+
*/
37+
boolean triggersVibrations();
38+
39+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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.RegistryKey;
31+
import org.spongepowered.api.registry.RegistryTypes;
32+
33+
public final class Tilts {
34+
35+
// @formatter:off
36+
// SORTFIELDS:ON
37+
38+
public static final DefaultedRegistryReference<Tilt> NONE = Tilts.key(ResourceKey.sponge("none"));
39+
40+
public static final DefaultedRegistryReference<Tilt> UNSTABLE = Tilts.key(ResourceKey.sponge("unstable"));
41+
42+
public static final DefaultedRegistryReference<Tilt> PARTIAL = Tilts.key(ResourceKey.sponge("partial"));
43+
44+
public static final DefaultedRegistryReference<Tilt> FULL = Tilts.key(ResourceKey.sponge("full"));
45+
46+
// SORTFIELDS:OFF
47+
// @formatter:on
48+
49+
private Tilts() {
50+
}
51+
52+
private static DefaultedRegistryReference<Tilt> key(final ResourceKey location) {
53+
return RegistryKey.of(RegistryTypes.TILT, location).asDefaultedReference(() -> Sponge.game().registries());
54+
}
55+
56+
}

0 commit comments

Comments
 (0)