mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 04:28:21 +01:00
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:
parent
f069a378ba
commit
58b13fd007
@ -334,6 +334,7 @@ public final class MinecraftServer {
|
|||||||
*
|
*
|
||||||
* @return the data manager
|
* @return the data manager
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static DataManager getDataManager() {
|
public static DataManager getDataManager() {
|
||||||
checkInitStatus(dataManager);
|
checkInitStatus(dataManager);
|
||||||
return dataManager;
|
return dataManager;
|
||||||
|
@ -13,6 +13,7 @@ import java.util.Set;
|
|||||||
* <p>
|
* <p>
|
||||||
* See {@link DataImpl} for the default implementation.
|
* See {@link DataImpl} for the default implementation.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public abstract class Data implements PublicCloneable<Data> {
|
public abstract class Data implements PublicCloneable<Data> {
|
||||||
|
|
||||||
public static final Data EMPTY = new Data() {
|
public static final Data EMPTY = new Data() {
|
||||||
|
@ -11,6 +11,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
/**
|
/**
|
||||||
* {@link Data} implementation which uses a {@link ConcurrentHashMap}.
|
* {@link Data} implementation which uses a {@link ConcurrentHashMap}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class DataImpl extends Data {
|
public class DataImpl extends Data {
|
||||||
|
|
||||||
protected final ConcurrentHashMap<String, Object> data = new ConcurrentHashMap<>();
|
protected final ConcurrentHashMap<String, Object> data = new ConcurrentHashMap<>();
|
||||||
|
@ -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,
|
* 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.
|
* 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 {
|
public final class DataManager {
|
||||||
|
|
||||||
private final Map<Class, DataType> dataTypeMap = new HashMap<>();
|
private final Map<Class, DataType> dataTypeMap = new HashMap<>();
|
||||||
|
@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
*
|
*
|
||||||
* @param <T> the type of the object
|
* @param <T> the type of the object
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public abstract class DataType<T> {
|
public abstract class DataType<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
* <p>
|
* <p>
|
||||||
* See {@link SerializableDataImpl} for the default implementation.
|
* See {@link SerializableDataImpl} for the default implementation.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public abstract class SerializableData extends Data {
|
public abstract class SerializableData extends Data {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
/**
|
/**
|
||||||
* {@link SerializableData} implementation based on {@link DataImpl}.
|
* {@link SerializableData} implementation based on {@link DataImpl}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class SerializableDataImpl extends SerializableData {
|
public class SerializableDataImpl extends SerializableData {
|
||||||
|
|
||||||
protected static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();
|
protected static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();
|
||||||
|
@ -17,6 +17,7 @@ import java.util.Map;
|
|||||||
* Each {@link StorageLocation} has a {@link StorageSystem} associated to it
|
* Each {@link StorageLocation} has a {@link StorageSystem} associated to it
|
||||||
* which is used to save and retrieve data from keys.
|
* which is used to save and retrieve data from keys.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class StorageLocation {
|
public class StorageLocation {
|
||||||
|
|
||||||
private static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();
|
private static final DataManager DATA_MANAGER = MinecraftServer.getDataManager();
|
||||||
|
@ -16,6 +16,7 @@ import java.util.function.Supplier;
|
|||||||
* Manager used to retrieve {@link StorageLocation} with {@link #getLocation(String, StorageOptions, StorageSystem)}
|
* Manager used to retrieve {@link StorageLocation} with {@link #getLocation(String, StorageOptions, StorageSystem)}
|
||||||
* and define the default {@link StorageSystem} with {@link #defineDefaultStorageSystem(Supplier)}.
|
* and define the default {@link StorageSystem} with {@link #defineDefaultStorageSystem(Supplier)}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public final class StorageManager {
|
public final class StorageManager {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(StorageManager.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(StorageManager.class);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package net.minestom.server.storage;
|
package net.minestom.server.storage;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public class StorageOptions {
|
public class StorageOptions {
|
||||||
|
|
||||||
private boolean compression;
|
private boolean compression;
|
||||||
|
@ -7,6 +7,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
* Represents a way of storing data by key/value.
|
* 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.
|
* The location does not have to be a file or folder path. It is the 'identifier' of the data location.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public interface StorageSystem {
|
public interface StorageSystem {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user