Former-commit-id: eca4e4a7ddd56c3c0143ca0405e19d79417cb88d
This commit is contained in:
sandtechnology committed 2020-03-01 20:14:21 +08:00
commit 59f012db17
7 files changed
+1412 -1342

No files matched your search

@@ -30,11 +30,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.SpongeAbsorbEvent;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
@@ -161,7 +157,6 @@ public class ShopProtectionListener implements Listener {
if (loc == null) {
return;
}
final Shop shop = plugin.getShopManager().getShopIncludeAttached(loc);
if (shop == null) {
@@ -28,9 +28,12 @@ import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.PluginsIntegration.IntegrateStage;
import org.maxgamer.quickshop.PluginsIntegration.IntegratedPlugin;
import org.maxgamer.quickshop.PluginsIntegration.IntegrationStage;
import org.maxgamer.quickshop.QuickShop;
@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
public class FactionsUUIDIntegration implements IntegratedPlugin {
private List<String> createFlags;
private List<String> tradeFlags;
@@ -27,10 +27,13 @@ import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.PluginsIntegration.IntegrateStage;
import org.maxgamer.quickshop.PluginsIntegration.IntegratedPlugin;
import org.maxgamer.quickshop.PluginsIntegration.IntegrationStage;
import org.maxgamer.quickshop.QuickShop;
@SuppressWarnings("DuplicatedCode")
@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
public class ResidenceIntegration implements IntegratedPlugin {
List<String> createLimits;
List<String> tradeLimits;
File diff suppressed because it is too large. Load diff
@@ -20,6 +20,12 @@
package org.maxgamer.quickshop.Shop;
import com.google.common.collect.Sets;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.*;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.stream.Collectors;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@@ -40,13 +46,6 @@ import org.maxgamer.quickshop.QuickShop;
import org.maxgamer.quickshop.Util.MsgUtil;
import org.maxgamer.quickshop.Util.Util;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.*;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.stream.Collectors;
/**
* Manage a lot of shops.
*/
@@ -753,6 +752,21 @@ public class ShopManager {
* @return The shop at that location
*/
public @Nullable Shop getShop(@NotNull Location loc) {
return getShop(loc, false);
}
/**
* Gets a shop in a specific location
*
* @param loc The location to get the shop from
* @return The shop at that location
*/
public @Nullable Shop getShop(@NotNull Location loc, boolean skinShopableChecking) {
if (!skinShopableChecking) {
if (!Util.isShoppables(loc.getBlock().getType())) {
return null;
}
}
HashMap<Location, Shop> inChunk = getShops(loc.getChunk());
if (inChunk == null) {
return null;
@@ -35,7 +35,7 @@ public class IntegrationHelper {
public void register(@NotNull IntegratedPlugin clazz) {
if (!isIntegrationClass(clazz)) {
throw new InvaildIntegratedPluginClass();
throw new InvaildIntegratedPluginClass("Invaild Integration module: " + clazz.getName());
}
Util.debugLogHeavy("Registering " + clazz.getName());
integrations.add(clazz);
@@ -62,9 +62,9 @@ public class IntegrationHelper {
+ integratedPlugin.getName()
+ " stage is "
+ integratedPlugin
.getClass()
.getDeclaredAnnotation(IntegrationStage.class)
.loadStage());
.getClass()
.getDeclaredAnnotation(IntegrationStage.class)
.loadStage());
}
});
}
@@ -82,9 +82,9 @@ public class IntegrationHelper {
+ integratedPlugin.getName()
+ " stage is "
+ integratedPlugin
.getClass()
.getDeclaredAnnotation(IntegrationStage.class)
.loadStage());
.getClass()
.getDeclaredAnnotation(IntegrationStage.class)
.loadStage());
}
});
}
@@ -112,6 +112,16 @@ public class IntegrationHelper {
private boolean isIntegrationClass(@NotNull IntegratedPlugin clazz) {
return clazz.getClass().getDeclaredAnnotation(IntegrationStage.class) != null;
}
}
class InvaildIntegratedPluginClass extends IllegalArgumentException {}
class InvaildIntegratedPluginClass extends IllegalArgumentException {
public InvaildIntegratedPluginClass() {
super();
}
public InvaildIntegratedPluginClass(String s) {
super(s);
}
}