mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 02:12:25 +00:00
Fixed armor stands not being removed after shop removal
This commit is contained in:
parent
ca064da094
commit
c5611027a7
@ -188,7 +188,7 @@ public class ShopChest extends JavaPlugin {
|
||||
|
||||
if (database != null) {
|
||||
for (Shop shop : shopUtils.getShops()) {
|
||||
shopUtils.removeShop(shop, false, true);
|
||||
shopUtils.removeShop(shop, false);
|
||||
debug("Removed shop (#" + shop.getID() + ")");
|
||||
}
|
||||
|
||||
|
@ -287,6 +287,10 @@ public class Hologram {
|
||||
armorStand.remove();
|
||||
}
|
||||
|
||||
if (interactArmorStand != null) {
|
||||
interactArmorStand.remove();
|
||||
}
|
||||
|
||||
exists = false;
|
||||
holograms.remove(this);
|
||||
}
|
||||
|
@ -92,25 +92,13 @@ public class Shop {
|
||||
/**
|
||||
* Removes the hologram of the shop
|
||||
*/
|
||||
public void removeHologram(boolean useCurrentThread) {
|
||||
public void removeHologram() {
|
||||
if (hologram != null && hologram.exists()) {
|
||||
plugin.debug("Removing hologram (#" + id + ")");
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
hologram.hidePlayer(p, useCurrentThread);
|
||||
}
|
||||
|
||||
hologram.remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the hologram of the shop
|
||||
*/
|
||||
public void removeHologram() {
|
||||
removeHologram(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the floating item of the shop
|
||||
*/
|
||||
|
@ -90,9 +90,8 @@ public class ShopUtils {
|
||||
* Remove a shop
|
||||
* @param shop Shop to remove
|
||||
* @param removeFromDatabase Whether the shop should also be removed from the database
|
||||
* @param useCurrentThread Whether the current thread should be used instead of a new async task
|
||||
*/
|
||||
public void removeShop(Shop shop, boolean removeFromDatabase, boolean useCurrentThread) {
|
||||
public void removeShop(Shop shop, boolean removeFromDatabase) {
|
||||
plugin.debug("Removing shop (#" + shop.getID() + ")");
|
||||
|
||||
InventoryHolder ih = shop.getInventoryHolder();
|
||||
@ -109,21 +108,12 @@ public class ShopUtils {
|
||||
}
|
||||
|
||||
shop.removeItem();
|
||||
shop.removeHologram(useCurrentThread);
|
||||
shop.removeHologram();
|
||||
|
||||
if (removeFromDatabase)
|
||||
plugin.getShopDatabase().removeShop(shop, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a shop
|
||||
* @param shop Shop to remove
|
||||
* @param removeFromDatabase Whether the shop should also be removed from the database
|
||||
*/
|
||||
public void removeShop(Shop shop, boolean removeFromDatabase) {
|
||||
removeShop(shop, removeFromDatabase, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the shop limits of a player
|
||||
* @param p Player, whose shop limits should be returned
|
||||
|
Loading…
Reference in New Issue
Block a user