Longer search radius for dupe display

Former-commit-id: 071a1ea542622692ee588713f322ac9a3f147579
This commit is contained in:
Sotr committed 2020-01-24 01:36:57 +07:00
1 parent 843252a3b5
commit f0bb0bd70b
5 files changed
+11 -8

No files matched your search

@@ -623,8 +623,7 @@ public class QuickShop extends JavaPlugin {
// shopVaildWatcher.runTaskTimer(this, 0, 20 * 60); // Nobody use it
signUpdateWatcher.runTaskTimer(this, 0, 10);
shopContainerWatcher.runTaskTimer(this, 0, 5); // Nobody use it
// displayDupeRemoverWatcher.runTaskTimerAsynchronously(this,0,1); // This one definitely cannot
// run under async
displayDupeRemoverWatcher.runTaskTimerAsynchronously(this,0,1);
if (logWatcher != null) {
logWatcher.runTaskTimerAsynchronously(this, 10, 10);
getLogger().info("Log actions is enabled, actions will log in the qs.log file!");
@@ -127,8 +127,8 @@ public class ArmorStandDisplayItem implements DisplayItem {
return false;
}
boolean removed = false;
for (Entity entity : armorStand.getNearbyEntities(1, 1, 1)) {
if (!(entity instanceof ArmorStand)) {
for (Entity entity : armorStand.getNearbyEntities(1.5, 1.5, 1.5)) {
if (entity.getType() != EntityType.ARMOR_STAND) {
continue;
}
ArmorStand eArmorStand = (ArmorStand) entity;
@@ -25,6 +25,7 @@ import lombok.ToString;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Item;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.ItemStack;
@@ -151,8 +152,8 @@ public class RealDisplayItem implements DisplayItem {
boolean removed = false;
// Chunk chunk = shop.getLocation().getChunk();
for (Entity entity : item.getNearbyEntities(1, 1, 1)) {
if (!(entity instanceof Item)) {
for (Entity entity : item.getNearbyEntities(1.5, 1.5, 1.5)) {
if (entity.getType() != EntityType.DROPPED_ITEM) {
continue;
}
Item eItem = (Item) entity;
@@ -209,7 +209,6 @@ class ItemMetaMatcher {
if (!this.displayname) {
return true;
}
Util.debugLog("Checking displayname");
if (!meta1.hasDisplayName()) {
return true;
} else {
@@ -25,7 +25,11 @@ import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.Shop.DisplayItem;
// unused, pending to remove
/**
* Deprecated for unused and inproper implementation,
* this is likely to be removed in a future version.
*/
@Deprecated
public class DisplayDupeRemoverWatcher extends BukkitRunnable {
private Queue<DisplayItem> checkQueue = new LinkedList<>();