Skip to content

Commit f399265

Browse files
committed
Merge branch 'api-8' into api-9
2 parents 7198a31 + 9f894eb commit f399265

File tree

13 files changed

+36
-404
lines changed

13 files changed

+36
-404
lines changed

src/main/java/org/spongepowered/api/Game.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@
2424
*/
2525
package org.spongepowered.api;
2626

27+
import org.checkerframework.checker.nullness.qual.NonNull;
2728
import org.spongepowered.api.asset.AssetManager;
28-
import org.spongepowered.api.command.manager.CommandManager;
2929
import org.spongepowered.api.config.ConfigManager;
3030
import org.spongepowered.api.data.DataManager;
3131
import org.spongepowered.api.data.persistence.DataBuilder;
3232
import org.spongepowered.api.data.persistence.DataSerializable;
3333
import org.spongepowered.api.event.EventManager;
34-
import org.spongepowered.api.network.channel.ChannelRegistry;
34+
import org.spongepowered.api.network.channel.ChannelManager;
3535
import org.spongepowered.api.plugin.PluginManager;
3636
import org.spongepowered.api.registry.BuilderProvider;
3737
import org.spongepowered.api.registry.FactoryProvider;
38-
import org.spongepowered.api.registry.GameRegistry;
39-
import org.spongepowered.api.registry.RegistryHolder;
4038
import org.spongepowered.api.registry.ScopedRegistryHolder;
4139
import org.spongepowered.api.scheduler.Scheduler;
4240
import org.spongepowered.api.service.ServiceProvider;
@@ -96,7 +94,7 @@ public interface Game extends ScopedRegistryHolder {
9694
* @param locale The locale to lookup (e.g. {@code en_US}.
9795
* @return The locale
9896
*/
99-
Locale locale(String locale);
97+
Locale locale(@NonNull String locale);
10098

10199
/**
102100
* Returns if the {@link Client} is available for use. The result of this method is entirely
@@ -126,13 +124,6 @@ default Client client() {
126124
*/
127125
Platform platform();
128126

129-
/**
130-
* Gets the {@link GameRegistry}.
131-
*
132-
* @return The game registry
133-
*/
134-
GameRegistry registry();
135-
136127
/**
137128
* Retrieves the {@link BuilderProvider}.
138129
*
@@ -185,11 +176,11 @@ default Client client() {
185176
ConfigManager configManager();
186177

187178
/**
188-
* Gets the {@link ChannelRegistry} for creating network channels.
179+
* Gets the {@link ChannelManager} for creating network channels.
189180
*
190-
* @return The channel registry
181+
* @return The channel manager
191182
*/
192-
ChannelRegistry channelRegistry();
183+
ChannelManager channelManager();
193184

194185
/**
195186
* Gets the {@link MetricsConfigManager} instance, allowing data/metric gathering

src/main/java/org/spongepowered/api/Server.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.spongepowered.api.entity.living.player.gamemode.GameMode;
3535
import org.spongepowered.api.entity.living.player.server.ServerPlayer;
3636
import org.spongepowered.api.event.lifecycle.RegisterCommandEvent;
37+
import org.spongepowered.api.item.recipe.RecipeManager;
3738
import org.spongepowered.api.map.MapStorage;
3839
import org.spongepowered.api.network.ServerSideConnection;
3940
import org.spongepowered.api.profile.GameProfileManager;
@@ -67,6 +68,13 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
6768
*/
6869
WorldManager worldManager();
6970

71+
/**
72+
* Retrieves the {@link RecipeManager}.
73+
*
74+
* @return The recipe manager
75+
*/
76+
RecipeManager recipeManager();
77+
7078
/**
7179
* Gets if multiple {@link ServerWorld worlds} will be loaded by the server.
7280
*

src/main/java/org/spongepowered/api/Sponge.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
package org.spongepowered.api;
2626

2727
import com.google.inject.Inject;
28+
import org.checkerframework.checker.nullness.qual.Nullable;
2829
import org.spongepowered.api.asset.AssetManager;
2930
import org.spongepowered.api.config.ConfigManager;
3031
import org.spongepowered.api.data.DataManager;
3132
import org.spongepowered.api.event.EventManager;
3233
import org.spongepowered.api.event.lifecycle.LifecycleEvent;
33-
import org.spongepowered.api.network.channel.ChannelRegistry;
34+
import org.spongepowered.api.network.channel.ChannelManager;
3435
import org.spongepowered.api.plugin.PluginManager;
35-
import org.spongepowered.api.registry.GameRegistry;
3636
import org.spongepowered.api.scheduler.Scheduler;
3737
import org.spongepowered.api.service.ServiceProvider;
3838
import org.spongepowered.api.sql.SqlManager;
@@ -44,7 +44,7 @@
4444
*/
4545
public final class Sponge {
4646

47-
@Inject private static Game game;
47+
@Inject private @Nullable static Game game;
4848

4949
/**
5050
* Gets the {@link Game} instance. There is ever only going
@@ -69,15 +69,6 @@ public static Platform platform() {
6969
return Sponge.game().platform();
7070
}
7171

72-
/**
73-
* Gets the {@link GameRegistry} instance.
74-
*
75-
* @return The game registry instance
76-
*/
77-
public static GameRegistry registry() {
78-
return Sponge.game().registry();
79-
}
80-
8172
/**
8273
* Gets the {@link DataManager} instance.
8374
*
@@ -125,12 +116,12 @@ public static ConfigManager configManager() {
125116
}
126117

127118
/**
128-
* Gets the {@link ChannelRegistry} for creating network channels.
119+
* Gets the {@link ChannelManager} for creating network channels.
129120
*
130121
* @return The channel registry
131122
*/
132-
public static ChannelRegistry channelRegistry() {
133-
return Sponge.game().channelRegistry();
123+
public static ChannelManager channelManager() {
124+
return Sponge.game().channelManager();
134125
}
135126

136127
/**

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

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/main/java/org/spongepowered/api/data/persistence/Queries.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public final class Queries {
8787
public static final DataQuery UUID_MOST = of("UuidMost");
8888
public static final DataQuery POSITION = of("Pos");
8989

90+
// ProfileProperty
91+
public static final DataQuery PROPERTY_NAME = of("name");
92+
public static final DataQuery PROPERTY_VALUE = of("value");
93+
public static final DataQuery PROPERTY_SIGNATURE = of("signature");
94+
9095
// Suppress default constructor to ensure non-instantiability.
9196
private Queries() {
9297
throw new AssertionError("You should not be attempting to instantiate this class.");

src/main/java/org/spongepowered/api/item/recipe/RecipeRegistry.java renamed to src/main/java/org/spongepowered/api/item/recipe/RecipeManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
import java.util.function.Supplier;
3737

3838
/**
39-
* A registry holds all registered recipes for a given game.
39+
* Manages registered recipes.
4040
* Register new Recipes during {@link org.spongepowered.api.event.lifecycle.RegisterDataPackValueEvent}
4141
* using {@link RecipeRegistration}s.
4242
* To disable a recipe override it with an empty result.
4343
*/
44-
public interface RecipeRegistry {
44+
public interface RecipeManager {
4545

4646
/**
4747
* Gets a recipe by its {@link ResourceKey key}.

src/main/java/org/spongepowered/api/network/channel/Channel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
import org.spongepowered.api.network.EngineConnection;
2929

3030
/**
31-
* Represents a network channel bound to a {@link ChannelRegistry}. The channel
31+
* Represents a network channel bound to a {@link ChannelManager}. The channel
3232
* can be used to send and receive data.
3333
*/
3434
public interface Channel {
3535

3636
/**
37-
* Gets the registrar that this channel is bound to.
37+
* Gets the manager that this channel is bound to.
3838
*
39-
* @return The registrar
39+
* @return The manager
4040
*/
41-
ChannelRegistry registry();
41+
ChannelManager manager();
4242

4343
/**
4444
* Gets this channel's bound key.

src/main/java/org/spongepowered/api/network/channel/ChannelRegistry.java renamed to src/main/java/org/spongepowered/api/network/channel/ChannelManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
import java.util.Optional;
3232

3333
/**
34-
* A registry handling custom payloads via {@link Channel}s to and from
34+
* A manager handling custom payloads via {@link Channel}s to and from
3535
* {@link EngineConnection}s.
3636
*/
37-
public interface ChannelRegistry {
37+
public interface ChannelManager {
3838

3939
/**
4040
* Gets a channel binding if a channel exists for the given key.

src/main/java/org/spongepowered/api/profile/property/ProfileProperty.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
/**
3737
* Represents a property in a {@link GameProfile}'s profile property map.
3838
*
39-
* <p>This interface should not be implemented.</p>
39+
* <p>This interface should not be implemented by third parties - use
40+
* {@link #of(String, String)} or {@link #of(String, String, String)} to
41+
* create instances instead.</p>
4042
*
4143
* @see #of(String, String)
4244
* @see #of(String, String, String)

src/main/java/org/spongepowered/api/registry/GameRegistry.java

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)