Clean up some code and UI

This commit is contained in:
AlexTheCoder 2018-04-12 03:56:03 -04:00
parent 68e7361c00
commit 188d927727
5 changed files with 41 additions and 45 deletions

View File

@ -845,7 +845,6 @@ public class UtilText
RN_I[number % 10]; RN_I[number % 10];
} }
public static String replaceLeet(String in) public static String replaceLeet(String in)
{ {
if (in.trim().isEmpty()) if (in.trim().isEmpty())
@ -859,7 +858,7 @@ public class UtilText
} }
return in; return in;
} }
public static String capitalise(String input) public static String capitalise(String input)
{ {

View File

@ -20,19 +20,20 @@ public class DiscordButton implements GuiItem
.setData((short) 9) .setData((short) 9)
.setTitle(C.cGreen + C.Bold + "Visit our Discord Server") .setTitle(C.cGreen + C.Bold + "Visit our Discord Server")
.addLore( .addLore(
C.cWhite + "Check our our official Discord server where", C.cWhite + "Check out our official Discord server where",
C.cWhite + "you will find news, changelogs, giveaways,", C.cWhite + "you can find news, changelogs and giveaways,",
C.cWhite + "direct feedback to our admins, and more!", C.cWhite + "give direct feedback to our admins, and more!",
" ", " ",
C.cGreen + "Click to visit our discord!" C.cGreen + "Click to visit our Discord!"
) )
.build(); .build();
private static final String URL = "http://discord.mineplex.com"; private static final String URL = "http://discord.mineplex.com";
private final Player _player; private final Player _player;
public DiscordButton(Player player) public DiscordButton(Player player)
{ {
this._player = player; _player = player;
} }
@Override @Override
@ -61,4 +62,4 @@ public class DiscordButton implements GuiItem
{ {
return ICON; return ICON;
} }
} }

View File

