9
0
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:
XiaoMoMi
2024-07-03 15:09:39 +08:00
parent 35edd85434
commit 82350ac0c4
5 changed files with 43 additions and 3 deletions

View File

@@ -26,5 +26,6 @@ public enum StorageType {
MySQL,
MariaDB,
MongoDB,
Redis
Redis,
None
}

View File

@@ -7,7 +7,7 @@ plugins {
allprojects {
version = "2.4.0"
version = "2.4.1"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -213,7 +213,7 @@ public class UnlimitedTagManagerImpl implements UnlimitedTagManager {
}
public void handlePlayerQuit(Player quit) {
UnlimitedEntity unlimitedEntity = getUnlimitedObject(quit.getUniqueId());
UnlimitedEntity unlimitedEntity = removeUnlimitedEntityFromMap(quit.getUniqueId());
if (unlimitedEntity != null) {
unlimitedEntity.destroy();
}

View File

@@ -28,6 +28,7 @@ import net.momirealms.customnameplates.api.event.NameplateDataLoadEvent;
import net.momirealms.customnameplates.api.manager.StorageManager;
import net.momirealms.customnameplates.api.util.LogUtils;
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.RedisManager;
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 MariaDB -> this.dataSource = new MariaDBImpl(plugin);
case MongoDB -> this.dataSource = new MongoDBImpl(plugin);
case None -> this.dataSource = new NoneStorage(plugin);
}
if (this.dataSource != null) this.dataSource.initialize();
else LogUtils.severe("No storage type is set.");

View File

@@ -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();
}
}