mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
Check before load/unload
Former-commit-id: 774c929b5deb80a3e487ef8bd625c0de53d8f3b0 [formerly bf106ec8fedeeecbcb789db31a43abda59bd2e4f] Former-commit-id: 57ba1a0e8c3f1d168292dbbe6f5ede45ad410726
This commit is contained in:
1 parent
123782214e
commit
239af3a618
1 file changed
+10
-1
@@ -635,7 +635,8 @@ public class ContainerShop implements Shop {
|
||||
*/
|
||||
public void delete(boolean fromMemory) {
|
||||
// Unload the shop
|
||||
this.onUnload();
|
||||
if (isLoaded)
|
||||
this.onUnload();
|
||||
// Delete the display item
|
||||
if (this.getDisplayItem() != null) {
|
||||
this.getDisplayItem().remove();
|
||||
@@ -740,6 +741,10 @@ public class ContainerShop implements Shop {
|
||||
* Unload ContainerShop.
|
||||
*/
|
||||
public void onUnload() {
|
||||
if (!this.isLoaded) {
|
||||
Util.debugLog("Dupe unload request, cancelled.");
|
||||
return;
|
||||
}
|
||||
if (this.getDisplayItem() != null) {
|
||||
this.getDisplayItem().remove();
|
||||
this.displayItem = null;
|
||||
@@ -751,6 +756,10 @@ public class ContainerShop implements Shop {
|
||||
* Load ContainerShop.
|
||||
*/
|
||||
public void onLoad() {
|
||||
if (this.isLoaded) {
|
||||
Util.debugLog("Dupe load request, cancelled.");
|
||||
return;
|
||||
}
|
||||
checkDisplay();
|
||||
|
||||
//Clear the chest?
|
||||
|
||||
Reference in new issue
Block a user