mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 09:37:37 +00:00
Fixed a few bugs
This commit is contained in:
parent
2fcf44c6a8
commit
7ed0549ec6
@ -1,7 +1,6 @@
|
|||||||
package dev.plex.command.impl;
|
package dev.plex.command.impl;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import dev.plex.cache.player.PlayerCache;
|
|
||||||
import dev.plex.command.PlexCommand;
|
import dev.plex.command.PlexCommand;
|
||||||
import dev.plex.command.annotation.CommandParameters;
|
import dev.plex.command.annotation.CommandParameters;
|
||||||
import dev.plex.command.annotation.CommandPermissions;
|
import dev.plex.command.annotation.CommandPermissions;
|
||||||
|
@ -56,6 +56,7 @@ public class TagCMD extends PlexCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.setPrefix(MiniMessage.miniMessage().serialize(convertedComponent));
|
player.setPrefix(MiniMessage.miniMessage().serialize(convertedComponent));
|
||||||
|
DataUtils.update(player);
|
||||||
return messageComponent("prefixSetTo", MiniMessage.miniMessage().serialize(convertedComponent));
|
return messageComponent("prefixSetTo", MiniMessage.miniMessage().serialize(convertedComponent));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,8 +69,14 @@ public class TagCMD extends PlexCommand
|
|||||||
return messageComponent("noPermissionConsole");
|
return messageComponent("noPermissionConsole");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (playerSender == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
PlexPlayer player = DataUtils.getPlayer(playerSender.getUniqueId());
|
PlexPlayer player = DataUtils.getPlayer(playerSender.getUniqueId());
|
||||||
player.setPrefix("");
|
player.setPrefix("");
|
||||||
|
DataUtils.update(player);
|
||||||
return messageComponent("prefixCleared");
|
return messageComponent("prefixCleared");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +84,7 @@ public class TagCMD extends PlexCommand
|
|||||||
Player target = getNonNullPlayer(args[1]);
|
Player target = getNonNullPlayer(args[1]);
|
||||||
PlexPlayer plexTarget = DataUtils.getPlayer(target.getUniqueId());
|
PlexPlayer plexTarget = DataUtils.getPlayer(target.getUniqueId());
|
||||||
plexTarget.setPrefix("");
|
plexTarget.setPrefix("");
|
||||||
|
DataUtils.update(plexTarget);
|
||||||
messageComponent("otherPrefixCleared");
|
messageComponent("otherPrefixCleared");
|
||||||
}
|
}
|
||||||
return usage();
|
return usage();
|
||||||
|
@ -2,7 +2,6 @@ package dev.plex.command.impl;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import dev.plex.cache.DataUtils;
|
import dev.plex.cache.DataUtils;
|
||||||
import dev.plex.cache.player.PlayerCache;
|
|
||||||
import dev.plex.command.PlexCommand;
|
import dev.plex.command.PlexCommand;
|
||||||
import dev.plex.command.annotation.CommandParameters;
|
import dev.plex.command.annotation.CommandParameters;
|
||||||
import dev.plex.command.annotation.CommandPermissions;
|
import dev.plex.command.annotation.CommandPermissions;
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package dev.plex.listener.impl;
|
package dev.plex.listener.impl;
|
||||||
|
|
||||||
import dev.plex.cache.DataUtils;
|
import dev.plex.cache.DataUtils;
|
||||||
import dev.plex.cache.player.MongoPlayerData;
|
|
||||||
import dev.plex.cache.player.PlayerCache;
|
import dev.plex.cache.player.PlayerCache;
|
||||||
import dev.plex.cache.player.SQLPlayerData;
|
|
||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
import dev.plex.player.PlexPlayer;
|
import dev.plex.player.PlexPlayer;
|
||||||
import dev.plex.util.PlexLog;
|
import dev.plex.util.PlexLog;
|
||||||
@ -67,8 +65,8 @@ public class PlayerListener extends PlexListener
|
|||||||
plexPlayer.setName(player.getName());
|
plexPlayer.setName(player.getName());
|
||||||
DataUtils.update(plexPlayer);
|
DataUtils.update(plexPlayer);
|
||||||
}
|
}
|
||||||
PlayerCache.getPlexPlayerMap().put(player.getUniqueId(), plexPlayer);
|
|
||||||
}
|
}
|
||||||
|
PlayerCache.getPlexPlayerMap().put(player.getUniqueId(), plexPlayer);
|
||||||
if (plexPlayer.isLockedUp())
|
if (plexPlayer.isLockedUp())
|
||||||
{
|
{
|
||||||
player.openInventory(player.getInventory());
|
player.openInventory(player.getInventory());
|
||||||
|
@ -4,8 +4,6 @@ import com.zaxxer.hikari.HikariConfig;
|
|||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
import dev.plex.Plex;
|
import dev.plex.Plex;
|
||||||
import dev.plex.PlexBase;
|
import dev.plex.PlexBase;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@ -59,8 +57,8 @@ public class SQLConnection extends PlexBase
|
|||||||
con.prepareStatement("CREATE TABLE IF NOT EXISTS `players` (" +
|
con.prepareStatement("CREATE TABLE IF NOT EXISTS `players` (" +
|
||||||
"`uuid` VARCHAR(46) NOT NULL, " +
|
"`uuid` VARCHAR(46) NOT NULL, " +
|
||||||
"`name` VARCHAR(18), " +
|
"`name` VARCHAR(18), " +
|
||||||
"`login_msg` VARCHAR(70), " +
|
"`login_msg` VARCHAR(2000), " +
|
||||||
"`prefix` VARCHAR(45), " +
|
"`prefix` VARCHAR(2000), " +
|
||||||
"`rank` VARCHAR(20), " +
|
"`rank` VARCHAR(20), " +
|
||||||
"`ips` VARCHAR(2000), " +
|
"`ips` VARCHAR(2000), " +
|
||||||
"`coins` BIGINT, " +
|
"`coins` BIGINT, " +
|
||||||
|
Loading…
Reference in New Issue
Block a user