89 lines
3.2 KiB
Java
89 lines
3.2 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;
|
|
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("did", " ", " ");
|
|
recipe.setIngredient('d', Material.DIAMOND);
|
|
recipe.setIngredient('i', Material.IRON_INGOT);
|
|
Bukkit.addRecipe(recipe);
|
|
|
|
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
|
|
key = new NamespacedKey(this, "headRecipe1");
|
|
recipe = new ShapedRecipe(key, item);
|
|
recipe.shape("WWW", "WsW", "WWW");
|
|
recipe.setIngredient('W', Material.STICK);
|
|
recipe.setIngredient('s', Material.NETHERITE_SCRAP);
|
|
Bukkit.addRecipe(recipe);
|
|
|
|
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
|
|
key = new NamespacedKey(this, "headRecipe2");
|
|
recipe = new ShapedRecipe(key, item);
|
|
recipe.shape("RR ", " ", " ");
|
|
recipe.setIngredient('R', Material.REDSTONE_BLOCK);
|
|
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() {
|
|
}
|
|
}
|