Skip to content

Commit 0b462f5

Browse files
committed
feat!: update API for 25w04a
Breaking changes: - CatTypes are now World Registry Scoped, so no longer defaulted - FrogTypes are now World Registry Scoped - EntityTypes.POTION is removed, now split in LINGERING_POTION and SPLASH_POTION - DamageTypeTags.BYPASSES_SHIELD is renamed BYPASSES_BLOCKING
1 parent 7d39d1a commit 0b462f5

File tree

7 files changed

+37
-34
lines changed

7 files changed

+37
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public final class BlockStateKeys {
270270

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

273-
public static final Key<Value<TestBlockMode>> TEST_BLOCK_MODE = BlockStateKeys.key(ResourceKey.minecraft("property/test_block_mode"), TestBlockMode.class);
273+
public static final Key<Value<TestBlockMode>> TEST_BLOCK_MODE = BlockStateKeys.key(ResourceKey.minecraft("property/mode"), TestBlockMode.class);
274274

275275
public static final Key<Value<Tilt>> TILT = BlockStateKeys.key(ResourceKey.minecraft("property/tilt"), Tilt.class);
276276

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,51 +25,51 @@
2525
package org.spongepowered.api.data.type;
2626

2727
import org.spongepowered.api.ResourceKey;
28-
import org.spongepowered.api.Sponge;
29-
import org.spongepowered.api.registry.DefaultedRegistryReference;
3028
import org.spongepowered.api.registry.Registry;
3129
import org.spongepowered.api.registry.RegistryKey;
30+
import org.spongepowered.api.registry.RegistryReference;
3231
import org.spongepowered.api.registry.RegistryScope;
3332
import org.spongepowered.api.registry.RegistryScopes;
3433
import org.spongepowered.api.registry.RegistryTypes;
34+
import org.spongepowered.api.world.server.ServerWorld;
3535

3636
/**
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.WORLD)
4141
public final class CatTypes {
4242

43-
public static final DefaultedRegistryReference<CatType> ALL_BLACK = CatTypes.key(ResourceKey.minecraft("all_black"));
43+
public static final RegistryReference<CatType> ALL_BLACK = CatTypes.key(ResourceKey.minecraft("all_black"));
4444

45-
public static final DefaultedRegistryReference<CatType> BLACK = CatTypes.key(ResourceKey.minecraft("black"));
45+
public static final RegistryReference<CatType> BLACK = CatTypes.key(ResourceKey.minecraft("black"));
4646

47-
public static final DefaultedRegistryReference<CatType> BRITISH_SHORTHAIR = CatTypes.key(ResourceKey.minecraft("british_shorthair"));
47+
public static final RegistryReference<CatType> BRITISH_SHORTHAIR = CatTypes.key(ResourceKey.minecraft("british_shorthair"));
4848

49-
public static final DefaultedRegistryReference<CatType> CALICO = CatTypes.key(ResourceKey.minecraft("calico"));
49+
public static final RegistryReference<CatType> CALICO = CatTypes.key(ResourceKey.minecraft("calico"));
5050

51-
public static final DefaultedRegistryReference<CatType> JELLIE = CatTypes.key(ResourceKey.minecraft("jellie"));
51+
public static final RegistryReference<CatType> JELLIE = CatTypes.key(ResourceKey.minecraft("jellie"));
5252

53-
public static final DefaultedRegistryReference<CatType> PERSIAN = CatTypes.key(ResourceKey.minecraft("persian"));
53+
public static final RegistryReference<CatType> PERSIAN = CatTypes.key(ResourceKey.minecraft("persian"));
5454

55-
public static final DefaultedRegistryReference<CatType> RAGDOLL = CatTypes.key(ResourceKey.minecraft("ragdoll"));
55+
public static final RegistryReference<CatType> RAGDOLL = CatTypes.key(ResourceKey.minecraft("ragdoll"));
5656

57-
public static final DefaultedRegistryReference<CatType> RED = CatTypes.key(ResourceKey.minecraft("red"));
57+
public static final RegistryReference<CatType> RED = CatTypes.key(ResourceKey.minecraft("red"));
5858

59-
public static final DefaultedRegistryReference<CatType> SIAMESE = CatTypes.key(ResourceKey.minecraft("siamese"));
59+
public static final RegistryReference<CatType> SIAMESE = CatTypes.key(ResourceKey.minecraft("siamese"));
6060

61-
public static final DefaultedRegistryReference<CatType> TABBY = CatTypes.key(ResourceKey.minecraft("tabby"));
61+
public static final RegistryReference<CatType> TABBY = CatTypes.key(ResourceKey.minecraft("tabby"));
6262

63-
public static final DefaultedRegistryReference<CatType> WHITE = CatTypes.key(ResourceKey.minecraft("white"));
63+
public static final RegistryReference<CatType> WHITE = CatTypes.key(ResourceKey.minecraft("white"));
6464

6565
private CatTypes() {
6666
}
6767

68-
public static Registry<CatType> registry() {
69-
return Sponge.game().registry(RegistryTypes.CAT_TYPE);
68+
public static Registry<CatType> registry(final ServerWorld world) {
69+
return world.registry(RegistryTypes.CAT_TYPE);
7070
}
7171

72-
private static DefaultedRegistryReference<CatType> key(final ResourceKey location) {
73-
return RegistryKey.of(RegistryTypes.CAT_TYPE, location).asDefaultedReference(Sponge::game);
72+
private static RegistryReference<CatType> key(final ResourceKey location) {
73+
return RegistryKey.of(RegistryTypes.CAT_TYPE, location).asReference();
7474
}
7575
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,35 @@
2525
package org.spongepowered.api.data.type;
2626

2727
import org.spongepowered.api.ResourceKey;
28-
import org.spongepowered.api.Sponge;
29-
import org.spongepowered.api.registry.DefaultedRegistryReference;
3028
import org.spongepowered.api.registry.Registry;
3129
import org.spongepowered.api.registry.RegistryKey;
30+
import org.spongepowered.api.registry.RegistryReference;
3231
import org.spongepowered.api.registry.RegistryScope;
3332
import org.spongepowered.api.registry.RegistryScopes;
3433
import org.spongepowered.api.registry.RegistryTypes;
34+
import org.spongepowered.api.world.server.ServerWorld;
3535

3636
/**
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.WORLD)
4141
public final class FrogTypes {
4242

43-
public static final DefaultedRegistryReference<FrogType> COLD = FrogTypes.key(ResourceKey.minecraft("cold"));
43+
public static final RegistryReference<FrogType> COLD = FrogTypes.key(ResourceKey.minecraft("cold"));
4444

45-
public static final DefaultedRegistryReference<FrogType> TEMPERATE = FrogTypes.key(ResourceKey.minecraft("temperate"));
45+
public static final RegistryReference<FrogType> TEMPERATE = FrogTypes.key(ResourceKey.minecraft("temperate"));
4646

47-
public static final DefaultedRegistryReference<FrogType> WARM = FrogTypes.key(ResourceKey.minecraft("warm"));
47+
public static final RegistryReference<FrogType> WARM = FrogTypes.key(ResourceKey.minecraft("warm"));
4848

4949
private FrogTypes() {
5050
}
5151

52-
public static Registry<FrogType> registry() {
53-
return Sponge.game().registry(RegistryTypes.FROG_TYPE);
52+
public static Registry<FrogType> registry(final ServerWorld world) {
53+
return world.registry(RegistryTypes.FROG_TYPE);
5454
}
5555

56-
private static DefaultedRegistryReference<FrogType> key(final ResourceKey location) {
57-
return RegistryKey.of(RegistryTypes.FROG_TYPE, location).asDefaultedReference(Sponge::game);
56+
private static RegistryReference<FrogType> key(final ResourceKey location) {
57+
return RegistryKey.of(RegistryTypes.FROG_TYPE, location).asReference();
5858
}
5959
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class TestBlockModes {
4444

4545
public static final DefaultedRegistryReference<TestBlockMode> START = TestBlockModes.key(ResourceKey.sponge("start"));
4646

47-
4847
public static Registry<TestBlockMode> registry() {
4948
return Sponge.game().registry(RegistryTypes.TEST_BLOCK_MODE);
5049
}

src/main/java/org/spongepowered/api/entity/EntityTypes.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ public final class EntityTypes {
320320

321321
public static final DefaultedRegistryReference<EntityType<LightningBolt>> LIGHTNING_BOLT = EntityTypes.key(ResourceKey.minecraft("lightning_bolt"));
322322

323+
public static final DefaultedRegistryReference<EntityType<Potion>> LINGERING_POTION = EntityTypes.key(ResourceKey.minecraft("lingering_potion"));
324+
323325
public static final DefaultedRegistryReference<EntityType<Llama>> LLAMA = EntityTypes.key(ResourceKey.minecraft("llama"));
324326

325327
public static final DefaultedRegistryReference<EntityType<LlamaSpit>> LLAMA_SPIT = EntityTypes.key(ResourceKey.minecraft("llama_spit"));
@@ -370,8 +372,6 @@ public final class EntityTypes {
370372

371373
public static final DefaultedRegistryReference<EntityType<PolarBear>> POLAR_BEAR = EntityTypes.key(ResourceKey.minecraft("polar_bear"));
372374

373-
public static final DefaultedRegistryReference<EntityType<Potion>> POTION = EntityTypes.key(ResourceKey.minecraft("potion"));
374-
375375
public static final DefaultedRegistryReference<EntityType<Pufferfish>> PUFFERFISH = EntityTypes.key(ResourceKey.minecraft("pufferfish"));
376376

377377
public static final DefaultedRegistryReference<EntityType<Rabbit>> RABBIT = EntityTypes.key(ResourceKey.minecraft("rabbit"));
@@ -408,6 +408,8 @@ public final class EntityTypes {
408408

409409
public static final DefaultedRegistryReference<EntityType<Spider>> SPIDER = EntityTypes.key(ResourceKey.minecraft("spider"));
410410

411+
public static final DefaultedRegistryReference<EntityType<Potion>> SPLASH_POTION = EntityTypes.key(ResourceKey.minecraft("splash_potion"));
412+
411413
public static final DefaultedRegistryReference<EntityType<Boat>> SPRUCE_BOAT = EntityTypes.key(ResourceKey.minecraft("spruce_boat"));
412414

413415
public static final DefaultedRegistryReference<EntityType<ChestBoat>> SPRUCE_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("spruce_chest_boat"));

src/main/java/org/spongepowered/api/tag/DamageTypeTags.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public final class DamageTypeTags {
5353

5454
public static final Tag<DamageType> BYPASSES_ARMOR = DamageTypeTags.key(ResourceKey.minecraft("bypasses_armor"));
5555

56+
public static final Tag<DamageType> BYPASSES_BLOCKING = DamageTypeTags.key(ResourceKey.minecraft("bypasses_blocking"));
57+
5658
public static final Tag<DamageType> BYPASSES_EFFECTS = DamageTypeTags.key(ResourceKey.minecraft("bypasses_effects"));
5759

5860
public static final Tag<DamageType> BYPASSES_ENCHANTMENTS = DamageTypeTags.key(ResourceKey.minecraft("bypasses_enchantments"));
@@ -61,8 +63,6 @@ public final class DamageTypeTags {
6163

6264
public static final Tag<DamageType> BYPASSES_RESISTANCE = DamageTypeTags.key(ResourceKey.minecraft("bypasses_resistance"));
6365

64-
public static final Tag<DamageType> BYPASSES_SHIELD = DamageTypeTags.key(ResourceKey.minecraft("bypasses_shield"));
65-
6666
public static final Tag<DamageType> BYPASSES_WOLF_ARMOR = DamageTypeTags.key(ResourceKey.minecraft("bypasses_wolf_armor"));
6767

6868
public static final Tag<DamageType> CAN_BREAK_ARMOR_STAND = DamageTypeTags.key(ResourceKey.minecraft("can_break_armor_stand"));

src/main/java/org/spongepowered/api/tag/EntityTypeTags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public final class EntityTypeTags {
5757

5858
public static final Tag<EntityType<?>> CAN_TURN_IN_BOATS = EntityTypeTags.key(ResourceKey.minecraft("can_turn_in_boats"));
5959

60+
public static final Tag<EntityType<?>> CAN_WEAR_HORSE_ARMOR = EntityTypeTags.key(ResourceKey.minecraft("can_wear_horse_armor"));
61+
6062
public static final Tag<EntityType<?>> DEFLECTS_PROJECTILES = EntityTypeTags.key(ResourceKey.minecraft("deflects_projectiles"));
6163

6264
public static final Tag<EntityType<?>> DISMOUNTS_UNDERWATER = EntityTypeTags.key(ResourceKey.minecraft("dismounts_underwater"));

0 commit comments

Comments
 (0)