PageRenderTime 60ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/Dependencies/Spigot/work/nms.old.1467306851986/minecraft/server/DedicatedServer.java

https://gitlab.com/Meteor-MC/plugins
Java | 671 lines | 523 code | 125 blank | 23 comment | 83 complexity | 5d79ae103eb027e15098a5342ff4b81b MD5 | raw file
  1. package net.minecraft.server;
  2. import com.google.common.collect.Lists;
  3. import com.mojang.authlib.GameProfileRepository;
  4. import com.mojang.authlib.minecraft.MinecraftSessionService;
  5. import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
  6. import java.io.File;
  7. import java.io.IOException;
  8. import java.net.InetAddress;
  9. import java.net.Proxy;
  10. import java.util.Collections;
  11. import java.util.List;
  12. import java.util.Random;
  13. import java.util.concurrent.TimeUnit;
  14. import java.util.regex.Pattern;
  15. import org.apache.logging.log4j.LogManager;
  16. import org.apache.logging.log4j.Logger;
  17. // CraftBukkit start
  18. import java.io.PrintStream;
  19. import org.apache.logging.log4j.Level;
  20. import org.bukkit.craftbukkit.LoggerOutputStream;
  21. import org.bukkit.event.server.ServerCommandEvent;
  22. import org.bukkit.craftbukkit.util.Waitable;
  23. import org.bukkit.event.server.RemoteServerCommandEvent;
  24. // CraftBukkit end
  25. public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
  26. private static final Logger LOGGER = LogManager.getLogger();
  27. private static final Pattern l = Pattern.compile("^[a-fA-F0-9]{40}$");
  28. private final List<ServerCommand> serverCommandQueue = Collections.synchronizedList(Lists.<ServerCommand>newArrayList()); // CraftBukkit - fix decompile error
  29. private RemoteStatusListener n;
  30. public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this);
  31. private RemoteControlListener p;
  32. public PropertyManager propertyManager;
  33. private EULA r;
  34. private boolean generateStructures;
  35. private EnumGamemode t;
  36. private boolean u;
  37. // CraftBukkit start - Signature changed
  38. public DedicatedServer(joptsimple.OptionSet options, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
  39. super(options, Proxy.NO_PROXY, dataconvertermanager, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache);
  40. // CraftBukkit end
  41. Thread thread = new Thread("Server Infinisleeper") {
  42. {
  43. this.setDaemon(true);
  44. this.start();
  45. }
  46. public void run() {
  47. while (true) {
  48. try {
  49. Thread.sleep(2147483647L);
  50. } catch (InterruptedException interruptedexception) {
  51. ;
  52. }
  53. }
  54. }
  55. };
  56. }
  57. public boolean init() throws IOException {
  58. Thread thread = new Thread("Server console handler") {
  59. public void run() {
  60. // CraftBukkit start
  61. if (!org.bukkit.craftbukkit.Main.useConsole) {
  62. return;
  63. }
  64. // CraftBukkit end
  65. jline.console.ConsoleReader bufferedreader = reader; // CraftBukkit
  66. String s;
  67. try {
  68. // CraftBukkit start - JLine disabling compatibility
  69. while (!isStopped() && isRunning()) {
  70. if (org.bukkit.craftbukkit.Main.useJline) {
  71. s = bufferedreader.readLine(">", null);
  72. } else {
  73. s = bufferedreader.readLine();
  74. }
  75. if (s != null && s.trim().length() > 0) { // Trim to filter lines which are just spaces
  76. issueCommand(s, DedicatedServer.this);
  77. }
  78. // CraftBukkit end
  79. }
  80. } catch (IOException ioexception) {
  81. DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
  82. }
  83. }
  84. };
  85. // CraftBukkit start - TODO: handle command-line logging arguments
  86. java.util.logging.Logger global = java.util.logging.Logger.getLogger("");
  87. global.setUseParentHandlers(false);
  88. for (java.util.logging.Handler handler : global.getHandlers()) {
  89. global.removeHandler(handler);
  90. }
  91. global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler());
  92. final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger());
  93. for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) {
  94. if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) {
  95. logger.removeAppender(appender);
  96. }
  97. }
  98. new Thread(new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader)).start();
  99. System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
  100. System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
  101. // CraftBukkit end
  102. thread.setDaemon(true);
  103. thread.start();
  104. DedicatedServer.LOGGER.info("Starting minecraft server version 1.10.2");
  105. if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
  106. DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
  107. }
  108. DedicatedServer.LOGGER.info("Loading properties");
  109. this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support
  110. this.r = new EULA(new File("eula.txt"));
  111. if (!this.r.a()) {
  112. DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
  113. this.r.b();
  114. return false;
  115. } else {
  116. if (this.R()) {
  117. this.c("127.0.0.1");
  118. } else {
  119. this.setOnlineMode(this.propertyManager.getBoolean("online-mode", true));
  120. this.c(this.propertyManager.getString("server-ip", ""));
  121. }
  122. this.setSpawnAnimals(this.propertyManager.getBoolean("spawn-animals", true));
  123. this.setSpawnNPCs(this.propertyManager.getBoolean("spawn-npcs", true));
  124. this.setPVP(this.propertyManager.getBoolean("pvp", true));
  125. this.setAllowFlight(this.propertyManager.getBoolean("allow-flight", false));
  126. this.setResourcePack(this.propertyManager.getString("resource-pack", ""), this.aK());
  127. this.setMotd(this.propertyManager.getString("motd", "A Minecraft Server"));
  128. this.setForceGamemode(this.propertyManager.getBoolean("force-gamemode", false));
  129. this.setIdleTimeout(this.propertyManager.getInt("player-idle-timeout", 0));
  130. if (this.propertyManager.getInt("difficulty", 1) < 0) {
  131. this.propertyManager.setProperty("difficulty", Integer.valueOf(0));
  132. } else if (this.propertyManager.getInt("difficulty", 1) > 3) {
  133. this.propertyManager.setProperty("difficulty", Integer.valueOf(3));
  134. }
  135. this.generateStructures = this.propertyManager.getBoolean("generate-structures", true);
  136. int i = this.propertyManager.getInt("gamemode", EnumGamemode.SURVIVAL.getId());
  137. this.t = WorldSettings.a(i);
  138. DedicatedServer.LOGGER.info("Default game type: {}", new Object[] { this.t});
  139. InetAddress inetaddress = null;
  140. if (!this.getServerIp().isEmpty()) {
  141. inetaddress = InetAddress.getByName(this.getServerIp());
  142. }
  143. if (this.P() < 0) {
  144. this.setPort(this.propertyManager.getInt("server-port", 25565));
  145. }
  146. DedicatedServer.LOGGER.info("Generating keypair");
  147. this.a(MinecraftEncryption.b());
  148. DedicatedServer.LOGGER.info("Starting Minecraft server on {}:{}", new Object[] { this.getServerIp().isEmpty() ? "*" : this.getServerIp(), Integer.valueOf(this.P())});
  149. try {
  150. this.am().a(inetaddress, this.P());
  151. } catch (IOException ioexception) {
  152. DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!");
  153. DedicatedServer.LOGGER.warn("The exception was: {}", new Object[] { ioexception.toString()});
  154. DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?");
  155. return false;
  156. }
  157. this.a((PlayerList) (new DedicatedPlayerList(this))); // CraftBukkit
  158. if (!this.getOnlineMode()) {
  159. DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
  160. DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
  161. DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
  162. DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
  163. }
  164. if (this.aO()) {
  165. this.getUserCache().c();
  166. }
  167. if (!NameReferencingFileConverter.a(this.propertyManager)) {
  168. return false;
  169. } else {
  170. this.convertable = new WorldLoaderServer(server.getWorldContainer(), this.getDataConverterManager()); // CraftBukkit - moved from MinecraftServer constructor
  171. long j = System.nanoTime();
  172. if (this.S() == null) {
  173. this.setWorld(this.propertyManager.getString("level-name", "world"));
  174. }
  175. String s = this.propertyManager.getString("level-seed", "");
  176. String s1 = this.propertyManager.getString("level-type", "DEFAULT");
  177. String s2 = this.propertyManager.getString("generator-settings", "");
  178. long k = (new Random()).nextLong();
  179. if (!s.isEmpty()) {
  180. try {
  181. long l = Long.parseLong(s);
  182. if (l != 0L) {
  183. k = l;
  184. }
  185. } catch (NumberFormatException numberformatexception) {
  186. k = (long) s.hashCode();
  187. }
  188. }
  189. WorldType worldtype = WorldType.getType(s1);
  190. if (worldtype == null) {
  191. worldtype = WorldType.NORMAL;
  192. }
  193. this.ax();
  194. this.getEnableCommandBlock();
  195. this.q();
  196. this.getSnooperEnabled();
  197. this.aF();
  198. this.c(this.propertyManager.getInt("max-build-height", 256));
  199. this.c((this.getMaxBuildHeight() + 8) / 16 * 16);
  200. this.c(MathHelper.clamp(this.getMaxBuildHeight(), 64, 256));
  201. this.propertyManager.setProperty("max-build-height", Integer.valueOf(this.getMaxBuildHeight()));
  202. TileEntitySkull.a(this.getUserCache());
  203. TileEntitySkull.a(this.ay());
  204. UserCache.a(this.getOnlineMode());
  205. DedicatedServer.LOGGER.info("Preparing level \"{}\"", new Object[] { this.S()});
  206. this.a(this.S(), this.S(), k, worldtype, s2);
  207. long i1 = System.nanoTime() - j;
  208. String s3 = String.format("%.3fs", new Object[] { Double.valueOf((double) i1 / 1.0E9D)});
  209. DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\" or \"?\"", new Object[] { s3});
  210. if (this.propertyManager.getBoolean("enable-query", false)) {
  211. DedicatedServer.LOGGER.info("Starting GS4 status listener");
  212. this.n = new RemoteStatusListener(this);
  213. this.n.a();
  214. }
  215. if (this.propertyManager.getBoolean("enable-rcon", false)) {
  216. DedicatedServer.LOGGER.info("Starting remote control listener");
  217. this.p = new RemoteControlListener(this);
  218. this.p.a();
  219. this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(this.remoteControlCommandListener); // CraftBukkit
  220. }
  221. // CraftBukkit start
  222. if (this.server.getBukkitSpawnRadius() > -1) {
  223. DedicatedServer.LOGGER.info("'settings.spawn-radius' in bukkit.yml has been moved to 'spawn-protection' in server.properties. I will move your config for you.");
  224. this.propertyManager.properties.remove("spawn-protection");
  225. this.propertyManager.getInt("spawn-protection", this.server.getBukkitSpawnRadius());
  226. this.server.removeBukkitSpawnRadius();
  227. this.propertyManager.savePropertiesFile();
  228. }
  229. // CraftBukkit end
  230. if (this.aP() > 0L) {
  231. Thread thread1 = new Thread(new ThreadWatchdog(this));
  232. thread1.setName("Server Watchdog");
  233. thread1.setDaemon(true);
  234. thread1.start();
  235. }
  236. return true;
  237. }
  238. }
  239. }
  240. public String aK() {
  241. if (this.propertyManager.a("resource-pack-hash")) {
  242. if (this.propertyManager.a("resource-pack-sha1")) {
  243. DedicatedServer.LOGGER.warn("resource-pack-hash is deprecated and found along side resource-pack-sha1. resource-pack-hash will be ignored.");
  244. } else {
  245. DedicatedServer.LOGGER.warn("resource-pack-hash is deprecated. Please use resource-pack-sha1 instead.");
  246. this.propertyManager.getString("resource-pack-sha1", this.propertyManager.getString("resource-pack-hash", ""));
  247. this.propertyManager.b("resource-pack-hash");
  248. }
  249. }
  250. String s = this.propertyManager.getString("resource-pack-sha1", "");
  251. if (!s.isEmpty() && !DedicatedServer.l.matcher(s).matches()) {
  252. DedicatedServer.LOGGER.warn("Invalid sha1 for ressource-pack-sha1");
  253. }
  254. if (!this.propertyManager.getString("resource-pack", "").isEmpty() && s.isEmpty()) {
  255. DedicatedServer.LOGGER.warn("You specified a resource pack without providing a sha1 hash. Pack will be updated on the client only if you change the name of the pack.");
  256. }
  257. return s;
  258. }
  259. public void setGamemode(EnumGamemode enumgamemode) {
  260. super.setGamemode(enumgamemode);
  261. this.t = enumgamemode;
  262. }
  263. public boolean getGenerateStructures() {
  264. return this.generateStructures;
  265. }
  266. public EnumGamemode getGamemode() {
  267. return this.t;
  268. }
  269. public EnumDifficulty getDifficulty() {
  270. return EnumDifficulty.getById(this.propertyManager.getInt("difficulty", EnumDifficulty.NORMAL.a()));
  271. }
  272. public boolean isHardcore() {
  273. return this.propertyManager.getBoolean("hardcore", false);
  274. }
  275. public void a(CrashReport crashreport) {}
  276. public CrashReport b(CrashReport crashreport) {
  277. crashreport = super.b(crashreport);
  278. crashreport.g().a("Is Modded", new CrashReportCallable() {
  279. public String a() throws Exception {
  280. String s = DedicatedServer.this.getServerModName();
  281. return !"vanilla".equals(s) ? "Definitely; Server brand changed to \'" + s + "\'" : "Unknown (can\'t tell)";
  282. }
  283. public Object call() throws Exception {
  284. return this.a();
  285. }
  286. });
  287. crashreport.g().a("Type", new CrashReportCallable() {
  288. public String a() throws Exception {
  289. return "Dedicated Server (map_server.txt)";
  290. }
  291. public Object call() throws Exception {
  292. return this.a();
  293. }
  294. });
  295. return crashreport;
  296. }
  297. public void B() {
  298. System.exit(0);
  299. }
  300. public void D() { // CraftBukkit - fix decompile error
  301. super.D();
  302. this.aL();
  303. }
  304. public boolean getAllowNether() {
  305. return this.propertyManager.getBoolean("allow-nether", true);
  306. }
  307. public boolean getSpawnMonsters() {
  308. return this.propertyManager.getBoolean("spawn-monsters", true);
  309. }
  310. public void a(MojangStatisticsGenerator mojangstatisticsgenerator) {
  311. mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.aM().getHasWhitelist()));
  312. mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.aM().getWhitelisted().length));
  313. super.a(mojangstatisticsgenerator);
  314. }
  315. public boolean getSnooperEnabled() {
  316. return this.propertyManager.getBoolean("snooper-enabled", true);
  317. }
  318. public void issueCommand(String s, ICommandListener icommandlistener) {
  319. this.serverCommandQueue.add(new ServerCommand(s, icommandlistener));
  320. }
  321. public void aL() {
  322. while (!this.serverCommandQueue.isEmpty()) {
  323. ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
  324. // CraftBukkit start - ServerCommand for preprocessing
  325. ServerCommandEvent event = new ServerCommandEvent(console, servercommand.command);
  326. server.getPluginManager().callEvent(event);
  327. if (event.isCancelled()) continue;
  328. servercommand = new ServerCommand(event.getCommand(), servercommand.source);
  329. // this.getCommandHandler().a(servercommand.source, servercommand.command); // Called in dispatchServerCommand
  330. server.dispatchServerCommand(console, servercommand);
  331. // CraftBukkit end
  332. }
  333. }
  334. public boolean aa() {
  335. return true;
  336. }
  337. public boolean ae() {
  338. return this.propertyManager.getBoolean("use-native-transport", true);
  339. }
  340. public DedicatedPlayerList aM() {
  341. return (DedicatedPlayerList) super.getPlayerList();
  342. }
  343. public int a(String s, int i) {
  344. return this.propertyManager.getInt(s, i);
  345. }
  346. public String a(String s, String s1) {
  347. return this.propertyManager.getString(s, s1);
  348. }
  349. public boolean a(String s, boolean flag) {
  350. return this.propertyManager.getBoolean(s, flag);
  351. }
  352. public void a(String s, Object object) {
  353. this.propertyManager.setProperty(s, object);
  354. }
  355. public void a() {
  356. this.propertyManager.savePropertiesFile();
  357. }
  358. public String b() {
  359. File file = this.propertyManager.c();
  360. return file != null ? file.getAbsolutePath() : "No settings file";
  361. }
  362. public String d_() {
  363. return this.getServerIp();
  364. }
  365. public int e_() {
  366. return this.P();
  367. }
  368. public String f_() {
  369. return this.getMotd();
  370. }
  371. public void aN() {
  372. ServerGUI.a(this);
  373. this.u = true;
  374. }
  375. public boolean ao() {
  376. return this.u;
  377. }
  378. public String a(EnumGamemode enumgamemode, boolean flag) {
  379. return "";
  380. }
  381. public boolean getEnableCommandBlock() {
  382. return this.propertyManager.getBoolean("enable-command-block", false);
  383. }
  384. public int getSpawnProtection() {
  385. return this.propertyManager.getInt("spawn-protection", super.getSpawnProtection());
  386. }
  387. public boolean a(World world, BlockPosition blockposition, EntityHuman entityhuman) {
  388. if (world.worldProvider.getDimensionManager().getDimensionID() != 0) {
  389. return false;
  390. } else if (this.aM().getOPs().isEmpty()) {
  391. return false;
  392. } else if (this.aM().isOp(entityhuman.getProfile())) {
  393. return false;
  394. } else if (this.getSpawnProtection() <= 0) {
  395. return false;
  396. } else {
  397. BlockPosition blockposition1 = world.getSpawn();
  398. int i = MathHelper.a(blockposition.getX() - blockposition1.getX());
  399. int j = MathHelper.a(blockposition.getZ() - blockposition1.getZ());
  400. int k = Math.max(i, j);
  401. return k <= this.getSpawnProtection();
  402. }
  403. }
  404. public int q() {
  405. return this.propertyManager.getInt("op-permission-level", 4);
  406. }
  407. public void setIdleTimeout(int i) {
  408. super.setIdleTimeout(i);
  409. this.propertyManager.setProperty("player-idle-timeout", Integer.valueOf(i));
  410. this.a();
  411. }
  412. public boolean r() {
  413. return this.propertyManager.getBoolean("broadcast-rcon-to-ops", true);
  414. }
  415. public boolean s() {
  416. return this.propertyManager.getBoolean("broadcast-console-to-ops", true);
  417. }
  418. public boolean ax() {
  419. return this.propertyManager.getBoolean("announce-player-achievements", true);
  420. }
  421. public int aD() {
  422. int i = this.propertyManager.getInt("max-world-size", super.aD());
  423. if (i < 1) {
  424. i = 1;
  425. } else if (i > super.aD()) {
  426. i = super.aD();
  427. }
  428. return i;
  429. }
  430. public int aF() {
  431. return this.propertyManager.getInt("network-compression-threshold", super.aF());
  432. }
  433. protected boolean aO() {
  434. boolean flag = false;
  435. int i;
  436. for (i = 0; !flag && i <= 2; ++i) {
  437. if (i > 0) {
  438. DedicatedServer.LOGGER.warn("Encountered a problem while converting the user banlist, retrying in a few seconds");
  439. this.aR();
  440. }
  441. flag = NameReferencingFileConverter.a((MinecraftServer) this);
  442. }
  443. boolean flag1 = false;
  444. for (i = 0; !flag1 && i <= 2; ++i) {
  445. if (i > 0) {
  446. DedicatedServer.LOGGER.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds");
  447. this.aR();
  448. }
  449. flag1 = NameReferencingFileConverter.b((MinecraftServer) this);
  450. }
  451. boolean flag2 = false;
  452. for (i = 0; !flag2 && i <= 2; ++i) {
  453. if (i > 0) {
  454. DedicatedServer.LOGGER.warn("Encountered a problem while converting the op list, retrying in a few seconds");
  455. this.aR();
  456. }
  457. flag2 = NameReferencingFileConverter.c((MinecraftServer) this);
  458. }
  459. boolean flag3 = false;
  460. for (i = 0; !flag3 && i <= 2; ++i) {
  461. if (i > 0) {
  462. DedicatedServer.LOGGER.warn("Encountered a problem while converting the whitelist, retrying in a few seconds");
  463. this.aR();
  464. }
  465. flag3 = NameReferencingFileConverter.d((MinecraftServer) this);
  466. }
  467. boolean flag4 = false;
  468. for (i = 0; !flag4 && i <= 2; ++i) {
  469. if (i > 0) {
  470. DedicatedServer.LOGGER.warn("Encountered a problem while converting the player save files, retrying in a few seconds");
  471. this.aR();
  472. }
  473. flag4 = NameReferencingFileConverter.a(this, this.propertyManager);
  474. }
  475. return flag || flag1 || flag2 || flag3 || flag4;
  476. }
  477. private void aR() {
  478. try {
  479. Thread.sleep(5000L);
  480. } catch (InterruptedException interruptedexception) {
  481. ;
  482. }
  483. }
  484. public long aP() {
  485. return this.propertyManager.getLong("max-tick-time", TimeUnit.MINUTES.toMillis(1L));
  486. }
  487. public String getPlugins() {
  488. // CraftBukkit start - Whole method
  489. StringBuilder result = new StringBuilder();
  490. org.bukkit.plugin.Plugin[] plugins = server.getPluginManager().getPlugins();
  491. result.append(server.getName());
  492. result.append(" on Bukkit ");
  493. result.append(server.getBukkitVersion());
  494. if (plugins.length > 0 && server.getQueryPlugins()) {
  495. result.append(": ");
  496. for (int i = 0; i < plugins.length; i++) {
  497. if (i > 0) {
  498. result.append("; ");
  499. }
  500. result.append(plugins[i].getDescription().getName());
  501. result.append(" ");
  502. result.append(plugins[i].getDescription().getVersion().replaceAll(";", ","));
  503. }
  504. }
  505. return result.toString();
  506. // CraftBukkit end
  507. }
  508. // CraftBukkit start - fire RemoteServerCommandEvent
  509. public String executeRemoteCommand(final String s) {
  510. Waitable<String> waitable = new Waitable<String>() {
  511. @Override
  512. protected String evaluate() {
  513. remoteControlCommandListener.clearMessages();
  514. // Event changes start
  515. RemoteServerCommandEvent event = new RemoteServerCommandEvent(remoteConsole, s);
  516. server.getPluginManager().callEvent(event);
  517. if (event.isCancelled()) {
  518. return "";
  519. }
  520. // Event change end
  521. ServerCommand serverCommand = new ServerCommand(event.getCommand(), remoteControlCommandListener);
  522. server.dispatchServerCommand(remoteConsole, serverCommand);
  523. return remoteControlCommandListener.getMessages();
  524. }
  525. };
  526. processQueue.add(waitable);
  527. try {
  528. return waitable.get();
  529. } catch (java.util.concurrent.ExecutionException e) {
  530. throw new RuntimeException("Exception processing rcon command " + s, e.getCause());
  531. } catch (InterruptedException e) {
  532. Thread.currentThread().interrupt(); // Maintain interrupted state
  533. throw new RuntimeException("Interrupted processing rcon command " + s, e);
  534. }
  535. // CraftBukkit end
  536. }
  537. public PlayerList getPlayerList() {
  538. return this.aM();
  539. }
  540. // CraftBukkit start
  541. @Override
  542. public PropertyManager getPropertyManager() {
  543. return this.propertyManager;
  544. }
  545. // CraftBukkit end
  546. }