Files
src
build.gradle
settings.gradle
Code
7 294
src/main/java/com/kodari/thegodsmasher/GodSmasherPlugin.java
package com.kodari.thegodsmasher;
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 final class GodSmasherPlugin extends JavaPlugin {
private GodSmasherItemFactory itemFactory;
private WindBoostManager windBoostManager;
@Override
public void onEnable() {
NamespacedKey itemKey = new NamespacedKey(this, "god_smasher");
this.itemFactory = new GodSmasherItemFactory(itemKey);
NamespacedKey recipeKey = new NamespacedKey(this, "god_smasher_recipe");
ShapedRecipe recipe = new ShapedRecipe(recipeKey, this.itemFactory.create());
recipe.shape("NSN", "MSW", "NUT");
recipe.setIngredient('N', Material.NETHERITE_INGOT);
recipe.setIngredient('S', Material.NETHERITE_SPEAR);
recipe.setIngredient('M', Material.MACE);
recipe.setIngredient('W', Material.NETHERITE_SWORD);
recipe.setIngredient('T', Material.NETHER_STAR);
recipe.setIngredient('U', Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
Bukkit.addRecipe(recipe);
this.windBoostManager = new WindBoostManager(this, this.itemFactory);
Bukkit.getPluginManager().registerEvents(this.windBoostManager, this);
getCommand("creategodsmasher").setExecutor(new GodSmasherCommand(this.itemFactory));
}
@Override
public void onDisable() {
if (this.windBoostManager != null) {
this.windBoostManager.shutdown();
}
}
}