diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/ClearLaggListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/ClearLaggListener.java index aa4bb5509..33ca71331 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/ClearLaggListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/ClearLaggListener.java @@ -33,10 +33,6 @@ public class ClearLaggListener implements Listener { @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH) public void plugin(me.minebuilders.clearlag.events.EntityRemoveEvent clearlaggEvent) { - if (ListenerHelper.isDisabled(clearlaggEvent.getClass())) { - return; - } - final List entities = clearlaggEvent.getEntityList(); final List pendingExclude = new ArrayList<>(); diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/DisplayBugFixListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/DisplayBugFixListener.java index a758457d7..e93b63680 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/DisplayBugFixListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/DisplayBugFixListener.java @@ -39,8 +39,7 @@ public class DisplayBugFixListener implements Listener { @EventHandler(ignoreCancelled = true) public void canBuild(BlockCanBuildEvent e) { - if (ListenerHelper.isDisabled(e.getClass()) - || !plugin.isDisplay() + if (!plugin.isDisplay() || DisplayItem.getNowUsing() != DisplayType.ARMORSTAND || e.isBuildable()) { return; diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java index 4017c45cf..5c7f8d7cc 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java @@ -79,7 +79,7 @@ public class ShopProtectionListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockFromTo(BlockFromToEvent e) { - if (ListenerHelper.isDisabled(e.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } @@ -95,7 +95,7 @@ public class ShopProtectionListener implements Listener { // Protect Redstone active shop @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockRedstoneChange(BlockRedstoneEvent event) { - if (ListenerHelper.isDisabled(event.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } @@ -114,7 +114,7 @@ public class ShopProtectionListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockSpread(BlockSpreadEvent e) { - if (ListenerHelper.isDisabled(e.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } @@ -155,9 +155,6 @@ public class ShopProtectionListener implements Listener { @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onInventoryMove(InventoryMoveItemEvent event) { - if (ListenerHelper.isDisabled(event.getClass())) { - return; - } final Location loc = event.getSource().getLocation(); @@ -201,7 +198,7 @@ public class ShopProtectionListener implements Listener { // Protect Entity pickup shop @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onMobChangeBlock(EntityChangeBlockEvent event) { - if (ListenerHelper.isDisabled(event.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } @@ -222,7 +219,7 @@ public class ShopProtectionListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onStructureGrow(StructureGrowEvent event) { - if (ListenerHelper.isDisabled(event.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } @@ -244,7 +241,7 @@ public class ShopProtectionListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onSpongeing(SpongeAbsorbEvent event) { - if (ListenerHelper.isDisabled(event.getClass()) || !useEnhanceProtection) { + if (!useEnhanceProtection) { return; } List blocks = event.getBlocks(); diff --git a/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java b/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java index 0b5baf12d..0bb67931f 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java +++ b/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java @@ -67,7 +67,6 @@ public class PermissionChecker { beMainHand = new BlockBreakEvent(block, player); // Call for event for protection check start - ListenerHelper.disableEvent(beMainHand.getClass()); Bukkit.getPluginManager() .callEvent( new ShopProtectionCheckEvent( @@ -80,7 +79,6 @@ public class PermissionChecker { .callEvent( new ShopProtectionCheckEvent( block.getLocation(), player, ProtectionCheckStatus.END, beMainHand)); - ListenerHelper.enableEvent(beMainHand.getClass()); return !beMainHand.isCancelled(); } } diff --git a/src/main/java/org/maxgamer/quickshop/Util/SentryErrorReporter.java b/src/main/java/org/maxgamer/quickshop/Util/SentryErrorReporter.java index 09377cc9d..b7f6e3414 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/SentryErrorReporter.java +++ b/src/main/java/org/maxgamer/quickshop/Util/SentryErrorReporter.java @@ -19,8 +19,8 @@ package org.maxgamer.quickshop.Util; -import io.sentry.Sentry; import io.sentry.SentryClient; +import io.sentry.SentryClientFactory; import io.sentry.context.Context; import io.sentry.event.BreadcrumbBuilder; import io.sentry.event.UserBuilder; @@ -64,7 +64,7 @@ public class SentryErrorReporter { this.plugin = plugin; // sentryClient = Sentry.init(dsn); Util.debugLog("Loading SentryErrorReporter"); - sentryClient = SentryClientFactory.create(dsn);; + sentryClient = SentryClientFactory.sentryClient(dsn);; context = sentryClient.getContext(); Util.debugLog("Setting basic report data..."); // context.addTag("plugin_version", QuickShop.getVersion());