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

83 lines
3.0 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 {
private DeathListener dl;
@SuppressWarnings("deprecation")
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();
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);
HeartExtratrator heartdeheart = new HeartExtratrator();
heartdeheart.create();
item = heartdeheart.item;
key = new NamespacedKey(this, "MasqueDeMasque");
recipe = new ShapedRecipe(key, item);
recipe.shape("BS ", "BS ", " S ");
recipe.setIngredient('B', Material.BUCKET);
recipe.setIngredient('S', Material.STICK);
Bukkit.addRecipe(recipe);
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
key = new NamespacedKey(this, "headRecipe0");
recipe = new ShapedRecipe(key, item);
recipe.shape("sis", " ", " ");
recipe.setIngredient('s', Material.NETHERITE_SCRAP);
recipe.setIngredient('i', Material.IRON_INGOT);
Bukkit.addRecipe(recipe);
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
key = new NamespacedKey(this, "headRecipe2");
recipe = new ShapedRecipe(key, item);
recipe.shape("RRR", "RDR", "RRR");
recipe.setIngredient('R', Material.REDSTONE_BLOCK);
recipe.setIngredient('D', Material.NETHERITE_SCRAP);
Bukkit.addRecipe(recipe);
}
@Override
public void onEnable() {
DeathListener dl = new DeathListener();
this.dl = dl;
this.dl.initialise(this);
getServer().getPluginManager().registerEvents(this.dl, this);
DeleteMyData dlmydata = new DeleteMyData();
dlmydata.initialise(this.dl.scores);
this.getCommand("deletemydata").setExecutor(dlmydata);
this.getCommand("setHearts").setExecutor(new ExploitAbuse101ByLunarRam());
addRecipes();
}
@Override
public void onDisable() {
}
}