Skip to content

Commit a0493bd

Browse files
committed
feat(minecraft): update game content to 1.21.9
See: https://minecraft.wiki/w/Java_Edition_1.21.9
2 parents fd8795b + 1e5c916 commit a0493bd

39 files changed

+1207
-57
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ junit-launcher = { module = "org.junit.platform:junit-platform-launcher" }
5656
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
5757

5858
[plugins]
59-
errorprone = { id = "net.ltgt.errorprone", version = "3.1.0" }
59+
errorprone = { id = "net.ltgt.errorprone", version = "4.3.0" }
6060
eventImplGen = { id = "org.spongepowered.gradle.event-impl-gen", version = "7.1.0" }
6161
ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExt" }
6262
indra-checkstyle = { id = "net.kyori.indra.checkstyle", version.ref = "indra" }

gradle/verification-metadata.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,11 @@
13881388
<sha256 value="8776a213deaa1cbbadb77820225211e1b9adead2341b55cc35bc92c9076620a3" origin="Generated by Gradle"/>
13891389
</artifact>
13901390
</component>
1391+
<component group="net.ltgt.errorprone" name="net.ltgt.errorprone.gradle.plugin" version="4.3.0">
1392+
<artifact name="net.ltgt.errorprone.gradle.plugin-4.3.0.pom">
1393+
<sha256 value="3370e20ef3213ffce47f7fda31266c33e9cca3b1b7f4d54169b482277042654b" origin="Generated by Gradle"/>
1394+
</artifact>
1395+
</component>
13911396
<component group="net.ltgt.gradle" name="gradle-errorprone-plugin" version="3.1.0">
13921397
<artifact name="gradle-errorprone-plugin-3.1.0.jar">
13931398
<sha256 value="10fb66b55747ced1db9c89c8c3d0adb5dbd3f8f12f2a183bee2b5ff818d1fd6c" origin="Generated by Gradle"/>
@@ -1396,6 +1401,14 @@
13961401
<sha256 value="d393a0d3337193cb21b64a98714a1da8a966349be214cbb16171a9925a7985ee" origin="Generated by Gradle"/>
13971402
</artifact>
13981403
</component>
1404+
<component group="net.ltgt.gradle" name="gradle-errorprone-plugin" version="4.3.0">
1405+
<artifact name="gradle-errorprone-plugin-4.3.0.jar">
1406+
<sha256 value="42f89c1f582ecd09459586d3d19c0fa92a332035e4a70b5699a8ec6a81aec32c" origin="Generated by Gradle"/>
1407+
</artifact>
1408+
<artifact name="gradle-errorprone-plugin-4.3.0.module">
1409+
<sha256 value="6d2b0a7809ffde227ec15a4cf28e68929be22a1a12a0f56ad5e795d5058f2f6e" origin="Generated by Gradle"/>
1410+
</artifact>
1411+
</component>
13991412
<component group="net.sf.saxon" name="Saxon-HE" version="12.4">
14001413
<artifact name="Saxon-HE-12.4.jar">
14011414
<sha256 value="575f8b696e3b6f9aa7a3bf01611b8bf1b84576b55ce29bc16656a53a147ef441" origin="Generated by Gradle"/>

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

