Skip to content

Commit 431ccf2

Browse files
committed
feat: merge API changes for 1.21.5
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
2 parents 02805ae + 5c9f033 commit 431ccf2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+942
-60
lines changed

src/main/java/org/spongepowered/api/block/BlockTypes.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,12 @@ public final class BlockTypes {
336336

337337
public static final DefaultedRegistryReference<BlockType> BUDDING_AMETHYST = BlockTypes.key(ResourceKey.minecraft("budding_amethyst"));
338338

339+
public static final DefaultedRegistryReference<BlockType> BUSH = BlockTypes.key(ResourceKey.minecraft("bush"));
340+
339341
public static final DefaultedRegistryReference<BlockType> CACTUS = BlockTypes.key(ResourceKey.minecraft("cactus"));
340342

343+
public static final DefaultedRegistryReference<BlockType> CACTUS_FLOWER = BlockTypes.key(ResourceKey.minecraft("cactus_flower"));
344+
341345
public static final DefaultedRegistryReference<BlockType> CAKE = BlockTypes.key(ResourceKey.minecraft("cake"));
342346

343347
public static final DefaultedRegistryReference<BlockType> CALCITE = BlockTypes.key(ResourceKey.minecraft("calcite"));
@@ -792,6 +796,8 @@ public final class BlockTypes {
792796

793797
public static final DefaultedRegistryReference<BlockType> FIRE = BlockTypes.key(ResourceKey.minecraft("fire"));
794798

799+
public static final DefaultedRegistryReference<BlockType> FIREFLY_BUSH = BlockTypes.key(ResourceKey.minecraft("firefly_bush"));
800+
795801
public static final DefaultedRegistryReference<BlockType> FIRE_CORAL = BlockTypes.key(ResourceKey.minecraft("fire_coral"));
796802

797803
public static final DefaultedRegistryReference<BlockType> FIRE_CORAL_BLOCK = BlockTypes.key(ResourceKey.minecraft("fire_coral_block"));
@@ -1006,6 +1012,8 @@ public final class BlockTypes {
10061012

10071013
public static final DefaultedRegistryReference<BlockType> LAVA_CAULDRON = BlockTypes.key(ResourceKey.minecraft("lava_cauldron"));
10081014

1015+
public static final DefaultedRegistryReference<BlockType> LEAF_LITTER = BlockTypes.key(ResourceKey.minecraft("leaf_litter"));
1016+
10091017
public static final DefaultedRegistryReference<BlockType> LECTERN = BlockTypes.key(ResourceKey.minecraft("lectern"));
10101018

10111019
public static final DefaultedRegistryReference<BlockType> LEVER = BlockTypes.key(ResourceKey.minecraft("lever"));
@@ -1770,6 +1778,8 @@ public final class BlockTypes {
17701778

17711779
public static final DefaultedRegistryReference<BlockType> SEA_PICKLE = BlockTypes.key(ResourceKey.minecraft("sea_pickle"));
17721780

1781+
public static final DefaultedRegistryReference<BlockType> SHORT_DRY_GRASS = BlockTypes.key(ResourceKey.minecraft("short_dry_grass"));
1782+
17731783
public static final DefaultedRegistryReference<BlockType> SHORT_GRASS = BlockTypes.key(ResourceKey.minecraft("short_grass"));
17741784

17751785
public static final DefaultedRegistryReference<BlockType> SHROOMLIGHT = BlockTypes.key(ResourceKey.minecraft("shroomlight"));
@@ -1956,6 +1966,8 @@ public final class BlockTypes {
19561966

19571967
public static final DefaultedRegistryReference<BlockType> SWEET_BERRY_BUSH = BlockTypes.key(ResourceKey.minecraft("sweet_berry_bush"));
19581968

1969+
public static final DefaultedRegistryReference<BlockType> TALL_DRY_GRASS = BlockTypes.key(ResourceKey.minecraft("tall_dry_grass"));
1970+
19591971
public static final DefaultedRegistryReference<BlockType> TALL_GRASS = BlockTypes.key(ResourceKey.minecraft("tall_grass"));
19601972

19611973
public static final DefaultedRegistryReference<BlockType> TALL_SEAGRASS = BlockTypes.key(ResourceKey.minecraft("tall_seagrass"));
@@ -1964,6 +1976,10 @@ public final class BlockTypes {
19641976

19651977
public static final DefaultedRegistryReference<BlockType> TERRACOTTA = BlockTypes.key(ResourceKey.minecraft("terracotta"));
19661978

1979+
public static final DefaultedRegistryReference<BlockType> TEST_BLOCK = BlockTypes.key(ResourceKey.minecraft("test_block"));
1980+
1981+
public static final DefaultedRegistryReference<BlockType> TEST_INSTANCE_BLOCK = BlockTypes.key(ResourceKey.minecraft("test_instance_block"));
1982+
19671983
public static final DefaultedRegistryReference<BlockType> TINTED_GLASS = BlockTypes.key(ResourceKey.minecraft("tinted_glass"));
19681984

19691985
public static final DefaultedRegistryReference<BlockType> TNT = BlockTypes.key(ResourceKey.minecraft("tnt"));
@@ -2192,6 +2208,8 @@ public final class BlockTypes {
21922208

21932209
public static final DefaultedRegistryReference<BlockType> WHITE_WOOL = BlockTypes.key(ResourceKey.minecraft("white_wool"));
21942210

2211+
public static final DefaultedRegistryReference<BlockType> WILDFLOWERS = BlockTypes.key(ResourceKey.minecraft("wildflowers"));
2212+
21952213
public static final DefaultedRegistryReference<BlockType> WITHER_ROSE = BlockTypes.key(ResourceKey.minecraft("wither_rose"));
21962214

21972215
public static final DefaultedRegistryReference<BlockType> WITHER_SKELETON_SKULL = BlockTypes.key(ResourceKey.minecraft("wither_skeleton_skull"));

src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public final class BlockEntityTypes {
124124

125125
public static final DefaultedRegistryReference<BlockEntityType> STRUCTURE_BLOCK = BlockEntityTypes.key(ResourceKey.minecraft("structure_block"));
126126

127+
public static final DefaultedRegistryReference<BlockEntityType> TEST_BLOCK = BlockEntityTypes.key(ResourceKey.minecraft("test_block"));
128+
129+
public static final DefaultedRegistryReference<BlockEntityType> TEST_INSTANCE_BLOCK = BlockEntityTypes.key(ResourceKey.minecraft("test_instance_block"));
130+
127131
public static final DefaultedRegistryReference<BlockEntityType> TRAPPED_CHEST = BlockEntityTypes.key(ResourceKey.minecraft("trapped_chest"));
128132

129133
public static final DefaultedRegistryReference<BlockEntityType> TRIAL_SPAWNER = BlockEntityTypes.key(ResourceKey.minecraft("trial_spawner"));

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.spongepowered.api.data.type.BellAttachmentType;
3131
import org.spongepowered.api.data.type.ChestAttachmentType;
3232
import org.spongepowered.api.data.type.ComparatorMode;
33+
import org.spongepowered.api.data.type.CreakingHeartState;
3334
import org.spongepowered.api.data.type.DoorHinge;
3435
import org.spongepowered.api.data.type.DripstoneSegment;
3536
import org.spongepowered.api.data.type.InstrumentType;
@@ -41,6 +42,7 @@
4142
import org.spongepowered.api.data.type.SlabPortion;
4243
import org.spongepowered.api.data.type.StairShape;
4344
import org.spongepowered.api.data.type.StructureMode;
45+
import org.spongepowered.api.data.type.TestBlockMode;
4446
import org.spongepowered.api.data.type.Tilt;
4547
import org.spongepowered.api.data.type.TrialSpawnerState;
4648
import org.spongepowered.api.data.type.VaultState;
@@ -56,8 +58,6 @@
5658
@SuppressWarnings("unused")
5759
public final class BlockStateKeys {
5860

59-
public static final Key<Value<Boolean>> ACTIVE = BlockStateKeys.key(ResourceKey.minecraft("property/active"), Boolean.class);
60-
6161
public static final Key<Value<Integer>> AGE_1 = BlockStateKeys.key(ResourceKey.minecraft("property/age"), Integer.class);
6262

6363
public static final Key<Value<Integer>> AGE_15 = BlockStateKeys.key(ResourceKey.minecraft("property/age"), Integer.class);
@@ -118,6 +118,8 @@ public final class BlockStateKeys {
118118

119119
public static final Key<Value<Boolean>> CRAFTING = BlockStateKeys.key(ResourceKey.minecraft("property/crafting"), Boolean.class);
120120

121+
public static final Key<Value<CreakingHeartState>> CREAKING_HEART_STATE = BlockStateKeys.key(ResourceKey.minecraft("property/creaking_heart_state"), CreakingHeartState.class);
122+
121123
public static final Key<Value<Integer>> DELAY = BlockStateKeys.key(ResourceKey.minecraft("property/delay"), Integer.class);
122124

123125
public static final Key<Value<Boolean>> DISARMED = BlockStateKeys.key(ResourceKey.minecraft("property/disarmed"), Boolean.class);
@@ -198,6 +200,8 @@ public final class BlockStateKeys {
198200

199201
public static final Key<Value<Boolean>> LOCKED = BlockStateKeys.key(ResourceKey.minecraft("property/locked"), Boolean.class);
200202

203+
public static final Key<Value<Boolean>> MAP = BlockStateKeys.key(ResourceKey.minecraft("property/map"), Boolean.class);
204+
201205
public static final Key<Value<ComparatorMode>> MODE_COMPARATOR = BlockStateKeys.key(ResourceKey.minecraft("property/mode"), ComparatorMode.class);
202206

203207
public static final Key<Value<Integer>> MOISTURE = BlockStateKeys.key(ResourceKey.minecraft("property/moisture"), Integer.class);
@@ -242,6 +246,8 @@ public final class BlockStateKeys {
242246

243247
public static final Key<Value<SculkSensorState>> SCULK_SENSOR_PHASE = BlockStateKeys.key(ResourceKey.minecraft("property/sculk_sensor_phase"), SculkSensorState.class);
244248

249+
public static final Key<Value<Integer>> SEGMENT_AMOUNT = BlockStateKeys.key(ResourceKey.minecraft("property/segment_amount"), Integer.class);
250+
245251
public static final Key<Value<Boolean>> SHORT = BlockStateKeys.key(ResourceKey.minecraft("property/short"), Boolean.class);
246252

247253
public static final Key<Value<Boolean>> SHRIEKING = BlockStateKeys.key(ResourceKey.minecraft("property/shrieking"), Boolean.class);
@@ -266,6 +272,8 @@ public final class BlockStateKeys {
266272

267273
public static final Key<Value<StructureMode>> STRUCTUREBLOCK_MODE = BlockStateKeys.key(ResourceKey.minecraft("property/mode"), StructureMode.class);
268274

275+
public static final Key<Value<TestBlockMode>> TEST_BLOCK_MODE = BlockStateKeys.key(ResourceKey.minecraft("property/mode"), TestBlockMode.class);
276+
269277
public static final Key<Value<Tilt>> TILT = BlockStateKeys.key(ResourceKey.minecraft("property/tilt"), Tilt.class);
270278

271279
public static final Key<Value<Boolean>> TIP = BlockStateKeys.key(ResourceKey.minecraft("property/tip"), Boolean.class);

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import org.spongepowered.api.data.type.ParrotType;
8181
import org.spongepowered.api.data.type.PhantomPhase;
8282
import org.spongepowered.api.data.type.PickupRule;
83+
import org.spongepowered.api.data.type.PigType;
8384
import org.spongepowered.api.data.type.PistonType;
8485
import org.spongepowered.api.data.type.PortionType;
8586
import org.spongepowered.api.data.type.ProfessionType;
@@ -100,6 +101,7 @@
100101
import org.spongepowered.api.data.type.VillagerType;
101102
import org.spongepowered.api.data.type.WallConnectionState;
102103
import org.spongepowered.api.data.type.WireAttachmentType;
104+
import org.spongepowered.api.data.type.WolfSoundVariant;
103105
import org.spongepowered.api.data.type.WolfVariant;
104106
import org.spongepowered.api.data.value.ListValue;
105107
import org.spongepowered.api.data.value.MapValue;
@@ -2655,6 +2657,14 @@ public final class Keys {
26552657
*/
26562658
public static final Key<Value<PickupRule>> PICKUP_RULE = Keys.key(ResourceKey.sponge("pickup_rule"), PickupRule.class);
26572659

2660+
/**
2661+
* The {@link PigType} for a {@link Pig}, which can vary based on
2662+
* {@link Biome}.
2663+
*
2664+
* @see <a href="https://minecraft.wiki/w/Java_Edition_25w02a#Mobs">Pig Variant Changes</a>
2665+
*/
2666+
public static final Key<Value<PigType>> PIG_TYPE = Keys.key(ResourceKey.sponge("pig_variant"), PigType.class);
2667+
26582668
/**
26592669
* Whether a {@link WorldType} is safe for {@link Piglin} to not transform
26602670
* into {@link ZombifiedPiglin} over time in a {@link ServerWorld world} of that type
@@ -3544,6 +3554,13 @@ public final class Keys {
35443554
*/
35453555
public static final Key<Value<WolfVariant>> WOLF_VARIANT = Keys.key(ResourceKey.sponge("wolf_variant"), WolfVariant.class);
35463556

3557+
/**
3558+
* The {@link WolfSoundVariant} of a {@link Wolf}.
3559+
*
3560+
* @see <a href="https://minecraft.wiki/w/Wolf#Sound_variants_2">Wolves wiki</a>
3561+
*/
3562+
public static final Key<Value<WolfSoundVariant>> WOLF_SOUND_VARIANT = Keys.key(ResourceKey.sponge("wolf_sound_variant"), WolfSoundVariant.class);
3563+
35473564
/**
35483565
* The {@link Sheep} who is being targeted by the {@link SpellTypes#WOLOLO}
35493566
* spell being casted by an {@link Evoker}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ public class AxolotlVariants {
4545

4646
public static final DefaultedRegistryReference<AxolotlVariant> WILD = AxolotlVariants.key(ResourceKey.sponge("wild"));
4747

48-
4948
private static DefaultedRegistryReference<AxolotlVariant> key(final ResourceKey location) {
5049
return RegistryKey.of(RegistryTypes.AXOLOTL_VARIANT, location).asDefaultedReference(Sponge::game);
5150
}
52-
5351
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* <!-- This file is automatically generated. Any manual changes will be overwritten. -->
3838
*/
3939
@SuppressWarnings("unused")
40-
@RegistryScopes(scopes = RegistryScope.GAME)
40+
@RegistryScopes(scopes = RegistryScope.ENGINE)
4141
public final class CatTypes {
4242

4343
public static final DefaultedRegistryReference<CatType> ALL_BLACK = CatTypes.key(ResourceKey.minecraft("all_black"));
@@ -66,10 +66,10 @@ private CatTypes() {
6666
}
6767

6868
public static Registry<CatType> registry() {
69-
return Sponge.game().registry(RegistryTypes.CAT_TYPE);
69+
return Sponge.server().registry(RegistryTypes.CAT_TYPE);
7070
}
7171

7272
private static DefaultedRegistryReference<CatType> key(final ResourceKey location) {
73-
return RegistryKey.of(RegistryTypes.CAT_TYPE, location).asDefaultedReference(Sponge::game);
73+
return RegistryKey.of(RegistryTypes.CAT_TYPE, location).asDefaultedReference(Sponge::server);
7474
}
7575
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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(ChickenVariants.class)
31+
public interface ChickenVariant extends DefaultedRegistryValue {
32+
}
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.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.ENGINE)
38+
public final class ChickenVariants {
39+
40+
public static final DefaultedRegistryReference<ChickenVariant> COLD = ChickenVariants.key(ResourceKey.minecraft("cold"));
41+
42+
public static final DefaultedRegistryReference<ChickenVariant> TEMPERATE = ChickenVariants.key(ResourceKey.minecraft("temperate"));
43+
44+
public static final DefaultedRegistryReference<ChickenVariant> WARM = ChickenVariants.key(ResourceKey.minecraft("warm"));
45+
46+
private ChickenVariants() {
47+
}
48+
49+
public static Registry<ChickenVariant> registry() {
50+
return Sponge.server().registry(RegistryTypes.CHICKEN_VARIANT);
51+
}
52+
53+
private static DefaultedRegistryReference<ChickenVariant> key(final ResourceKey location) {
54+
return RegistryKey.of(RegistryTypes.CHICKEN_VARIANT, location).asDefaultedReference(Sponge::server);
55+
}
56+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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(CowVariants.class)
31+
public interface CowVariant extends DefaultedRegistryValue {
32+
}

0 commit comments

Comments
 (0)