Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bukkit/src/main/java/org/popcraft/bolt/BoltPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -140,6 +141,7 @@
import org.popcraft.bolt.util.Mode;
import org.popcraft.bolt.util.ProtectableConfig;

import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -252,6 +254,7 @@ public void reload() {
this.doorsFixPlugins = getConfig().getBoolean("doors.fix-plugins", false);
registerAccessTypes();
registerProtectableAccess();
nagInvalidHopperConfig();
registerAccessSources();
initializeMatchers();
loadDefaultModes();
Expand Down Expand Up @@ -381,6 +384,17 @@ private void registerProtectableAccess() {
}
}

private void nagInvalidHopperConfig() {
if (getConfig().getBoolean("settings.ignore-hopper-nag", false) || !protectableBlocks.containsKey(Material.HOPPER)) {
return;
}
final File paperWorldDefaultsFile = Path.of(".").resolve("config/paper-world-defaults.yml").toFile();
final YamlConfiguration paperWorldDefaults = YamlConfiguration.loadConfiguration(paperWorldDefaultsFile);
if (paperWorldDefaults.getBoolean("hopper.disable-move-event", false)) {
getLogger().warning(() -> "The server's Paper config has disable-move-event enabled. As a result, Hopper protections will not function properly. To resolve this issue, please either disable this in the Paper config, or remove hoppers from the blocks list in your Bolt config if you do not want hoppers protected.");
}
}

private void registerAccessSources() {
final SourceTypeRegistry sourceTypeRegistry = bolt.getSourceTypeRegistry();
sourceTypeRegistry.unregisterAll();
Expand Down