Lines changed: 124 additions & 2 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public final class BlockEntityTypes {
7272

7373
public static final DefaultedRegistryReference<BlockEntityType> CONDUIT = BlockEntityTypes.key(ResourceKey.minecraft("conduit"));
7474

75+
public static final DefaultedRegistryReference<BlockEntityType> COPPER_GOLEM_STATUE = BlockEntityTypes.key(ResourceKey.minecraft("copper_golem_statue"));
76+
7577
public static final DefaultedRegistryReference<BlockEntityType> CRAFTER = BlockEntityTypes.key(ResourceKey.minecraft("crafter"));
7678

7779
public static final DefaultedRegistryReference<BlockEntityType> CREAKING_HEART = BlockEntityTypes.key(ResourceKey.minecraft("creaking_heart"));
@@ -114,6 +116,8 @@ public final class BlockEntityTypes {
114116

115117
public static final DefaultedRegistryReference<BlockEntityType> SCULK_SHRIEKER = BlockEntityTypes.key(ResourceKey.minecraft("sculk_shrieker"));
116118

119+
public static final DefaultedRegistryReference<BlockEntityType> SHELF = BlockEntityTypes.key(ResourceKey.minecraft("shelf"));
120+
117121
public static final DefaultedRegistryReference<BlockEntityType> SHULKER_BOX = BlockEntityTypes.key(ResourceKey.minecraft("shulker_box"));
118122

119123
public static final DefaultedRegistryReference<BlockEntityType> SIGN = BlockEntityTypes.key(ResourceKey.minecraft("sign"));

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

Lines changed: 18 additions & 12 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.CopperGolemPose;
3334
import org.spongepowered.api.data.type.CreakingHeartState;
3435
import org.spongepowered.api.data.type.DoorHinge;
3536
import org.spongepowered.api.data.type.DripstoneSegment;
@@ -39,6 +40,7 @@
3940
import org.spongepowered.api.data.type.PortionType;
4041
import org.spongepowered.api.data.type.RailDirection;
4142
import org.spongepowered.api.data.type.SculkSensorState;
43+
import org.spongepowered.api.data.type.SideChain;
4244
import org.spongepowered.api.data.type.SlabPortion;
4345
import org.spongepowered.api.data.type.StairShape;
4446
import org.spongepowered.api.data.type.StructureMode;
@@ -100,20 +102,10 @@ public final class BlockStateKeys {
100102

101103
public static final Key<Value<ChestAttachmentType>> CHEST_TYPE = BlockStateKeys.key(ResourceKey.minecraft("property/type"), ChestAttachmentType.class);
102104

103-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_0_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_0_occupied"), Boolean.class);
104-
105-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_1_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_1_occupied"), Boolean.class);
106-
107-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_2_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_2_occupied"), Boolean.class);
108-
109-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_3_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_3_occupied"), Boolean.class);
110-
111-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_4_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_4_occupied"), Boolean.class);
112-
113-
public static final Key<Value<Boolean>> CHISELED_BOOKSHELF_SLOT_5_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_5_occupied"), Boolean.class);
114-
115105
public static final Key<Value<Boolean>> CONDITIONAL = BlockStateKeys.key(ResourceKey.minecraft("property/conditional"), Boolean.class);
116106

107+
public static final Key<Value<CopperGolemPose>> COPPER_GOLEM_POSE = BlockStateKeys.key(ResourceKey.minecraft("property/copper_golem_pose"), CopperGolemPose.class);
108+
117109
public static final Key<Value<Boolean>> CRACKED = BlockStateKeys.key(ResourceKey.minecraft("property/cracked"), Boolean.class);
118110

119111
public static final Key<Value<Boolean>> CRAFTING = BlockStateKeys.key(ResourceKey.minecraft("property/crafting"), Boolean.class);
@@ -254,10 +246,24 @@ public final class BlockStateKeys {
254246

255247
public static final Key<Value<Boolean>> SHRIEKING = BlockStateKeys.key(ResourceKey.minecraft("property/shrieking"), Boolean.class);
256248

249+
public static final Key<Value<SideChain>> SIDE_CHAIN_PART = BlockStateKeys.key(ResourceKey.minecraft("property/side_chain"), SideChain.class);
250+
257251
public static final Key<Value<Boolean>> SIGNAL_FIRE = BlockStateKeys.key(ResourceKey.minecraft("property/signal_fire"), Boolean.class);
258252

259253
public static final Key<Value<SlabPortion>> SLAB_TYPE = BlockStateKeys.key(ResourceKey.minecraft("property/type"), SlabPortion.class);
260254

255+
public static final Key<Value<Boolean>> SLOT_0_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_0_occupied"), Boolean.class);
256+
257+
public static final Key<Value<Boolean>> SLOT_1_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_1_occupied"), Boolean.class);
258+
259+
public static final Key<Value<Boolean>> SLOT_2_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_2_occupied"), Boolean.class);
260+
261+
public static final Key<Value<Boolean>> SLOT_3_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_3_occupied"), Boolean.class);
262+
263+
public static final Key<Value<Boolean>> SLOT_4_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_4_occupied"), Boolean.class);
264+
265+
public static final Key<Value<Boolean>> SLOT_5_OCCUPIED = BlockStateKeys.key(ResourceKey.minecraft("property/slot_5_occupied"), Boolean.class);
266+
261267
public static final Key<Value<Boolean>> SNOWY = BlockStateKeys.key(ResourceKey.minecraft("property/snowy"), Boolean.class);
262268

263269
public static final Key<Value<Boolean>> SOUTH = BlockStateKeys.key(ResourceKey.minecraft("property/south"), Boolean.class);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public interface DataManager {
131131
* be read by a plugin-data datastore.
132132
*
133133
* @param legacyId The legacy id
134-
* @param dataStoreKey The dataStore key set in {@link org.spongepowered.api.data.persistence.DataStore.Builder.HolderStep#pluginData(ResourceKey)}
134+
* @param dataStoreKey The dataStore key set in {@link org.spongepowered.api.data.persistence.DataStore.Builder#pluginData(ResourceKey)}
135135
*/
136136
void registerLegacyManipulatorIds(String legacyId, ResourceKey dataStoreKey);
137137

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import org.spongepowered.api.data.type.CatType;
6262
import org.spongepowered.api.data.type.ChestAttachmentType;
6363
import org.spongepowered.api.data.type.ComparatorMode;
64+
import org.spongepowered.api.data.type.CopperOxidation;
6465
import org.spongepowered.api.data.type.DoorHinge;
6566
import org.spongepowered.api.data.type.DripstoneSegment;
6667
import org.spongepowered.api.data.type.DyeColor;
@@ -90,6 +91,8 @@
9091
import org.spongepowered.api.data.type.RailDirection;
9192
import org.spongepowered.api.data.type.SalmonSize;
9293
import org.spongepowered.api.data.type.SculkSensorState;
94+
import org.spongepowered.api.data.type.ShieldDamageReduction;
95+
import org.spongepowered.api.data.type.ShieldItemDamageFunction;
9396
import org.spongepowered.api.data.type.SkinPart;
9497
import org.spongepowered.api.data.type.SlabPortion;
9598
import org.spongepowered.api.data.type.SpellType;
@@ -174,6 +177,7 @@
174177
import org.spongepowered.api.entity.living.aquatic.fish.Pufferfish;
175178
import org.spongepowered.api.entity.living.aquatic.fish.school.Salmon;
176179
import org.spongepowered.api.entity.living.aquatic.fish.school.TropicalFish;
180+
import org.spongepowered.api.entity.living.golem.CopperGolem;
177181
import org.spongepowered.api.entity.living.golem.IronGolem;
178182
import org.spongepowered.api.entity.living.golem.Shulker;
179183
import org.spongepowered.api.entity.living.monster.Blaze;
@@ -224,6 +228,7 @@
224228
import org.spongepowered.api.entity.vehicle.minecart.Minecart;
225229
import org.spongepowered.api.entity.vehicle.minecart.MinecartLike;
226230
import org.spongepowered.api.entity.weather.LightningBolt;
231+
import org.spongepowered.api.event.cause.entity.damage.DamageType;
227232
import org.spongepowered.api.event.cause.entity.damage.source.DamageSource;
228233
import org.spongepowered.api.event.cause.entity.damage.source.DamageSources;
229234
import org.spongepowered.api.fluid.FluidStackSnapshot;
@@ -257,6 +262,7 @@
257262
import org.spongepowered.api.raid.RaidWave;
258263
import org.spongepowered.api.registry.DefaultedRegistryType;
259264
import org.spongepowered.api.statistic.Statistic;
265+
import org.spongepowered.api.tag.BlockTypeTags;
260266
import org.spongepowered.api.tag.Tag;
261267
import org.spongepowered.api.util.Axis;
262268
import org.spongepowered.api.util.Color;
@@ -639,6 +645,11 @@ public final class Keys {
639645
*/
640646
public static final Key<Value<Integer>> BURN_TIME = Keys.key(ResourceKey.sponge("burn_time"), Integer.class);
641647

648+
/**
649+
* The {@link DamageType} tag that bypasses a shield-like {@link ItemStack}.
650+
*/
651+
public static final Key<Value<Tag<DamageType>>> BYPASS_DAMAGE_TAG = Keys.key(ResourceKey.sponge("bypass_damage_tag"), new TypeToken<>() {});
652+
642653
/**
643654
* Whether an {@link ItemStack} can always be eaten.
644655
*/
@@ -794,6 +805,13 @@ public final class Keys {
794805
*/
795806
public static final Key<Value<ItemType>> CONTAINER_ITEM = Keys.key(ResourceKey.sponge("container_item"), ItemType.class);
796807

808+
/**
809+
* The {@link CopperOxidation} state of a {@link BlockState block}
810+
* (given that it applies to the {@link BlockTypeTags#COPPER} tag) or
811+
* a {@link CopperGolem}
812+
*/
813+
public static final Key<Value<CopperOxidation>> COPPER_OXIDATION = Keys.key(ResourceKey.sponge("copper_oxidation"), CopperOxidation.class);
814+
797815
/**
798816
* The {@link ItemStack} a food {@link ItemStack} converts to when eaten.
799817
*/
@@ -976,6 +994,17 @@ public final class Keys {
976994
*/
977995
public static final Key<Value<Direction>> DIRECTION = Keys.key(ResourceKey.sponge("direction"), Direction.class);
978996

997+
/**
998+
* The amount of {@link Ticks} this {@link ItemStack} disables blocking with a shield-like {@link ItemStack} on a successful attack.
999+
*/
1000+
public static final Key<Value<Ticks>> DISABLE_SHIELD_TICKS = Keys.key(ResourceKey.sponge("disable_shield_ticks"), Ticks.class);
1001+
1002+
/**
1003+
* The multiplier applied to the cooldown time during which blocking using this shield-like {@link ItemStack} is disabled.
1004+
* If set to 0, this item can never be disabled by attacks.
1005+
*/
1006+
public static final Key<Value<Double>> DISABLE_SHIELD_TICKS_SCALE = Keys.key(ResourceKey.sponge("disable_shield_ticks_scale"), Double.class);
1007+
9791008
/**
9801009
* The display name of an {@link Entity}, {@link ItemStack} or {@link BlockEntity}.
9811010
*
@@ -3046,6 +3075,31 @@ public final class Keys {
30463075
*/
30473076
public static final Key<Value<Double>> SHADOW_STRENGTH = Keys.key(ResourceKey.sponge("shadow_strength"), Double.class);
30483077

3078+
/**
3079+
* The sound played when blocking an attack with a shield-like {@link ItemStack}.
3080+
*/
3081+
public static final Key<Value<SoundType>> SHIELD_BLOCK_SOUND = Keys.key(ResourceKey.sponge("shield_block_sound"), SoundType.class);
3082+
3083+
/**
3084+
* The amount of attack damage a shield-like {@link ItemStack} reduces for certain {@link DamageType}s
3085+
*/
3086+
public static final Key<ListValue<ShieldDamageReduction<?>>> SHIELD_DAMAGE_REDUCTIONS = Keys.listKey(ResourceKey.sponge("shield_damage_reductions"), new TypeToken<>() {});
3087+
3088+
/**
3089+
* The amount of {@link Ticks} player must use this shield-like {@link ItemStack} for to block attacks successfully.
3090+
*/
3091+
public static final Key<Value<Ticks>> SHIELD_DEPLOY_TICKS = Keys.key(ResourceKey.sponge("shield_deploy_ticks"), Ticks.class);
3092+
3093+
/**
3094+
* The sound played when a shield-like {@link ItemStack} is disabled.
3095+
*/
3096+
public static final Key<Value<SoundType>> SHIELD_DISABLE_SOUND = Keys.key(ResourceKey.sponge("shield_disable_sound"), SoundType.class);
3097+
3098+
/**
3099+
* Function for the amount of {@link Keys#ITEM_DURABILITY} damage a shield-like {@link ItemStack} takes when blocking an attack.
3100+
*/
3101+
public static final Key<Value<ShieldItemDamageFunction<?>>> SHIELD_ITEM_DAMAGE_FUNCTION = Keys.key(ResourceKey.sponge("shield_item_damage_function"), new TypeToken<>() {});
3102+
30493103
/**
30503104
* The shooter of a {@link Projectile}.
30513105
*/
@@ -3534,6 +3588,17 @@ public final class Keys {
35343588
*/
35353589
public static final Key<Value<Color>> WATER_FOG_COLOR = Keys.key(ResourceKey.sponge("water_fog_color"), Color.class);
35363590

3591+
/**
3592+
* The state of whether a {@link BlockState} that is a copper block is waxed, or if a {@link CopperGolem}
3593+
* is waxed.
3594+
*/
3595+
public static final Key<Value<Boolean>> WAXED = Keys.key(ResourceKey.sponge("waxed"), Boolean.class);
3596+
3597+
/**
3598+
* The {@link #ITEM_DURABILITY} damage an {@link ItemStack} takes per attack.
3599+
*/
3600+
public static final Key<Value<Integer>> WEAPON_DAMAGE_PER_ATTACK = Keys.key(ResourceKey.sponge("weapon_damage_per_attack"), Integer.class);
3601+
35373602
/**
35383603
* The weather of a {@link ServerWorldProperties}.
35393604
*/

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public final class ArmorMaterials {
4444

4545
public static final DefaultedRegistryReference<ArmorMaterial> CHAINMAIL = ArmorMaterials.key(ResourceKey.minecraft("chainmail"));
4646

47+
public static final DefaultedRegistryReference<ArmorMaterial> COPPER = ArmorMaterials.key(ResourceKey.minecraft("copper"));
48+
4749
public static final DefaultedRegistryReference<ArmorMaterial> DIAMOND = ArmorMaterials.key(ResourceKey.minecraft("diamond"));
4850

4951
public static final DefaultedRegistryReference<ArmorMaterial> GOLD = ArmorMaterials.key(ResourceKey.minecraft("gold"));

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

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

3030
@CatalogedBy(ChickenVariants.class)
31-
public interface ChickenVariant extends DefaultedRegistryValue {
31+
public interface ChickenVariant extends DefaultedRegistryValue<ChickenVariant> {
3232
}
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(CopperGolemPoses.class)
31+
public interface CopperGolemPose extends DefaultedRegistryValue<CopperGolemPose>, StringRepresentable, Comparable<CopperGolemPose> {
32+
}

0 commit comments

Comments
 (0)