Revert about isLoaded changes

Former-commit-id: cae89af61bcf4815fe6eb1c035bcedb8c64df483 [formerly 4211c2090ca10d9c50bc81d29fe952c9c2e075a1]
Former-commit-id: 9ee77e7f5c1f434814a34782851957ba9c54353d
This commit is contained in:
Ghost_chu committed 2019-05-31 19:46:49 +08:00
1 parent c000b25f69
commit cf4f86fcad
3 files changed
+5 -18

No files matched your search

@@ -36,7 +36,6 @@ public class ContainerShop implements Shop {
private boolean unlimited;
private ShopType shopType;
private QuickShop plugin;
private boolean isLoaded = false;
/**
* Returns a clone of this shop. References to the same display item,
@@ -516,8 +515,6 @@ public class ContainerShop implements Shop {
* Updates signs attached to the shop
*/
public void setSignText() {
if (this.isLoaded == false)
return;
if (Util.isLoaded(this.getLocation()) == false)
return;
String[] lines = new String[4];
@@ -675,8 +672,6 @@ public class ContainerShop implements Shop {
}
public void checkDisplay() {
if (this.isLoaded == false)
return;
if (plugin.isDisplay() == false)
return;
if (getLocation().getWorld() == null)
@@ -715,8 +710,6 @@ public class ContainerShop implements Shop {
public boolean checkDisplayMoved() {
// don't check if the plugin doesn't know about the object
if (this.isLoaded == false)
return false;
if (this.getDisplayItem() == null) {
return false;
@@ -744,11 +737,6 @@ public class ContainerShop implements Shop {
this.getDisplayItem().remove();
this.displayItem = null;
}
this.isLoaded = false;
}
public boolean isLoaded() {
return this.isLoaded;
}
public void onLoad() {
@@ -759,9 +747,9 @@ public class ContainerShop implements Shop {
//this.setSignText();
if (!Util.canBeShop(this.getLocation().getBlock())) {
if (this.isLoaded)
this.onUnload();
this.delete();
this.onUnload();
plugin.getQueuedShopManager()
.add(new QueueShopObject(this, QueueAction.DELETE)); //Use queue make sure not will happend NPE.
return;
}
@@ -776,7 +764,6 @@ public class ContainerShop implements Shop {
this.update();
}
}
this.isLoaded = true;
}
public void onClick() {
@@ -93,6 +93,5 @@ public abstract interface Shop {
public abstract ArrayList<UUID> getStaffs();
public abstract boolean isLoaded();
}
@@ -631,7 +631,8 @@ public class MsgUtil {
chatSheetPrinter.printLine(MsgUtil.getMessage("menu.owner", shop.ownerName()));
//Enabled
Util.sendItemholochat(shop, shop.getItem(), p, ChatColor.DARK_PURPLE + MsgUtil
.getMessage("tableformat.left_begin") + MsgUtil.getMessage("menu.item", MsgUtil.getDisplayName(shop.getItem())));
.getMessage("tableformat.left_begin") + " " + MsgUtil
.getMessage("menu.item", MsgUtil.getDisplayName(shop.getItem())));
if (Util.isTool(items.getType())) {
chatSheetPrinter.printLine(MsgUtil.getMessage("menu.damage-percent-remaining", Util.getToolPercentage(items)));
}