null check in tempblock revert_queue, rare occasion when server stops before any tempblocks are made

This commit is contained in:
PhanaticD 2019-01-12 22:12:17 -05:00
parent 3094c691a9
commit abfbff19fa

View file

@ -1,10 +1,7 @@
package com.projectkorra.projectkorra.util;
import java.util.Comparator;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -14,8 +11,10 @@ import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled;
import org.bukkit.scheduler.BukkitRunnable;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import java.util.Comparator;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.ConcurrentHashMap;
public class TempBlock {
@ -88,10 +87,12 @@ public class TempBlock {
for (final Block block : instances.keySet()) {
revertBlock(block, Material.AIR);
}
if (REVERT_QUEUE != null) {
for (final TempBlock tempblock : REVERT_QUEUE) {
tempblock.revertBlock();
}
}
}
public static void removeBlock(final Block block) {
instances.remove(block);