From 299fac95fbcd4e15c440db2d6f902415501ca0c5 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 29 Apr 2019 11:02:47 -0400 Subject: [PATCH] Add a stupidity fail-safe. --- .../plotsquared/bukkit/BukkitMain.java | 3 - .../bukkit/util/BukkitLegacyMappings.java | 61 +++++++++++-------- .../plotsquared/bukkit/util/BukkitUtil.java | 8 ++- 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 8aaea98fe..3411e85ba 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -116,10 +116,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain @Override public void onEnable() { - this.pluginName = getDescription().getName(); - getServer().getName(); - PlotPlayer.registerConverter(Player.class, BukkitUtil::getPlayer); if (Bukkit.getVersion().contains("git-Spigot")) { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java index 00edbb660..061712d02 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java @@ -1,36 +1,44 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; -import lombok.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; +import lombok.AccessLevel; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.ToString; import org.bukkit.Bukkit; import org.bukkit.Material; -import java.util.*; -import java.util.stream.Collectors; - /** * Borrowed from https://github.com/Phoenix616/IDConverter/blob/master/mappings/src/main/java/de/themoep/idconverter/IdMappings.java * Original License: *
- * Minecraft ID mappings - * Copyright (C) 2017 Max Lee (https://github.com/Phoenix616) + * Minecraft ID mappings Copyright (C) 2017 Max Lee (https://github.com/Phoenix616) *
- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. *
- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see