mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-19 15:09:23 +00:00
Fix some issues
This commit is contained in:
@@ -26,5 +26,6 @@ public enum StorageType {
|
|||||||
MySQL,
|
MySQL,
|
||||||
MariaDB,
|
MariaDB,
|
||||||
MongoDB,
|
MongoDB,
|
||||||
Redis
|
Redis,
|
||||||
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
||||||
version = "2.4.0"
|
version = "2.4.1"
|
||||||
|
|
||||||
apply<JavaPlugin>()
|
apply<JavaPlugin>()
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class UnlimitedTagManagerImpl implements UnlimitedTagManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void handlePlayerQuit(Player quit) {
|
public void handlePlayerQuit(Player quit) {
|
||||||
UnlimitedEntity unlimitedEntity = getUnlimitedObject(quit.getUniqueId());
|
UnlimitedEntity unlimitedEntity = removeUnlimitedEntityFromMap(quit.getUniqueId());
|
||||||
if (unlimitedEntity != null) {
|
if (unlimitedEntity != null) {
|
||||||
unlimitedEntity.destroy();
|
unlimitedEntity.destroy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import net.momirealms.customnameplates.api.event.NameplateDataLoadEvent;
|
|||||||
import net.momirealms.customnameplates.api.manager.StorageManager;
|
import net.momirealms.customnameplates.api.manager.StorageManager;
|
||||||
import net.momirealms.customnameplates.api.util.LogUtils;
|
import net.momirealms.customnameplates.api.util.LogUtils;
|
||||||
import net.momirealms.customnameplates.paper.CustomNameplatesPluginImpl;
|
import net.momirealms.customnameplates.paper.CustomNameplatesPluginImpl;
|
||||||
|
import net.momirealms.customnameplates.paper.storage.method.NoneStorage;
|
||||||
import net.momirealms.customnameplates.paper.storage.method.database.nosql.MongoDBImpl;
|
import net.momirealms.customnameplates.paper.storage.method.database.nosql.MongoDBImpl;
|
||||||
import net.momirealms.customnameplates.paper.storage.method.database.nosql.RedisManager;
|
import net.momirealms.customnameplates.paper.storage.method.database.nosql.RedisManager;
|
||||||
import net.momirealms.customnameplates.paper.storage.method.database.sql.H2Impl;
|
import net.momirealms.customnameplates.paper.storage.method.database.sql.H2Impl;
|
||||||
@@ -178,6 +179,7 @@ public class StorageManagerImpl implements Listener, StorageManager {
|
|||||||
case MySQL -> this.dataSource = new MySQLImpl(plugin);
|
case MySQL -> this.dataSource = new MySQLImpl(plugin);
|
||||||
case MariaDB -> this.dataSource = new MariaDBImpl(plugin);
|
case MariaDB -> this.dataSource = new MariaDBImpl(plugin);
|
||||||
case MongoDB -> this.dataSource = new MongoDBImpl(plugin);
|
case MongoDB -> this.dataSource = new MongoDBImpl(plugin);
|
||||||
|
case None -> this.dataSource = new NoneStorage(plugin);
|
||||||
}
|
}
|
||||||
if (this.dataSource != null) this.dataSource.initialize();
|
if (this.dataSource != null) this.dataSource.initialize();
|
||||||
else LogUtils.severe("No storage type is set.");
|
else LogUtils.severe("No storage type is set.");
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package net.momirealms.customnameplates.paper.storage.method;
|
||||||
|
|
||||||
|
import net.momirealms.customnameplates.api.CustomNameplatesPlugin;
|
||||||
|
import net.momirealms.customnameplates.api.data.PlayerData;
|
||||||
|
import net.momirealms.customnameplates.api.data.StorageType;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class NoneStorage extends AbstractStorage {
|
||||||
|
|
||||||
|
public NoneStorage(CustomNameplatesPlugin plugin) {
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StorageType getStorageType() {
|
||||||
|
return StorageType.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Optional<PlayerData>> getPlayerData(UUID uuid) {
|
||||||
|
return CompletableFuture.completedFuture(Optional.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Boolean> updatePlayerData(UUID uuid, PlayerData playerData) {
|
||||||
|
return CompletableFuture.completedFuture(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<UUID> getUniqueUsers(boolean legacy) {
|
||||||
|
return Set.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user