Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Added more config options
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Mar 14, 2017
1 parent 7c967cd commit 48e709d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public static void msgEnable() {
private static void loadMessages() {
getMessages().options().header("HeadsPlus by Thatsmusic99");
getMessages().addDefault("prefix", "&1[&6HeadsPlus&1]");
getMessages().addDefault("reloadingMessage", "&3Reloading config...");
getMessages().addDefault("reloadMessage", "&3Config has reloaded!");
getMessages().addDefault("head-interact-message", "&3That is &b%p&3''s head!");
getMessages().addDefault("head-mhf-interact-message", "&3That is a &b%p''s head!");
getMessages().options().copyDefaults(true);
saveMessages();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
if ((args.length == 1) && (args[0].equalsIgnoreCase("reload"))) {
if (sender.hasPermission("headsplus.maincommand.reload")) {
String reloadM = ChatColor.translateAlternateColorCodes('&', HeadsPlusConfig.getMessages().getString("reloadMessage"));
String reloadingM = ChatColor.translateAlternateColorCodes('&', HeadsPlusConfig.getMessages().getString("reloadingMessage"));
prefix = HeadsPlus.getInstance().translateMessages(prefix);
reloadM = HeadsPlus.getInstance().translateMessages(reloadM);
sender.sendMessage(prefix + " " + ChatColor.DARK_AQUA + "Reloading config...");
reloadingM = HeadsPlus.getInstance().translateMessages(reloadingM);
sender.sendMessage(prefix + " " + reloadingM);
try {

if (!(configF.exists())) {
Expand All @@ -70,7 +73,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
messages = YamlConfiguration.loadConfiguration(messagesF);
} else {
HeadsPlusConfig.reloadMessages();
sender.sendMessage((prefix.replaceAll("'", "" ) + " " + (reloadM.replaceAll("'", ""))));
sender.sendMessage(prefix + " " + reloadM);
}

} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,34 @@ public static void addRecipes() {
.addIngredient(Material.SKULL_ITEM, 0);

HeadsPlus.getInstance().getServer().addRecipe(zombieRecipe);

ItemStack bHead = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
SkullMeta bMeta = (SkullMeta) bHead.getItemMeta();
bMeta.setOwner("MHF_Blaze");
bMeta.setDisplayName("Blaze Head");
bMeta.addEnchant(Enchantment.LUCK, 1, true);
bMeta.addEnchant(Enchantment.DURABILITY, 1, true);
bMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
bHead.setItemMeta(bMeta);

ShapelessRecipe blazeRecipe = new ShapelessRecipe(bHead)
.addIngredient(Material.BLAZE_POWDER)
.addIngredient(Material.SKULL_ITEM, 0);

HeadsPlus.getInstance().getServer().addRecipe(blazeRecipe);

ItemStack csHead = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
SkullMeta csMeta = (SkullMeta) csHead.getItemMeta();
csMeta.setOwner("MHF_CaveSpider");
csMeta.setDisplayName("Cave Spider");
csMeta.addEnchant(Enchantment.DURABILITY, 1, true);
csMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
csHead.setItemMeta(csMeta);

ShapelessRecipe cavespiderRecipe = new ShapelessRecipe(csHead)
.addIngredient(Material.FERMENTED_SPIDER_EYE)
.addIngredient(Material.SKULL_ITEM, 0);

HeadsPlus.getInstance().getServer().addRecipe(cavespiderRecipe);
}


Expand Down

0 comments on commit 48e709d

Please sign in to comment.