Search in sources :

Example 21 with BlockData

use of com.elmakers.mine.bukkit.api.block.BlockData in project MagicPlugin by elBukkit.

the class BlockList method load.

@Override
public void load(ConfigurationSection node) {
    worldName = node.getString("world");
    List<String> blockData = node.getStringList("blocks");
    if (blockData != null) {
        for (String blockString : blockData) {
            BlockData deserialized = com.elmakers.mine.bukkit.block.BlockData.fromString(blockString);
            if (worldName == null)
                worldName = deserialized.getWorldName();
            add(deserialized);
        }
    }
}
Also used : BlockData(com.elmakers.mine.bukkit.api.block.BlockData)

Example 22 with BlockData

use of com.elmakers.mine.bukkit.api.block.BlockData in project MagicPlugin by elBukkit.

the class BlockList method setBlockList.

public void setBlockList(Collection<BlockData> blockList) {
    this.blockList = null;
    if (blockList != null) {
        this.blockList = new ArrayDeque<>(blockList);
        blockIdMap = new HashSet<>();
        for (BlockData block : blockList) {
            blockIdMap.add(block.getId());
        }
    }
}
Also used : BlockData(com.elmakers.mine.bukkit.api.block.BlockData)

Aggregations

BlockData (com.elmakers.mine.bukkit.api.block.BlockData)22 Block (org.bukkit.block.Block)6 ArrayList (java.util.ArrayList)2 Nullable (javax.annotation.Nullable)2 Location (org.bukkit.Location)2 FallingBlock (org.bukkit.entity.FallingBlock)2 ItemStack (org.bukkit.inventory.ItemStack)2 CastContext (com.elmakers.mine.bukkit.api.action.CastContext)1 Batch (com.elmakers.mine.bukkit.api.batch.Batch)1 BlockList (com.elmakers.mine.bukkit.api.block.BlockList)1 MaterialBrush (com.elmakers.mine.bukkit.api.block.MaterialBrush)1 UndoList (com.elmakers.mine.bukkit.api.block.UndoList)1 UndoQueue (com.elmakers.mine.bukkit.api.block.UndoQueue)1 Mage (com.elmakers.mine.bukkit.api.magic.Mage)1 MageController (com.elmakers.mine.bukkit.api.magic.MageController)1 MagicAPI (com.elmakers.mine.bukkit.api.magic.MagicAPI)1 MaterialSet (com.elmakers.mine.bukkit.api.magic.MaterialSet)1 LostWand (com.elmakers.mine.bukkit.api.wand.LostWand)1 UndoList (com.elmakers.mine.bukkit.block.UndoList)1 MagicController (com.elmakers.mine.bukkit.magic.MagicController)1