Fix issues with auto pickup

#241 #242
This commit is contained in:
GeorgH93 2023-01-11 19:15:39 +01:00
parent 1e84807d2b
commit a75f687985
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
5 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 GeorgH93
* Copyright (C) 2023 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
@ -81,7 +81,7 @@ public class CommandManager extends CommandExecutorWithSubCommandsGeneric<Minepa
registerSubCommand(new RestoreCommand(plugin));
registerSubCommand(new MigrateCommand(plugin));
registerSubCommand(new VersionCommand(plugin));
if (plugin.getConfiguration().getFullInvCollect() && plugin.getConfiguration().isToggleAllowed()) registerSubCommand(new PickupCommand(plugin));
if (plugin.getConfiguration().isFullInvToggleAllowed()) registerSubCommand(new PickupCommand(plugin));
registerSubCommand(new DebugCommand(plugin));
registerSubCommand(new HelpCommand(plugin, commands, this));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 GeorgH93
* Copyright (C) 2023 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
@ -318,11 +318,11 @@ public class Config extends Configuration implements DatabaseConnectionConfigura
return getConfigE().getDouble("FullInventory.CollectRadius", 1.5); // in blocks
}
public boolean isToggleAllowed() {
public boolean isFullInvToggleAllowed() {
return getConfigE().getBoolean("FullInventory.IsToggleAllowed", false);
}
public boolean isEnabledOnJoin() {
public boolean isFullInvEnabledOnJoin() {
return getFullInvCollect();
}
//endregion

View File

@ -1,6 +1,5 @@
/*
* Copyright (C) 2022 MartenM
* Copyright (C) 2022 GeorgH93
* Copyright (C) 2023 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
@ -58,8 +57,8 @@ public class ItemsCollector extends BukkitRunnable
this.plugin = plugin;
this.radius = plugin.getConfiguration().getFullInvRadius();
this.isToggleable = plugin.getConfiguration().isToggleAllowed();
this.enabledOnJoin = plugin.getConfiguration().isEnabledOnJoin();
this.isToggleable = plugin.getConfiguration().isFullInvToggleAllowed();
this.enabledOnJoin = plugin.getConfiguration().isFullInvEnabledOnJoin();
this.toggleList = new HashSet<>();
task = runTaskTimer(plugin, plugin.getConfiguration().getFullInvCheckInterval(), plugin.getConfiguration().getFullInvCheckInterval());

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 GeorgH93
* Copyright (C) 2023 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
@ -216,7 +216,7 @@ public class Minepacks extends JavaPlugin implements MinepacksPlugin, IPlugin
else shortcut = null;
if(config.isWorldWhitelistMode()) pluginManager.registerEvents(new WorldBlacklistUpdater(this), this);
//endregion
if(config.getFullInvCollect()) collector = new ItemsCollector(this);
if(config.getFullInvCollect() || config.isFullInvToggleAllowed()) collector = new ItemsCollector(this);
worldBlacklist = config.getWorldBlacklist();
worldBlacklistMode = (worldBlacklist.size() == 0) ? WorldBlacklistMode.None : config.getWorldBlockMode();

View File

@ -7,7 +7,7 @@
<packaging>pom</packaging>
<properties>
<revision>2.4.11</revision>
<revision>2.4.12</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>