Package us.deathmarine.diablodrops.builders

Source Code of us.deathmarine.diablodrops.builders.SocketBuilder

package us.deathmarine.diablodrops.builders;

import java.util.List;

import org.bukkit.Material;
import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.ItemStack;

import us.deathmarine.diablodrops.DiabloDrops;

public class SocketBuilder {
  DiabloDrops plugin;

  public SocketBuilder(DiabloDrops plugin) {
    this.plugin = plugin;
  }

  /**
   * Clears and then populates plugin's socket list; also adds identification
   * tome
   */
  public void build() {
    List<String> l = plugin.getConfig().getStringList("SocketItem.Items");
    for (String name : l) {
      for (Material mat : plugin.getItemAPI().allItems()) {
        FurnaceRecipe recipe = new FurnaceRecipe(new ItemStack(mat),
            Material.valueOf(name.toUpperCase()));
        recipe.setInput(mat);
        plugin.getServer().addRecipe(recipe);

      }
    }
  }
}
TOP

Related Classes of us.deathmarine.diablodrops.builders.SocketBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.