Skip to content

Commit

Permalink
Fix issues with auto pickup
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed Jan 11, 2023
1 parent 1e84807 commit a75f687
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -81,7 +81,7 @@ public CommandManager(@NotNull Minepacks plugin)
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));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -318,11 +318,11 @@ public double getFullInvRadius()
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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -58,8 +57,8 @@ public ItemsCollector(Minepacks plugin)
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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -216,7 +216,7 @@ private void load()
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();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit a75f687

Please sign in to comment.