@ -41,7 +41,6 @@ import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.chat.command.BroadcastCommand; import mineplex.core.chat.command.BroadcastCommand;
import mineplex.core.chat.command.ChatSlowCommand; import mineplex.core.chat.command.ChatSlowCommand;
import mineplex.core.chat.command.HelpCommand; import mineplex.core.chat.command.HelpCommand;
@ -93,7 +92,6 @@ public class Chat extends MiniPlugin
private final IncognitoManager _incognitoManager; private final IncognitoManager _incognitoManager;
private final CoreClientManager _clientManager; private final CoreClientManager _clientManager;
private final PreferencesManager _preferencesManager; private final PreferencesManager _preferencesManager;
private final AchievementManager _achievementManager;
private int _chatSlowCooldown = 0; private int _chatSlowCooldown = 0;
private long _silenceLength; private long _silenceLength;
@ -104,7 +102,6 @@ public class Chat extends MiniPlugin
private List<Function<AsyncPlayerChatEvent, Boolean>> _lowPriorityFilters = new ArrayList<>(); private List<Function<AsyncPlayerChatEvent, Boolean>> _lowPriorityFilters = new ArrayList<>();
private Map<UUID, MessageData> _playerLastMessage = new HashMap<>(); private Map<UUID, MessageData> _playerLastMessage = new HashMap<>();
private Map<UUID, Function<String, String>> _transformNextMessage = new HashMap<>();
public Chat() public Chat()
{ {
@ -113,7 +110,6 @@ public class Chat extends MiniPlugin
_incognitoManager = require(IncognitoManager.class); _incognitoManager = require(IncognitoManager.class);
_clientManager = require(CoreClientManager.class); _clientManager = require(CoreClientManager.class);
_preferencesManager = require(PreferencesManager.class); _preferencesManager = require(PreferencesManager.class);
_achievementManager = require(AchievementManager.class);
new SpamHandler(); new SpamHandler();
@ -191,7 +187,8 @@ public class Chat extends MiniPlugin
} }
} }
public long getChatSilence() { public long getChatSilence()
{
return _silenceLength; return _silenceLength;
} }
@ -452,19 +449,20 @@ public class Chat extends MiniPlugin
public static void trustCert() throws Exception public static void trustCert() throws Exception
{ {
TrustManager[] trustAllCerts = new TrustManager[] { TrustManager[] trustAllCerts = new TrustManager[]
new X509TrustManager() {
new X509TrustManager()
{
public java.security.cert.X509Certificate[] getAcceptedIssuers()
{ {
public java.security.cert.X509Certificate[] getAcceptedIssuers() return null;
{
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) { }
public void checkServerTrusted(X509Certificate[] certs, String authType) { }
} }
public void checkClientTrusted(X509Certificate[] certs, String authType) { }
public void checkServerTrusted(X509Certificate[] certs, String authType) { }
}
}; };
SSLContext sc = SSLContext.getInstance("SSL"); SSLContext sc = SSLContext.getInstance("SSL");

View File

@ -82,7 +82,8 @@ public class ChatExtraCommand extends CommandBase<Chat>
return; return;
} }
UtilServer.runAsync(() -> { UtilServer.runAsync(() ->
{
String chatMessage = ""; String chatMessage = "";
if (args.length > 0) if (args.length > 0)

View File

@ -5,15 +5,10 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import net.minecraft.server.v1_8_R3.EntityCreature;
import net.minecraft.server.v1_8_R3.NavigationAbstract;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color; import org.bukkit.Color;
@ -91,7 +86,6 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.visibility.VisibilityManager; import mineplex.core.visibility.VisibilityManager;
import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GamePrepareCountdownCommence; import nautilus.game.arcade.events.GamePrepareCountdownCommence;
@ -118,6 +112,11 @@ import nautilus.game.arcade.stats.BadHiderStatTracker;
import nautilus.game.arcade.stats.HunterKillerStatTracker; import nautilus.game.arcade.stats.HunterKillerStatTracker;
import nautilus.game.arcade.stats.HunterOfTheYearStatTracker; import nautilus.game.arcade.stats.HunterOfTheYearStatTracker;
import nautilus.game.arcade.stats.MeowStatTracker; import nautilus.game.arcade.stats.MeowStatTracker;
import net.minecraft.server.v1_8_R3.EntityCreature;
import net.minecraft.server.v1_8_R3.NavigationAbstract;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class HideSeek extends TeamGame public class HideSeek extends TeamGame
@ -207,16 +206,16 @@ public class HideSeek extends TeamGame
private boolean _started = false; private boolean _started = false;
private final HashMap<Player, Integer> _arrowHits = new HashMap<>(); private final Map<Player, Integer> _arrowHits = new HashMap<>();
private final HashMap<Player, Form> _forms = new HashMap<>(); private final Map<Player, Form> _forms = new HashMap<>();
private final HashMap<Player, InfestedData> _infested = new HashMap<>(); private final Map<Player, InfestedData> _infested = new HashMap<>();
private final HashSet<LivingEntity> _infestDeny = new HashSet<>(); private final Set<LivingEntity> _infestDeny = new HashSet<>();
private final HashMap<Creature, Location> _mobs = new HashMap<>(); private final Map<Creature, Location> _mobs = new HashMap<>();
private ArrayList<Material> _allowedBlocks; private List<Material> _allowedBlocks;
private ArrayList<EntityType> _allowedEnts; private List<EntityType> _allowedEnts;
private final Set<Player> _startingHunters = new HashSet<>(); private final Set<Player> _startingHunters = new HashSet<>();
@ -438,9 +437,7 @@ public class HideSeek extends TeamGame
int id = Integer.parseInt(split[i]); int id = Integer.parseInt(split[i]);
_allowedBlocks.add(Material.getMaterial(id)); _allowedBlocks.add(Material.getMaterial(id));
} }
catch (NumberFormatException ex) catch (NumberFormatException ex) {}
{
}
} }
}); });
@ -1789,12 +1786,12 @@ public class HideSeek extends TeamGame
super.disqualify(player); super.disqualify(player);
} }
public HashMap<Player, Form> getForms() public Map<Player, Form> getForms()
{ {
return _forms; return _forms;
} }
public ArrayList<Material> getAllowedBlocks() public List<Material> getAllowedBlocks()
{ {
return _allowedBlocks; return _allowedBlocks;
} }
@ -1803,4 +1800,4 @@ public class HideSeek extends TeamGame
{ {
return true; return true;
} }
} }