Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.check_plys.craftingthings;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.ShapedRecipe;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin{
- public final Logger logger = Logger.getLogger("Minecraft");
- public static Main plugin;
- @Override
- public void onDisable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Has Been Disabled!");
- this.logger.warning(pdfFile.getName() + " If you are disabling the plugin without disable all server some errors may appear in console in future versions");
- }
- @Override
- public void onEnable() {
- horsearmouriron();
- saddlerecipe();
- disk11();
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + "Version" + pdfFile.getVersion() + " Has Been Enabled!");
- getConfig().options().copyDefaults(true);
- saveConfig();
- }
- //reloadconfig
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
- final Player p = (Player)sender;
- if (cmd.getName().equalsIgnoreCase("ct")){
- if (args[0].equals("help"))
- if (p.hasPermission("craftingthings.help") || p.isOp() || p.hasPermission("*"))
- p.sendMessage(getConfig().getString("Tag").replace("&", "§") + getConfig().getString("HelpMessage").replace("&", "§"));
- else
- p.sendMessage(getConfig().getString("Tag").replace("&", "§") + getConfig().getString("NoPermissionMessage").replace("&", "§"));
- }
- return true;
- }
- //saddle
- private void saddlerecipe() {
- if (getConfig().getBoolean("CraftSaddle")) {
- ItemStack saddle = new ItemStack(Material.SADDLE, 1);
- ItemMeta meta = saddle.getItemMeta();
- saddle.setItemMeta(meta);
- ShapedRecipe saddlecraft = new ShapedRecipe(saddle);
- saddlecraft.shape(
- "@@@",
- "# #",
- "£ £" );
- saddlecraft.setIngredient('@', Material.LEATHER);
- saddlecraft.setIngredient('#', Material.STRING);
- saddlecraft.setIngredient('£', Material.IRON_INGOT);
- Bukkit.getServer().addRecipe(saddlecraft);
- }
- }
- //disk11
- private void disk11() {
- if (getConfig().getBoolean("CraftDisk11")) {
- ItemStack disk11 = new ItemStack(Material.RECORD_11);
- ItemMeta meta = disk11.getItemMeta();
- disk11.setItemMeta(meta);
- ShapedRecipe disk11craft = new ShapedRecipe(disk11);
- disk11craft.shape(
- "£#£",
- "#$#",
- "£#£" );
- disk11craft.setIngredient('£', Material.SOUL_SAND);
- disk11craft.setIngredient('#', Material.OBSIDIAN);
- disk11craft.setIngredient('$', Material.REDSTONE_BLOCK);
- Bukkit.getServer().addRecipe(disk11craft);
- }
- }
- //horse armour iron
- private void horsearmouriron() {
- if (getConfig().getBoolean("CraftIronHorseArmour")) {
- ItemStack horsearmouriron = new ItemStack(Material.IRON_BARDING);
- ItemMeta meta = horsearmouriron.getItemMeta();
- horsearmouriron.setItemMeta(meta);
- ShapedRecipe horsearmourironcraft = new ShapedRecipe(horsearmouriron);
- horsearmourironcraft.shape(
- " #",
- "#$#",
- "###");
- horsearmourironcraft.setIngredient('#', Material.IRON_INGOT);
- horsearmourironcraft.setIngredient('$', Material.WOOL);
- Bukkit.getServer().addRecipe(horsearmourironcraft);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement