mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
Don't keep display, it may cause performance issue
Former-commit-id: 2dc3c7bcfea92381b547fa7448e35855fedeef64
This commit is contained in:
1 parent
4b957c6fcf
commit
58bf438108
1 file changed
+17
@@ -78,6 +78,9 @@ public class DisplayProtectionListener implements Listener {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
if(shop.getDisplay() != null){
|
||||
shop.getDisplay().remove();
|
||||
}
|
||||
sendAlert("[DisplayGuard] Liuqid " + targetBlock.getLocation() + " trying flow to top of shop, QuickShop already cancel it.");
|
||||
}
|
||||
|
||||
@@ -110,6 +113,9 @@ public class DisplayProtectionListener implements Listener {
|
||||
if (shop != null) {
|
||||
event.setCancelled(true);
|
||||
sendAlert("[DisplayGuard] Piston " + event.getBlock().getLocation() + " trying push somethings on the shop top, QuickShop already cancel it.");
|
||||
if(shop.getDisplay() != null){
|
||||
shop.getDisplay().remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (Block oBlock : event.getBlocks()) {
|
||||
@@ -119,6 +125,9 @@ public class DisplayProtectionListener implements Listener {
|
||||
if (shop != null) {
|
||||
event.setCancelled(true);
|
||||
sendAlert("[DisplayGuard] Piston " + event.getBlock().getLocation() + " trying push somethings on the shop top, QuickShop already cancel it.");
|
||||
if(shop.getDisplay() != null){
|
||||
shop.getDisplay().remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -138,6 +147,9 @@ public class DisplayProtectionListener implements Listener {
|
||||
if (shop != null) {
|
||||
event.setCancelled(true);
|
||||
sendAlert("[DisplayGuard] Piston " + event.getBlock().getLocation() + " trying pull somethings on the shop top, QuickShop already cancel it.");
|
||||
if(shop.getDisplay() != null){
|
||||
shop.getDisplay().remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (Block oBlock : event.getBlocks()) {
|
||||
@@ -147,6 +159,9 @@ public class DisplayProtectionListener implements Listener {
|
||||
if (shop != null) {
|
||||
event.setCancelled(true);
|
||||
sendAlert("[DisplayGuard] Piston " + event.getBlock().getLocation() + " trying push somethings on the shop top, QuickShop already cancel it.");
|
||||
if(shop.getDisplay() != null){
|
||||
shop.getDisplay().remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -186,6 +201,7 @@ public class DisplayProtectionListener implements Listener {
|
||||
sendAlert("[DisplayGuard] Block " + event.getBlock().getLocation()
|
||||
+ " trying burn with DisplayItem.");
|
||||
Util.inventoryCheck(furnace1.getInventory());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -534,6 +550,7 @@ public class DisplayProtectionListener implements Listener {
|
||||
.getName() + " trying hook item use Fishing Rod, QuickShop already removed it.");
|
||||
Util.inventoryCheck(event.getPlayer().getInventory());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||
|
||||
Reference in new issue
Block a user