mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-26 02:19:48 -05:00
Fix #267
Fix #267 Former-commit-id: 789e2edc8c3ce015ec1cccade6a0738648e531f0
This commit is contained in:
1 parent
6febb5c1cb
commit
a95b32ea84
1 file changed
+12
-4
@@ -159,9 +159,9 @@ public class ShopProtectionListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
final HashMap<Location, Shop> shopsInChunk = plugin.getShopManager().getShops(loc.getChunk());
|
||||
final Shop shop = plugin.getShopManager().getShopIncludeAttached(loc)
|
||||
|
||||
if (shopsInChunk == null || shopsInChunk.isEmpty() || shopsInChunk.get(loc) == null) {
|
||||
if (shop == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,9 +172,17 @@ public class ShopProtectionListener implements Listener {
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final InventoryHolder holder = event.getInitiator().getHolder();
|
||||
|
||||
if(holder instanceof Entity){
|
||||
holder.remove();
|
||||
}else if(holder instanceof Block){
|
||||
location.getBlock().breakNaturally();
|
||||
}
|
||||
|
||||
location.getBlock().breakNaturally();
|
||||
MsgUtil.sendGlobalAlert("[DisplayGuard] Breaked the block at " + location + " try steal the items for shop " + loc);
|
||||
|
||||
MsgUtil.sendGlobalAlert("[DisplayGuard] Defened a item steal action at" + location);
|
||||
}
|
||||
|
||||
//Protect Entity pickup shop
|
||||
|
||||
Reference in new issue
Block a user