|
9 | 9 |
|
10 | 10 | import org.apache.commons.lang3.exception.ExceptionUtils; |
11 | 11 | import org.bukkit.Bukkit; |
12 | | -import org.bukkit.event.EventHandler; |
13 | 12 | import org.bukkit.event.Listener; |
14 | | -import org.bukkit.event.server.ServerCommandEvent; |
15 | 13 | import org.bukkit.generator.ChunkGenerator; |
16 | 14 | import org.bukkit.plugin.PluginManager; |
17 | 15 | import org.bukkit.plugin.java.JavaPlugin; |
@@ -151,7 +149,7 @@ public void onEnable(){ |
151 | 149 | saveConfig(); |
152 | 150 |
|
153 | 151 | // Set up click timeout |
154 | | - lastClick = new ExpiringMap<Pair<UUID, String>, Boolean>(getSettings().getClickCooldownMs(), TimeUnit.MILLISECONDS); |
| 152 | + lastClick = new ExpiringMap<>(getSettings().getClickCooldownMs(), TimeUnit.MILLISECONDS); |
155 | 153 |
|
156 | 154 | // Start Database managers |
157 | 155 | playersManager = new PlayersManager(this); |
@@ -376,18 +374,6 @@ public void onDisable() { |
376 | 374 |
|
377 | 375 | } |
378 | 376 |
|
379 | | - @EventHandler |
380 | | - public void onServerStop(ServerCommandEvent e) { |
381 | | - /* This is no longer needed as with https://github.com/Multiverse/Multiverse-Core/releases/tag/4.3.12 (or maybe earlier) the issue |
382 | | - * is fixed where the generator was not remembered across reboots. |
383 | | - */ |
384 | | - /* |
385 | | - if (islandWorldManager != null && (e.getCommand().equalsIgnoreCase("stop") || e.getCommand().equalsIgnoreCase("restart"))) { |
386 | | - // Unregister any MV worlds if () { |
387 | | - //islandWorldManager.registerWorldsToMultiverse(false); |
388 | | - }*/ |
389 | | - } |
390 | | - |
391 | 377 | /** |
392 | 378 | * Returns the player manager |
393 | 379 | * @return the player manager |
@@ -675,11 +661,11 @@ public boolean isShutdown() { |
675 | 661 | * @return false if they can click and the timeout is started, otherwise true. |
676 | 662 | */ |
677 | 663 | public boolean onTimeout(User user, Panel panel) { |
678 | | - if (lastClick.containsKey(new Pair<UUID, String>(user.getUniqueId(), panel.getName()))) { |
| 664 | + if (lastClick.containsKey(new Pair<>(user.getUniqueId(), panel.getName()))) { |
679 | 665 | user.notify("general.errors.slow-down"); |
680 | 666 | return true; |
681 | 667 | } |
682 | | - lastClick.put(new Pair<UUID, String>(user.getUniqueId(), panel.getName()), true); |
| 668 | + lastClick.put(new Pair<>(user.getUniqueId(), panel.getName()), true); |
683 | 669 | return false; |
684 | 670 | } |
685 | 671 | } |
0 commit comments