Deprecate storage & data API (use the Tag API for nbt or whatever else you want)

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-11-07 16:05:28 +01:00
parent f069a378ba
commit 58b13fd007
11 changed files with 11 additions and 0 deletions

View File

@ -334,6 +334,7 @@ public final class MinecraftServer {
*
* @return the data manager
*/
@Deprecated
public static DataManager getDataManager() {
checkInitStatus(dataManager);
return dataManager;

View File

@ -13,6 +13,7 @@ import java.util.Set;
* <p>
* See {@link DataImpl} for the default implementation.
*/
@Deprecated
public abstract class Data implements PublicCloneable<Data> {
public static final Data EMPTY = new Data() {

View File

@ -11,6 +11,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* {@link Data} implementation which uses a {@link ConcurrentHashMap}.
*/
@Deprecated
public class DataImpl extends Data {
protected final ConcurrentHashMap<String, Object> data = new ConcurrentHashMap<>();

View File

@ -23,6 +23,7 @@ import java.util.UUID;
* A lot of types are already registered by default so you do not have to add all of them manually,
* you can verify if {@link #getDataType(Class)} returns null for the desired type, if it is then you will need to register it.
*/
@Deprecated
public final class DataManager {
private final Map<Class, DataType> dataTypeMap = new HashMap<>();

View File

@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
*
* @param <T> the type of the object
*/
@Deprecated
public abstract class DataType<T> {
/**

View File

@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
* <p>
* See {@link SerializableDataImpl} for the default implementation.
*/
@Deprecated
public abstract class SerializableData extends Data {
/**

View File

@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* {@link SerializableData} implementation based on {@link DataImpl}.
*/
@Deprecated
public class SerializableDataImpl extends SerializableData {
protected static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();

View File

@ -17,6 +17,7 @@ import java.util.Map;
* Each {@link StorageLocation} has a {@link StorageSystem} associated to it
* which is used to save and retrieve data from keys.
*/
@Deprecated
public class StorageLocation {
private static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();

View File

@ -16,6 +16,7 @@ import java.util.function.Supplier;
* Manager used to retrieve {@link StorageLocation} with {@link #getLocation(String, StorageOptions, StorageSystem)}
* and define the default {@link StorageSystem} with {@link #defineDefaultStorageSystem(Supplier)}.
*/
@Deprecated
public final class StorageManager {
private static final Logger LOGGER = LoggerFactory.getLogger(StorageManager.class);

View File

@ -1,5 +1,6 @@
package net.minestom.server.storage;
@Deprecated
public class StorageOptions {
private boolean compression;

View File

@ -7,6 +7,7 @@ import org.jetbrains.annotations.Nullable;
* Represents a way of storing data by key/value.
* The location does not have to be a file or folder path. It is the 'identifier' of the data location.
*/
@Deprecated
public interface StorageSystem {
/**