[Idea]: Folia support for OpenInv #196

Closed
reabuc wants to merge 137 commits from master into master
74 changed files with 7287 additions and 3016 deletions
Showing only changes of commit 79b2a97c9e - Show all commits

View File

@@ -76,6 +76,10 @@ public class SearchContainerCommand implements TabExecutor {
} }
} }
// Clamp radius.
int configMax = plugin.getConfig().getInt("settings.command.searchcontainer.max-radius", 10);
radius = Math.max(0, Math.min(radius, configMax));
World world = senderPlayer.getWorld(); World world = senderPlayer.getWorld();
Chunk centerChunk = senderPlayer.getLocation().getChunk(); Chunk centerChunk = senderPlayer.getLocation().getChunk();
StringBuilder locations = new StringBuilder(); StringBuilder locations = new StringBuilder();

View File

@@ -71,6 +71,7 @@ public record ConfigUpdater(OpenInv plugin) {
private void updateConfig5To6() { private void updateConfig5To6() {
plugin.getServer().getScheduler().runTask(plugin, () -> { plugin.getServer().getScheduler().runTask(plugin, () -> {
plugin.getConfig().set("settings.command.open.no-args-opens-self", false); plugin.getConfig().set("settings.command.open.no-args-opens-self", false);
plugin.getConfig().set("settings.command.searchcontainer.max-radius", 10);
plugin.getConfig().set("config-version", 6); plugin.getConfig().set("config-version", 6);
}); });
} }

View File

@@ -3,6 +3,8 @@ settings:
command: command:
open: open:
no-args-opens-self: false no-args-opens-self: false
searchcontainer:
max-radius: 10
disable-offline-access: false disable-offline-access: false
disable-saving: false disable-saving: false
locale: 'en_us' locale: 'en_us'