bugfix 🪱 fixed possible bug that features may be activated even when config says they should not; improved loggin; properly added anvill event listener; replaced deprecated AnvillInventory with new AnvilView

This commit is contained in:
2025-12-07 16:06:38 +01:00
parent 5eb08e1859
commit 1ff91018a6
7 changed files with 43 additions and 12 deletions

View File

@@ -42,11 +42,18 @@ public class BetterMinecraft extends JavaPlugin implements Listener {
// Registers Events
this.getLogger().info(prefix + ChatColor.WHITE + "Load Events");
this.getServer().getPluginManager().registerEvents(new BedListener(this.gameManager), this);
this.getServer().getPluginManager().registerEvents(new KillListener(this.gameManager), this);
this.getServer().getPluginManager().registerEvents(new InteractListener(this.gameManager), this);
this.getServer().getPluginManager().registerEvents(new PrepareAnvilListener(this.gameManager), this);
this.getServer().getPluginManager().registerEvents(this, this);
try {
if(this.playerData.readBooleanFromConfig("improved_bed")) this.getServer().getPluginManager().registerEvents(new BedListener(this.gameManager), this);
if(this.playerData.readBooleanFromConfig("custom_drops")) this.getServer().getPluginManager().registerEvents(new KillListener(this.gameManager), this);
if(this.playerData.readBooleanFromConfig("replanting")) this.getServer().getPluginManager().registerEvents(new InteractListener(this.gameManager), this);
if(this.playerData.readBooleanFromConfig("anvil_fix")) this.getServer().getPluginManager().registerEvents(new PrepareAnvilListener(this.gameManager), this);
if(this.playerData.readBooleanFromConfig("back_command")) this.getServer().getPluginManager().registerEvents(this, this);
} catch (ConfigEntryExceptions e) {
throw new RuntimeException(e);
}
Objects.requireNonNull(this.getCommand("back")).setExecutor(new back(this.gameManager));