forked from SteamWar/SteamWar
Hotfix SmartPlaceListener
This commit is contained in:
+8
-10
@@ -57,21 +57,19 @@ public class SmartPlaceListener implements Listener {
|
||||
static {
|
||||
World world = Bukkit.getWorlds().get(0);
|
||||
Block block = world.getBlockAt(0, 0, 0);
|
||||
block.setType(Material.AIR);
|
||||
BlockState state = block.getState();
|
||||
for (Material material : Material.values()) {
|
||||
if (material.isLegacy()) continue;
|
||||
if (!material.isInteractable() && !material.isBlock()) continue;
|
||||
try {
|
||||
BlockData blockData = material.createBlockData();
|
||||
block.setBlockData(blockData);
|
||||
if (block.getState() instanceof TileState) {
|
||||
CONTAINERS.add(material);
|
||||
} else if (blockData instanceof Stairs) {
|
||||
CONTAINERS.add(material);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
BlockData blockData = material.createBlockData();
|
||||
block.setBlockData(blockData);
|
||||
if (block.getState() instanceof TileState) {
|
||||
CONTAINERS.add(material);
|
||||
} else if (blockData instanceof Stairs) {
|
||||
CONTAINERS.add(material);
|
||||
}
|
||||
state.update(true, false);
|
||||
}
|
||||
CONTAINERS.add(Material.GRINDSTONE);
|
||||
CONTAINERS.remove(Material.COMPARATOR);
|
||||
|
||||
Reference in New Issue
Block a user