lifesteal/src/ca/thetechrobo/smp/LifestealPlugin.java

54 lines
1.8 KiB
Java

package ca.thetechrobo.smp;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;
public class LifestealPlugin extends JavaPlugin {
public void addRecipes() {
LifeExtractor lifextractor = new LifeExtractor();
lifextractor.create();
ItemStack item = lifextractor.item;
NamespacedKey key = new NamespacedKey(this, "lifextractor");
ShapedRecipe recipe = new ShapedRecipe(key, item); // error
recipe.shape("BS ", " S ", " S ");
recipe.setIngredient('B', Material.BUCKET);
recipe.setIngredient('S', Material.STICK);
Bukkit.addRecipe(recipe);
Life life = new Life();
life.create();
//life.changeTo3(); // removed for balancing
item = life.item;
key = new NamespacedKey(this, "life");
recipe = new ShapedRecipe(key, item);
recipe.shape("sA ", " ", " ");
recipe.setIngredient('A', Material.ANVIL);
recipe.setIngredient('s', Material.NETHERITE_INGOT);
Bukkit.addRecipe(recipe);
ItemStack bedrock = new ItemStack(Material.BEDROCK);
key = new NamespacedKey(this, "bedrock");
recipe = new ShapedRecipe(key, bedrock);
recipe.shape("NN ", "NN ", " ");
recipe.setIngredient('N', Material.NETHERITE_BLOCK);
Bukkit.addRecipe(recipe);
}
@Override
public void onEnable() {
DeathListener dl = new DeathListener();
dl.initialise(this);
getServer().getPluginManager().registerEvents(dl, this);
DeleteMyData dlmydata = new DeleteMyData();
dlmydata.initialise(dl.scores);
this.getCommand("deletemydata").setExecutor(dlmydata);
addRecipes();
}
@Override
public void onDisable() {
}
}