mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
Revert "Apply webhook for some events"
This reverts commit 70e0e458 Former-commit-id: 6b525f2f6e71ab55eaa498e5c5c401cf3d0b9461 [formerly 905bed5713f8902adc3e8ce91c04673c99a00348] Former-commit-id: bfd717b77365607a5050b2a885b4f2d85f83aba9
This commit is contained in:
1 parent
5fd231624f
commit
8a3367fbec
3 files changed
+7
-52
No files matched your search
@@ -18,7 +18,6 @@ public class InternalListener implements Listener {
|
||||
return;
|
||||
}
|
||||
plugin.log("Player " + event.getPlayer().getName() + " created a shop at location " + event.getShop().getLocation());
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@@ -27,7 +26,6 @@ public class InternalListener implements Listener {
|
||||
return;
|
||||
}
|
||||
plugin.log("Shop at " + event.getShop().getLocation() + " was removed.");
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@@ -37,7 +35,6 @@ public class InternalListener implements Listener {
|
||||
}
|
||||
plugin.log("Shop at location " + event.getShop().getLocation() + " moderator was changed to " + event.getModerator()
|
||||
.toString());
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@@ -47,7 +44,6 @@ public class InternalListener implements Listener {
|
||||
}
|
||||
plugin.log("Shop at location " + event.getShop().getLocation() + " price was changed from " + event
|
||||
.getOldPrice() + " to " + event.getNewPrice());
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@@ -55,41 +51,9 @@ public class InternalListener implements Listener {
|
||||
if (ListenerHelper.isDisabled(event.getClass())) {
|
||||
return;
|
||||
}
|
||||
plugin.log("Player " + event.getPlayer().getName() + " purchased " + event.getShop().ownerName() + " shop " + event.getShop() + " for items x" + event
|
||||
plugin.log("Player " + event.getPlayer().getName() + " purchased " + event.getShop().ownerName() + " shop "+event.getShop()+" for items x" + event
|
||||
.getAmount() + " for " + plugin.getEconomy().format(event.getBalance()) + " (" + plugin.getEconomy()
|
||||
.format(event.getTax()) + " tax).");
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void shopLoad(ShopLoadEvent event) {
|
||||
if (ListenerHelper.isDisabled(event.getClass())) {
|
||||
return;
|
||||
}
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void shopUnload(ShopUnloadEvent event) {
|
||||
if (ListenerHelper.isDisabled(event.getClass())) {
|
||||
return;
|
||||
}
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void shopSignUpdate(ShopSignUpdatedEvent event) {
|
||||
if (ListenerHelper.isDisabled(event.getClass())) {
|
||||
return;
|
||||
}
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void shopUpdate(ShopUpdateEvent event) {
|
||||
if (ListenerHelper.isDisabled(event.getClass())) {
|
||||
return;
|
||||
}
|
||||
plugin.getWebhookHelper().noticeOnlyAsync(event);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@ import org.maxgamer.quickshop.Shop.ShopManager;
|
||||
import org.maxgamer.quickshop.Util.Timer;
|
||||
import org.maxgamer.quickshop.Util.*;
|
||||
import org.maxgamer.quickshop.Watcher.*;
|
||||
import org.maxgamer.quickshop.Webhook.WebhookHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -160,7 +159,6 @@ public class QuickShop extends JavaPlugin {
|
||||
*/
|
||||
private static PermissionManager permissionManager;
|
||||
private OngoingFeeWatcher ongoingFeeWatcher;
|
||||
private WebhookHelper webhookHelper;
|
||||
|
||||
/**
|
||||
* Get the Player's Shop limit.
|
||||
@@ -443,7 +441,7 @@ public class QuickShop extends JavaPlugin {
|
||||
if (getConfig().getInt("shop.find-distance") > 100) {
|
||||
getLogger().severe("Shop.find-distance is too high! It may cause lag! Pick a number under 100!");
|
||||
}
|
||||
this.webhookHelper = new WebhookHelper(this);
|
||||
|
||||
/* Load all shops. */
|
||||
shopLoader = new ShopLoader(this);
|
||||
shopLoader.loadShops();
|
||||
@@ -1056,20 +1054,19 @@ public class QuickShop extends JavaPlugin {
|
||||
getConfig().set("config-version", 68);
|
||||
selectedVersion = 68;
|
||||
}
|
||||
if (selectedVersion == 68) {
|
||||
ArrayList<String> temp = new ArrayList<>();
|
||||
;
|
||||
if (selectedVersion == 68){
|
||||
ArrayList<String> temp = new ArrayList<>();;
|
||||
temp.add("SoulBound");
|
||||
getConfig().set("shop.blacklist-lores", temp);
|
||||
getConfig().set("config-version", 69);
|
||||
selectedVersion = 69;
|
||||
}
|
||||
if (selectedVersion == 69) {
|
||||
if (selectedVersion == 69){
|
||||
getConfig().set("shop.display-item-use-name", false);
|
||||
getConfig().set("config-version", 70);
|
||||
selectedVersion = 70;
|
||||
}
|
||||
if (selectedVersion == 70) {
|
||||
if (selectedVersion == 70){
|
||||
getConfig().set("webhook.enable", false);
|
||||
getConfig().set("webhook.url", "https://example.com/webhookListener.php");
|
||||
getConfig().set("config-version", 71);
|
||||
|
||||
@@ -40,9 +40,6 @@ public class WebhookHelper {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!plugin.getConfig().getBoolean("webhook.enable")) {
|
||||
return;
|
||||
}
|
||||
HandledConnection connection;
|
||||
try {
|
||||
connection = handleConnection();
|
||||
@@ -92,9 +89,6 @@ public class WebhookHelper {
|
||||
}
|
||||
|
||||
public void noticeOnlySync(@NotNull Object obj) {
|
||||
if (!plugin.getConfig().getBoolean("webhook.enable")) {
|
||||
return;
|
||||
}
|
||||
HandledConnection connection;
|
||||
try {
|
||||
connection = handleConnection();
|
||||
@@ -141,7 +135,7 @@ public class WebhookHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private HandledConnection handleConnection() throws IOException, IllegalArgumentException {
|
||||
public HandledConnection handleConnection() throws IOException, IllegalArgumentException {
|
||||
String urls = plugin.getConfig().getString("webhook.url");
|
||||
if (urls == null) {
|
||||
throw new IllegalArgumentException("Webhook URL is null, did you set the url in config.yml?");
|
||||
|
||||
Reference in new issue
Block a user