Fixed QUICKSHOP-B in sentry

Former-commit-id: 96d252b8597c56e5a737212a24595b5c136503cf [formerly a8e416f23f38c8db562a4e0576bf3f14166b0d1b]
Former-commit-id: f8b459724e015cf352c79acec96e26c29207509d
This commit is contained in:
Ghost_chu committed 2019-06-04 09:14:42 +08:00
1 parent 77338ff670
commit aac5685a09
1 file changed
+3 -6
@@ -257,7 +257,9 @@ public class ContainerShop implements Shop {
container = (InventoryHolder) this.loc.getBlock().getState();
return container.getInventory();
} catch (Exception e) {
throw new IllegalStateException("Inventory doesn't exist anymore: " + this);
this.onUnload();
this.delete();
throw new IllegalStateException("Inventory doesn't exist anymore: " + this + " shop was removed.");
}
}
@@ -522,11 +524,6 @@ public class ContainerShop implements Shop {
public void setSignText() {
if (Util.isLoaded(this.getLocation()) == false)
return;
if (!Util.canBeShop(this.getLocation().getBlock())) {
this.onUnload();
this.delete();
Util.debugLog("We are removed a shop cause it nolonger had InventoryHolder.");
}
String[] lines = new String[4];
lines[0] = MsgUtil.getMessage("signs.header", this.ownerName());
if (this.isSelling()) {