go to version from master
This commit is contained in:
parent
0dd6818a5c
commit
2b83475506
|
@ -173,7 +173,7 @@ public class Config
|
|||
m_textTopPlayerListHead = _config.getString("text.TopPlayerTitel");
|
||||
m_textPlayerEntry = _config.getString("text.TopPlayerEntry");
|
||||
|
||||
for (String _l: (List<String>)_config.getList("timeCommand"))
|
||||
for (String _l: _config.getStringList("timeCommand"))
|
||||
{
|
||||
String[] _ld = _l.split(";");
|
||||
|
||||
|
@ -206,7 +206,13 @@ public class Config
|
|||
_config.set("text.TopPlayerTitel", m_textTopPlayerListHead);
|
||||
_config.set("text.TopPlayerEntry", m_textPlayerEntry);
|
||||
|
||||
_config.set("timeCommand", m_timeCommands);
|
||||
List<String> _timeCommands = new ArrayList<String>();
|
||||
for (TimeCommand _tc: m_timeCommands)
|
||||
{
|
||||
_timeCommands.add(_tc.getTime() + ";" + _tc.getCommand());
|
||||
}
|
||||
|
||||
_config.set("timeCommand", _timeCommands);
|
||||
|
||||
m_plugin.saveConfig();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
package li.inc.PlaytimeReloaded.DataStore;
|
||||
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class UUIDCache
|
||||
|
@ -65,4 +67,20 @@ public class UUIDCache
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String get(UUID _playerUUID)
|
||||
{
|
||||
for (PlayerObject _dieserPlayer : m_players)
|
||||
{
|
||||
if(_dieserPlayer.getUUID() == _playerUUID)
|
||||
{
|
||||
return _dieserPlayer.getName();
|
||||
}
|
||||
}
|
||||
|
||||
String _playerName = Bukkit.getPlayer(_playerUUID).getName();
|
||||
update(_playerName, _playerUUID);
|
||||
|
||||
return _playerName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import li.inc.PlaytimeReloaded.DataStore.Config;
|
|||
import li.inc.PlaytimeReloaded.DataStore.DB.MySQL;
|
||||
import li.inc.PlaytimeReloaded.DataStore.TimeCommand;
|
||||
import li.inc.PlaytimeReloaded.DataStore.UUIDCache;
|
||||
import li.inc.PlaytimeReloaded.DataStore.UUIDFetcher;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
@ -251,7 +252,14 @@ public class Playtime extends JavaPlugin implements Listener
|
|||
{
|
||||
if(_tc.getTime() == _time)
|
||||
{
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), _tc.getCommand());
|
||||
String _commandWithParas = _tc.getCommand();
|
||||
|
||||
_commandWithParas = _commandWithParas.replace("%%player%%", UUIDCache.get(_player));
|
||||
_commandWithParas = _commandWithParas.replace("%%time%%", "" + _time);
|
||||
|
||||
_commandWithParas = ChatColor.translateAlternateColorCodes('&', _commandWithParas);
|
||||
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), _commandWithParas);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue