Revert "Prepare for v2.2 update". The code added with the previous release is not needed in v2.2

This commit is contained in:
GeorgH93 2020-02-16 23:41:52 +01:00
parent 6b2aa5fde2
commit bac4de18fa
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
5 changed files with 11 additions and 62 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>at.pcgamingfreaks</groupId> <groupId>at.pcgamingfreaks</groupId>
<artifactId>Minepacks</artifactId> <artifactId>Minepacks</artifactId>
<version>2.1.8</version> <version>2.1.7</version>
<scm> <scm>
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection> <connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
@ -78,7 +78,7 @@
<dependency> <dependency>
<groupId>at.pcgamingfreaks</groupId> <groupId>at.pcgamingfreaks</groupId>
<artifactId>PluginLib</artifactId> <artifactId>PluginLib</artifactId>
<version>1.0.20-SNAPSHOT</version> <version>1.0.19-SNAPSHOT</version>
</dependency> </dependency>
<!-- BadRabbit --> <!-- BadRabbit -->
<dependency> <dependency>

View File

@ -57,7 +57,10 @@ Database:
AutoCleanup: AutoCleanup:
# Defines the max amount of days backpacks will be stored. -1 to disable auto cleanup # Defines the max amount of days backpacks will be stored. -1 to disable auto cleanup
MaxInactiveDays: -1 MaxInactiveDays: -1
# If you would like to use UUIDs. This option will be removed with the v2.2 update. It is not recommended to set this to false! # If you would like to use UUIDs, it is recommended not to change this setting unless you know what you are doing!
# true: Should be used if your server is running Minecraft 1.7.5 or newer
# false: In offline mode or for minecraft version below 1.7.5
# If you are using BungeeCord please set this setting based on your BungeeCord's online mode!!!
UseUUIDs: true UseUUIDs: true
# Defines the storage format for UUIDs for compatibility with other plugins (shared tables) # Defines the storage format for UUIDs for compatibility with other plugins (shared tables)
# true: format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # true: format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@ -177,4 +180,4 @@ Misc:
UseBungeeCord: false UseBungeeCord: false
# Config file version. Don't touch it! # Config file version. Don't touch it!
Version: 23 Version: 22

View File

@ -37,7 +37,7 @@
public class Config extends Configuration implements DatabaseConnectionConfiguration public class Config extends Configuration implements DatabaseConnectionConfiguration
{ {
private static final int CONFIG_VERSION = 23, UPGRADE_THRESHOLD = 23, PRE_V2_VERSION = 20; private static final int CONFIG_VERSION = 22, UPGRADE_THRESHOLD = 22, PRE_V2_VERSION = 20;
public Config(JavaPlugin plugin) public Config(JavaPlugin plugin)
{ {
@ -112,8 +112,8 @@ public String getDBFields(String sub, String def)
public boolean getUseUUIDs() public boolean getUseUUIDs()
{ {
boolean uuid = getConfigE().getBoolean("Database.UseUUIDs", true) && MCVersion.isUUIDsSupportAvailable(); boolean uuid = getConfigE().getBoolean("Database.UseUUIDs", true);
if(!uuid) logger.severe(ConsoleColor.RED + "Disabling UUIDs is not recommended and can lead to unexpected behaviour. Please consider enabling UUIDs. The option will be removed with the v2.2 update." + ConsoleColor.RESET); if(!uuid) logger.warning(ConsoleColor.RED + "Disabling UUIDs is not recommended and can lead to unexpected behaviour. Please consider enabling UUIDs. The option will be removed at some point." + ConsoleColor.RESET);
return uuid; return uuid;
} }
@ -176,7 +176,7 @@ public int getBackpackMaxSize()
public boolean getAutoUpdate() public boolean getAutoUpdate()
{ {
return getConfigE().getBoolean("Misc.AutoUpdate", true) && MCVersion.isUUIDsSupportAvailable(); return getConfigE().getBoolean("Misc.AutoUpdate", true);
} }
public boolean isBungeeCordModeEnabled() public boolean isBungeeCordModeEnabled()

View File

@ -1,53 +0,0 @@
/*
* Copyright (C) 2020 GeorgH93
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package at.pcgamingfreaks.Minepacks.Bukkit.Listener;
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
public class NoUUIDWarning implements Listener
{
public NoUUIDWarning(){}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onAdminJoin(PlayerJoinEvent event)
{
if(event.getPlayer().hasPermission("backpack.reload"))
{
final Player player = event.getPlayer();
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(Minepacks.getInstance(), () -> {
if(player.isOnline())
{
String prefix = ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + "Minepacks" + ChatColor.DARK_GRAY + "] " + ChatColor.RED;
player.sendMessage(ChatColor.RED + "########## Warning ##########");
player.sendMessage(prefix + "With the upcoming v2.2 update the option to disable UUIDs will be removed.");
player.sendMessage(prefix + "If you are using BungeeCord or another proxy the plugin will not be able to autodetect if it should use online or offline mode UUIDs and you should set the 'UUID_Type' config option manually before updating to v2.2.");
player.sendMessage(prefix + "Please note that if you have many old players in your database already it is possible that some have already changed their name and will fail to convert to UUID. You will have to remove them manually from your database after converting to UUIDs. Not doing so will make the plugin try to convert them to UUIDs on every startup/reload.");
player.sendMessage(ChatColor.RED + "########## Warning ##########");
}
}, 40);
}
}
}

View File

@ -195,7 +195,6 @@ private void load()
} }
if(config.isShulkerboxesDisable()) pluginManager.registerEvents(new DisableShulkerboxes(this), this); if(config.isShulkerboxesDisable()) pluginManager.registerEvents(new DisableShulkerboxes(this), this);
if(config.isItemShortcutEnabled()) pluginManager.registerEvents(new ItemShortcut(this), this); if(config.isItemShortcutEnabled()) pluginManager.registerEvents(new ItemShortcut(this), this);
if(!config.getUseUUIDs() && config.getString("Database.UUID_Type", "auto").equalsIgnoreCase("auto") && MCVersion.isUUIDsSupportAvailable()) pluginManager.registerEvents(new NoUUIDWarning(), this);
//endregion //endregion
if(config.getFullInvCollect()) collector = new ItemsCollector(this); if(config.getFullInvCollect()) collector = new ItemsCollector(this);
worldBlacklist = config.getWorldBlacklist(); worldBlacklist = config.getWorldBlacklist();