mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-23 10:35:22 +01:00
Fix NPEs
This commit is contained in:
parent
ec09a56a02
commit
c983e68392
@ -111,8 +111,9 @@ public class UltimateStacker extends SongodaPlugin {
|
||||
|
||||
@Override
|
||||
public void onPluginDisable() {
|
||||
if (this.stackingTask != null) {
|
||||
this.stackingTask.stop();
|
||||
this.stackingTask = null;
|
||||
}
|
||||
this.dataManager.saveBatchSync(this.spawnerStackManager.getStacksData());
|
||||
this.dataManager.saveBatchSync(this.blockStackManager.getStacksData());
|
||||
this.dataManager.shutdownNow();
|
||||
@ -355,11 +356,14 @@ public class UltimateStacker extends SongodaPlugin {
|
||||
|
||||
public void updateHologram(Hologramable stack) {
|
||||
// Is this stack invalid?
|
||||
if (!stack.isValid())
|
||||
if (stack instanceof BlockStackImpl)
|
||||
if (!stack.isValid()) {
|
||||
if (stack instanceof BlockStackImpl) {
|
||||
blockStackManager.removeBlock(stack.getLocation());
|
||||
else if (stack instanceof SpawnerStackImpl)
|
||||
} else if (stack instanceof SpawnerStackImpl) {
|
||||
spawnerStackManager.removeSpawner(stack.getLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
// are holograms enabled?
|
||||
if (!stack.areHologramsEnabled() && !HologramManager.getManager().isEnabled()) return;
|
||||
// update the hologram
|
||||
|
Loading…
Reference in New Issue
Block a user