Skip to content

Commit 5279200

Browse files
committed
chore: merge api-14 for updates
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
2 parents 431ccf2 + 267c5df commit 5279200

Some content is hidden

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

52 files changed

+929
-1903
lines changed

src/main/java/org/spongepowered/api/adventure/ChatTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ public static Registry<ChatType> registry() {
9898
}
9999

100100
public static DefaultedRegistryReference<ChatType> key(final ResourceKey location) {
101-
return RegistryKey.of(RegistryTypes.CHAT_TYPE, location).asDefaultedReference(Sponge::server);
101+
return RegistryKey.of(RegistryTypes.CHAT_TYPE, location).asScopedReference();
102102
}
103103
}

src/main/java/org/spongepowered/api/adventure/ResolveOperations.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public final class ResolveOperations {
6868
*/
6969
public static final DefaultedRegistryReference<ResolveOperation> CUSTOM_TRANSLATIONS = ResolveOperations.key(ResourceKey.sponge("custom_translations"));
7070

71+
/**
72+
* Resolves Sponge provided virtual components.
73+
*/
74+
public static final DefaultedRegistryReference<ResolveOperation> VIRTUAL_COMPONENTS = ResolveOperations.key(ResourceKey.sponge("virtual_components"));
75+
7176
// SORTFIELDS:OFF
7277
// @formatter:ON
7378

src/main/java/org/spongepowered/api/adventure/SpongeComponents.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,28 @@ public static ComponentFlattener flattener() {
119119
* render each {@link Audience} their own version of
120120
* the received message.
121121
*
122+
* @param apply The function invoked to render
123+
* {@link Audience} specific component.
122124
* @return The virtual component
123125
*/
124126
public static VirtualComponent receiverVirtualComponent(final Function<Audience, ComponentLike> apply) {
125-
return SpongeComponents.factory().receiverVirtualComponent(apply);
127+
return SpongeComponents.receiverVirtualComponent(apply, "");
128+
}
129+
130+
/**
131+
* Creates a new {@link VirtualComponent} that will be used to
132+
* render each {@link Audience} their own version of
133+
* the received message.
134+
*
135+
* @param apply The function invoked to render
136+
* {@link Audience} specific component.
137+
* @param fallbackValue The fallback value used when this
138+
* component has been serialized without
139+
* being rendered.
140+
* @return The virtual component
141+
*/
142+
public static VirtualComponent receiverVirtualComponent(final Function<Audience, ComponentLike> apply, final String fallbackValue) {
143+
return SpongeComponents.factory().receiverVirtualComponent(apply, fallbackValue);
126144
}
127145

128146
private static Factory factory() {
@@ -151,6 +169,6 @@ Component render(
151169

152170
ComponentFlattener flattener();
153171

154-
VirtualComponent receiverVirtualComponent(Function<Audience, ComponentLike> apply);
172+
VirtualComponent receiverVirtualComponent(Function<Audience, ComponentLike> apply, String fallbackValue);
155173
}
156174
}

src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeNodeTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ public static Registry<CommandTreeNodeType<?>> registry() {
138138
}
139139

140140
private static <T extends CommandTreeNode<T>> DefaultedRegistryReference<CommandTreeNodeType<T>> key(final ResourceKey location) {
141-
return RegistryKey.of(RegistryTypes.COMMAND_TREE_NODE_TYPE, location).asDefaultedReference(Sponge::server);
141+
return RegistryKey.of(RegistryTypes.COMMAND_TREE_NODE_TYPE, location).asScopedReference();
142142
}
143143
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
import org.spongepowered.api.world.portal.PortalLogic;
293293
import org.spongepowered.api.world.server.ServerLocation;
294294
import org.spongepowered.api.world.server.ServerWorld;
295+
import org.spongepowered.api.world.server.WorldArchetype;
296+
import org.spongepowered.api.world.server.WorldArchetypeType;
295297
import org.spongepowered.api.world.server.storage.ServerWorldProperties;
296298
import org.spongepowered.api.world.storage.WorldProperties;
297299
import org.spongepowered.api.world.weather.Weather;
@@ -3567,6 +3569,18 @@ public final class Keys {
35673569
*/
35683570
public static final Key<Value<Sheep>> WOLOLO_TARGET = Keys.key(ResourceKey.sponge("wololo_target"), Sheep.class);
35693571

3572+
/**
3573+
* The {@link WorldArchetype} of a {@link World} or {@link ServerWorldProperties}
3574+
* Readonly
3575+
*/
3576+
public static final Key<Value<WorldArchetype>> WORLD_ARCHETYPE = Keys.key(ResourceKey.sponge("world_archetype"), WorldArchetype.class);
3577+
3578+
/**
3579+
* The {@link WorldArchetypeType} of a {@link World} or {@link ServerWorldProperties}
3580+
* Readonly
3581+
*/
3582+
public static final Key<Value<WorldArchetypeType>> WORLD_ARCHETYPE_TYPE = Keys.key(ResourceKey.sponge("world_archetype_type"), WorldArchetypeType.class);
3583+
35703584
/**
35713585
* The world border of {@link WorldProperties}
35723586
* Readonly

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ public static Registry<ArtType> registry() {
148148
}
149149

150150
private static DefaultedRegistryReference<ArtType> key(final ResourceKey location) {
151-
return RegistryKey.of(RegistryTypes.ART_TYPE, location).asDefaultedReference(Sponge::server);
151+
return RegistryKey.of(RegistryTypes.ART_TYPE, location).asScopedReference();
152152
}
153153
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@ public static Registry<BannerPatternShape> registry() {
134134
}
135135

136136
private static DefaultedRegistryReference<BannerPatternShape> key(final ResourceKey location) {
137-
return RegistryKey.of(RegistryTypes.BANNER_PATTERN_SHAPE, location).asDefaultedReference(Sponge::server);
137+
return RegistryKey.of(RegistryTypes.BANNER_PATTERN_SHAPE, location).asScopedReference();
138138
}
139139
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ private WolfVariants() {
6262
}
6363

6464
public static Registry<WolfVariant> registry() {
65-
return Sponge.server().registry(RegistryTypes.WOLF_VAIRANT);
65+
return Sponge.server().registry(RegistryTypes.WOLF_VARIANT);
6666
}
6767

6868
private static DefaultedRegistryReference<WolfVariant> key(final ResourceKey location) {
69-
return RegistryKey.of(RegistryTypes.WOLF_VAIRANT, location).asDefaultedReference(Sponge::server);
69+
return RegistryKey.of(RegistryTypes.WOLF_VARIANT, location).asScopedReference();
7070
}
7171
}

src/main/java/org/spongepowered/api/effect/particle/ParticleOptions.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public final class ParticleOptions {
5959
* <li>{@link ParticleTypes#BLOCK_MARKER}</li>
6060
* <li>{@link ParticleTypes#DUST_PILLAR}</li>
6161
* <li>{@link ParticleTypes#FALLING_DUST}</li>
62+
* <li>{@link ParticleTypes#BLOCK_CRUMBLE}</li>
6263
* </ul>
6364
*/
6465
public static final DefaultedRegistryReference<ParticleOption<BlockState>> BLOCK_STATE = ParticleOptions.key(ResourceKey.sponge("block_state"));
@@ -71,6 +72,7 @@ public final class ParticleOptions {
7172
* <li>{@link ParticleTypes#ENTITY_EFFECT}</li>
7273
* <li>{@link ParticleTypes#DUST}</li>
7374
* <li>{@link ParticleTypes#DUST_COLOR_TRANSITION}</li>
75+
* <li>{@link ParticleTypes#TRAIL}</li>
7476
* </ul>
7577
*/
7678
public static final DefaultedRegistryReference<ParticleOption<Color>> COLOR = ParticleOptions.key(ResourceKey.sponge("color"));
@@ -158,6 +160,16 @@ public final class ParticleOptions {
158160
*/
159161
public static final DefaultedRegistryReference<ParticleOption<Double>> SCALE = ParticleOptions.key(ResourceKey.sponge("scale"));
160162

163+
/**
164+
* This option will affect the target of a particle
165+
* The only vanilla {@link ParticleType} this option is applicable to is:
166+
*
167+
* <ul>
168+
* <li>{@link ParticleTypes#TRAIL}</li>
169+
* </ul>
170+
*/
171+
public static final DefaultedRegistryReference<ParticleOption<Vector3d>> TARGET = ParticleOptions.key(ResourceKey.sponge("target"));
172+
161173
/**
162174
* This option will change the color the transition particle will change to.
163175
* The only vanilla {@link ParticleType} this option is applicable to is:
@@ -174,6 +186,7 @@ public final class ParticleOptions {
174186
*
175187
* <ul>
176188
* <li>{@link ParticleTypes#VIBRATION}</li>
189+
* <li>{@link ParticleTypes#TRAIL}</li>
177190
* </ul>
178191
*/
179192
public static final DefaultedRegistryReference<ParticleOption<Ticks>> TRAVEL_TIME = ParticleOptions.key(ResourceKey.sponge("travel_time"));

src/main/java/org/spongepowered/api/effect/sound/music/MusicDiscs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ public static Registry<MusicDisc> registry() {
8686
}
8787

8888
private static DefaultedRegistryReference<MusicDisc> key(final ResourceKey location) {
89-
return RegistryKey.of(RegistryTypes.MUSIC_DISC, location).asDefaultedReference(Sponge::server);
89+
return RegistryKey.of(RegistryTypes.MUSIC_DISC, location).asScopedReference();
9090
}
9191
}

0 commit comments

Comments
 (0)