Added system for version dependent configs.

Started work on actual configs.
Added ItemGroups.
Removed XMaterial.
This commit is contained in:
GB6 2019-03-19 14:13:27 +01:00
parent a05c9941f6
commit 926b572c8c
42 changed files with 794 additions and 1075 deletions

View File

@ -11,6 +11,7 @@ import com.songoda.epicenchants.objects.Enchant;
import com.songoda.epicenchants.utils.EnchantUtils;
import com.songoda.epicenchants.utils.SpecialItems;
import com.songoda.epicenchants.utils.objects.FastInv;
import com.songoda.epicenchants.utils.single.ItemGroup;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
@ -37,6 +38,8 @@ public class EpicEnchants extends JavaPlugin {
private Action action;
private Economy economy;
private EnchantUtils enchantUtils;
private ItemGroup itemGroup;
private int version;
@Override
public void onEnable() {
@ -46,6 +49,7 @@ public class EpicEnchants extends JavaPlugin {
FastInv.init(this);
this.version = Integer.parseInt(Bukkit.getServer().getBukkitVersion().split("\\.")[1]);
this.action = new Action();
this.fileManager = new FileManager(this);
this.groupManager = new GroupManager(this);
@ -56,6 +60,7 @@ public class EpicEnchants extends JavaPlugin {
this.economy = getServer().getServicesManager().getRegistration(Economy.class).getProvider();
this.commandManager = new CommandManager(this);
this.hookManager = new HookManager();
this.itemGroup = new ItemGroup(this);
fileManager.loadFiles();
groupManager.loadGroups();

View File

@ -73,7 +73,7 @@ public class BookListener extends ItemListener {
event.setCancelled(true);
if (event.getPlayer().getInventory().firstEmpty() == -1) {
if (event.getItem().getAmount() != 1 && event.getPlayer().getInventory().firstEmpty() == -1) {
return;
}
@ -81,11 +81,16 @@ public class BookListener extends ItemListener {
Optional<Enchant> enchant = instance.getEnchantManager().getRandomEnchant(group);
if (!enchant.isPresent()) {
instance.getAction().perform(event.getPlayer(), "event.purchase.noenchant");
return;
throw new IllegalStateException("The " + group.getName() + " group does not have any enchants.");
}
useItem(event);
event.getPlayer().getInventory().addItem(enchant.get().getBook().get(enchant.get()));
instance.getAction().perform(event.getPlayer(), "book.discover",
of("group_name", group.getName()),
of("group_color", group.getColor()),
of("enchant_format", enchant.get().getFormat())
);
}
}

View File

@ -52,7 +52,7 @@ public class DustListener extends ItemListener {
event.setCancelled(true);
if (event.getPlayer().getInventory().firstEmpty() == -1) {
if (event.getItem().getAmount() != 1 && event.getPlayer().getInventory().firstEmpty() == -1) {
return;
}

View File

@ -39,7 +39,7 @@ public class CommandManager extends BukkitCommandManager {
instance.getGroupManager().getValues().stream().map(Group::getIdentifier).collect(Collectors.toList()));
getCommandCompletions().registerCompletion("dustTypes", c ->
instance.getFileManager().getConfiguration("items/dusts.yml").getConfigurationSection("dusts").getKeys(false));
instance.getFileManager().getConfiguration("items/dusts").getConfigurationSection("dusts").getKeys(false));
// CONTEXTS

View File

@ -18,7 +18,9 @@ import static org.apache.commons.lang3.tuple.Pair.of;
public class FileManager extends Manager<String, FileConfiguration> {
private final LinkedHashSet<Pair<String, Boolean>> files = new LinkedHashSet<>(asList(of("menus/main-info-menu.yml", true),
private final String directory;
private final LinkedHashSet<Pair<String, Boolean>> files = new LinkedHashSet<>(asList(
of("menus/main-info-menu.yml", true),
of("menus/enchanter-menu.yml", true),
of("menus/tinkerer-menu.yml", true),
of("menus/groups/simple-menu.yml", false),
@ -36,6 +38,10 @@ public class FileManager extends Manager<String, FileConfiguration> {
public FileManager(EpicEnchants instance) {
super(instance);
directory = instance.getVersion() > 12 ? "master-config" : "legacy-config";
Bukkit.getConsoleSender().sendMessage("Using the " + directory + " because version is 1." + instance.getVersion());
}
public void loadFiles() {
@ -49,7 +55,7 @@ public class FileManager extends Manager<String, FileConfiguration> {
recentDirs.add(file.getParent());
Bukkit.getConsoleSender().sendMessage("Creating file: " + pair.getLeft());
try {
FileUtils.copyInputStreamToFile(instance.getResource(pair.getLeft()), file);
FileUtils.copyInputStreamToFile(instance.getResource(directory + "/" + pair.getLeft()), file);
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -44,7 +44,11 @@ public class EnchanterMenu extends FastInv {
}
instance.getEconomy().withdrawPlayer(player, ecoCost);
instance.getAction().perform(player, "event.purchase.success", of("group-name", group.getName()), of("group_color", group.getColor()));
instance.getAction().perform(player, "enchanter.success",
of("group_name", group.getName()),
of("group_color", group.getColor()),
of("eco_cost", ecoCost),
of("exp_cost", expCost));
changeExp(player, (int) -expCost);
player.getInventory().addItem(instance.getSpecialItems().getMysteryBook(group));

View File

@ -11,7 +11,7 @@ import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
public class MainInfoMenu extends FastInv {
public MainInfoMenu(EpicEnchants instance, FileConfiguration config) {
super(config.getInt("size"), color(config.getString("title")));
super(config.getInt("rows") * 9, color(config.getString("title")));
config.getConfigurationSection("contents").getKeys(false)
.stream()
.map(s -> "contents." + s)

View File

@ -96,7 +96,7 @@ public class SpecialItems {
ConfigurationSection config = dustConfig.getConfigurationSection("dusts." + (type == null ? "mystery" : type));
if (config.isInt("min-rate") && config.isInt("max-rate")) {
if (config.isInt("min-rate") && config.isInt("max-rate") && percentage == null) {
int minRate = config.getInt("min-rate");
int maxRate = config.getInt("max-rate");
percentage = ThreadLocalRandom.current().nextInt(minRate, maxRate + 1);

View File

@ -3,7 +3,6 @@ package com.songoda.epicenchants.utils.objects;
import com.songoda.epicenchants.objects.Placeholder;
import com.songoda.epicenchants.utils.single.ConfigParser;
import com.songoda.epicenchants.utils.single.GeneralUtils;
import com.songoda.epicenchants.utils.single.XMaterial;
import com.songoda.epicenchants.wrappers.EnchantmentWrapper;
import de.tr7zw.itemnbtapi.NBTItem;
import org.bukkit.Material;
@ -54,7 +53,7 @@ public class ItemBuilder {
}
public ItemBuilder(ConfigurationSection section, Placeholder... placeholders) {
this(XMaterial.requestXMaterial(section.getString("material"), (byte) (section.contains("data") ? section.getInt("data") : 0)).parseItem());
this(Material.valueOf(section.getString("material")), (byte) (section.contains("data") ? section.getInt("data") : 0));
if (section.contains("enchants")) {
section.getStringList("enchants").stream()

View File

@ -13,9 +13,7 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
@ -28,7 +26,7 @@ public class ConfigParser {
.maxLevel(config.getInt("max-level"))
.format(color(config.getString("applied-format")))
.bookItem(parseBookItem(config.getConfigurationSection("book-item")))
.itemWhitelist((config.isList("item-whitelist") ? config.getStringList("item-whitelist").stream().map(Material::valueOf).collect(Collectors.toSet()) : Collections.emptySet()))
.itemWhitelist((config.isList("item-whitelist") ? config.getStringList("item-whitelist").stream().map(instance.getItemGroup()::get).flatMap(Collection::stream).collect(Collectors.toSet()) : Collections.emptySet()))
.conflict(config.isList("conflicting-enchants") ? new HashSet<>(config.getStringList("conflicting-enchants")) : Collections.emptySet())
.condition(Condition.of(config.getString("condition")))
.mobs(config.isConfigurationSection("mobs") ? config.getConfigurationSection("mobs").getKeys(false).stream()
@ -84,7 +82,7 @@ public class ConfigParser {
return section != null ? Group.builder()
.identifier(section.getName())
.name(color(section.getString("group-name")))
.format(section.getString("group-format"))
.format(section.getString("group-lore-format"))
.color(section.getString("group-color"))
.bookItem(parseBookItem(section.getConfigurationSection("book-item")))
.slotsUsed(section.getInt("slots-used"))

View File

@ -0,0 +1,107 @@
package com.songoda.epicenchants.utils.single;
import com.google.common.collect.Multimap;
import com.songoda.epicenchants.EpicEnchants;
import lombok.Getter;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Material;
import java.util.*;
import java.util.stream.Collectors;
import static com.songoda.epicenchants.utils.single.ItemGroup.Group.*;
import static org.bukkit.Material.*;
public class ItemGroup {
private Multimap<Group, Material> groupMap;
public ItemGroup(EpicEnchants instance) {
if (instance.getVersion() > 1.12) setupMaster();
else setupLegacy();
}
private void setupMaster() {
groupMap.putAll(AXES, Arrays.asList(DIAMOND_AXE, GOLDEN_AXE, IRON_AXE, STONE_AXE, WOODEN_AXE));
groupMap.putAll(PICKAXES, Arrays.asList(DIAMOND_PICKAXE, GOLDEN_PICKAXE, IRON_PICKAXE, STONE_PICKAXE, WOODEN_PICKAXE));
groupMap.putAll(SWORDS, Arrays.asList(DIAMOND_SWORD, GOLDEN_SWORD, IRON_SWORD, STONE_SWORD, WOODEN_SWORD));
groupMap.put(BOWS, BOW);
groupMap.putAll(BOOTS, Arrays.asList(DIAMOND_BOOTS, GOLDEN_BOOTS, IRON_BOOTS, LEATHER_BOOTS));
groupMap.putAll(LEGGINGS, Arrays.asList(DIAMOND_LEGGINGS, GOLDEN_LEGGINGS, IRON_LEGGINGS, LEATHER_LEGGINGS));
groupMap.putAll(CHESTPLATES, Arrays.asList(DIAMOND_CHESTPLATE, GOLDEN_CHESTPLATE, IRON_CHESTPLATE, LEATHER_CHESTPLATE));
groupMap.putAll(HELMETS, Arrays.asList(DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, LEATHER_HELMET));
}
private void setupLegacy() {
groupMap.putAll(AXES, Arrays.asList(DIAMOND_AXE, Material.valueOf("GOLD_AXE"), IRON_AXE, STONE_AXE, Material.valueOf("WOOD_AXE")));
groupMap.putAll(PICKAXES, Arrays.asList(DIAMOND_PICKAXE, Material.valueOf("GOLD_PICKAXE"), IRON_PICKAXE, STONE_PICKAXE, Material.valueOf("WOOD_PICKAXE")));
groupMap.putAll(SWORDS, Arrays.asList(DIAMOND_SWORD, Material.valueOf("GOLD_SWORD"), IRON_SWORD, STONE_SWORD, Material.valueOf("WOOD_SWORD")));
groupMap.put(BOWS, BOW);
groupMap.putAll(BOOTS, Arrays.asList(DIAMOND_BOOTS, Material.valueOf("GOLD_BOOTS"), IRON_BOOTS, LEATHER_BOOTS));
groupMap.putAll(LEGGINGS, Arrays.asList(DIAMOND_LEGGINGS, Material.valueOf("GOLD_LEGGINGS"), IRON_LEGGINGS, LEATHER_LEGGINGS));
groupMap.putAll(CHESTPLATES, Arrays.asList(DIAMOND_CHESTPLATE, Material.valueOf("GOLD_CHESTPLATE"), IRON_CHESTPLATE, LEATHER_CHESTPLATE));
groupMap.putAll(HELMETS, Arrays.asList(DIAMOND_HELMET, Material.valueOf("GOLD_HELMET"), IRON_HELMET, LEATHER_HELMET));
}
public Set<Material> get(String key) {
Optional<Group> optionalGroup = Group.from(key);
Set<Material> output = new HashSet<>();
optionalGroup.ifPresent(group -> {
output.addAll(groupMap.get(group));
output.addAll(group.getChildren().stream().map(groupMap::get).flatMap(Collection::stream).collect(Collectors.toSet()));
});
if (Material.matchMaterial(key) != null) {
output.add(Material.matchMaterial(key));
}
return output;
}
public enum Group {
AXES,
PICKAXES,
SHOVELS,
TOOLS(AXES, PICKAXES, SHOVELS),
SWORDS,
BOWS,
WEAPONS(SWORDS, BOWS),
BOOTS,
LEGGINGS,
CHESTPLATES,
HELMETS,
ARMOR(BOOTS, LEGGINGS, CHESTPLATES, HELMETS);
@Getter private final Set<Group> children;
Group(Group... child) {
children = child == null ? new HashSet<>() : new HashSet<>(Arrays.asList(child));
}
public static Optional<Group> from(String key) {
return Arrays.stream(values()).filter(s -> s.toString().equalsIgnoreCase(key)).findFirst();
}
public String getName() {
return StringUtils.capitalize(toString().toLowerCase());
}
}
}

View File

@ -16,7 +16,7 @@ command:
enchanter:
cannot-afford: "&cYou cannot afford this purchase."
success: "&7Purchased {group_color}{group_name} &7book."
success: "&7Purchased {group_color}{group_name} &7book for &f{exp_cost} EXP&7."
tinkerer:
open: "&eTrading with the tinkerer."
@ -34,4 +34,9 @@ enchants:
already-applied: "&cYou already have that enchant with that level applied on this item."
protected: "&aYour book would have broken your item, luckily it was protected!"
book:
discover:
- "&l&e(!) &r&eYou examine the {group_color}{group_name} Enchantment Book..."
- "&eand discover &n{enchant_format}!"

View File

@ -1,3 +1,5 @@
#LEGACY CONFIG
language: "en_US"
roman-numbers: true

View File

@ -2,24 +2,24 @@ groups:
SIMPLE:
group-color: "&f"
group-name: "Simple"
group-format: "{group_color} {enchant} {level}"
tinkerer-exp-per-level: 100
group-lore-format: "{group_color} {enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 20
success-max: 80
success-min: 10
success-max: 100
book-item:
material: BOOK
display-name: "{group_color}{enchant} {level}"
display-name: "&l&n{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
UNIQUE:
group-color: "&a"
group-name: "Unique"
group-format: "{group_color}{enchant} {level}"
tinkerer-exp-per-level: 200
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
@ -31,11 +31,12 @@ groups:
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
ELITE:
group-color: "&b"
group-name: "Elite"
group-format: "{group_color}{enchant} {level}"
tinkerer-exp-per-level: 300
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
@ -47,11 +48,12 @@ groups:
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
ULTIMATE:
group-color: "&e"
group-name: "Ultimate"
tinkerer-exp-per-level: 600
group-format: "{group_color}{enchant} {level}"
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
@ -63,11 +65,12 @@ groups:
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
LEGENDARY:
group-color: "&6"
group-name: "Legendary"
group-format: "{group_color}{enchant} {level}"
tinkerer-exp-per-level: 1000
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
@ -79,3 +82,5 @@ groups:
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."

View File

@ -1,6 +1,6 @@
white-scroll:
material: MAP
display-name: "&e&lWhite Scroll"
display-name: "&eWhite Scroll"
format: "&7&lPROTECTED"
lore:
- "&7Prevents an item from being destroyed"
@ -18,7 +18,7 @@ black-scroll:
mystery-book:
material: BOOK
display-name: "{group-color}{group-name} Enchantment &7(Right click)"
display-name: "{group-color}{group-name} Enchantment Book &7(Right click)"
lore:
- "&7Examine to receive a random"
- "{group-color}{group-name} &7enchantment book."

View File

@ -0,0 +1,84 @@
title: "Enchanter"
rows: 1
#You can choose to fill the entire inventory with this material
#fill:
# material: "MATERIAL_HERE"
# display-name: "&r"
contents:
1:
material: "WHITE_STAINED_GLASS_PANE"
display-name: "&f&lSimple Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&fsimple &7enchantment book."
- ""
- "&fUse &f/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: SIMPLE
exp-cost: 400
eco-cost: 0
slot: 2
2:
material: "LIME_STAINED_GLASS_PANE"
display-name: "&a&lUnique Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&aunique &7enchantment book."
- ""
- "&fUse &a/ee list unique &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: UNIQUE
exp-cost: 800
eco-cost: 0
slot: 3
3:
material: "CYAN_STAINED_GLASS_PANE"
display-name: "&b&lElite Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&belite &7enchantment book."
- ""
- "&fUse &b/ee list elite &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: ELITE
exp-cost: 2500
eco-cost: 0
slot: 4
4:
material: "YELLOW_STAINED_GLASS_PANE"
display-name: "&e&lUltimate Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&eultimate &7enchantment book."
- ""
- "&fUse &e/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f {exp_cost} EXP"
group: ULTIMATE
exp-cost: 5000
eco-cost: 0
slot: 5
5:
material: "ORANGE_STAINED_GLASS_PANE"
display-name: "&6&lLegendary Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&6legendary &7enchantment book."
- ""
- "&fUse &6/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: LEGENDARY
exp-cost: 25000
eco-cost: 0
slot: 6

View File

@ -0,0 +1,8 @@
name: EpicEnchants
version: ${project.version}
main: com.songoda.epicenchants.EpicEnchants
authors: [GB6]
website: https://songoda.com/
depend: [Vault]
softdepend: [UltimateBottles]
api-version: 1.13

View File

@ -0,0 +1,42 @@
general:
prefix: "&8[&6EpicEnchants&8]"
no-permission: "&cYou do not have permission to do that."
command:
book:
received: "&7You have been given a &6{enchant} &7book."
gave: "&7You gave {player} a &6{enchant} &7book."
max-level: "&cThe max level for {enchant} is {max-level}."
white-scroll:
received: "&7You have been given a whitescroll."
gave: "&7You gave {player} a whitescroll."
reload: "&6Configuration files reload"
enchanter:
cannot-afford: "&cYou cannot afford this purchase."
success: "&7Purchased {group_color}{group_name} &7book for &f{exp_cost} EXP&7."
tinkerer:
open: "&eTrading with the tinkerer."
cancelled: "&cCancelled."
accepted: "&aAccepted"
no-items: "&c&l(!) &r&cThe tinkerer is not interested in any of your items!"
deposited-all: "&a&l(!) &r&aDeposited {amount} items."
enchants:
invalid-material: "&cYou can not apply &6{enchant} &cto that item."
broken-failure: "&6{enchant} &cfailed to apply and broke your item..."
success: "&aYou have success fully applied &6{enchant}."
conflict: "&cYou cannot apply this enchant as it conflicts with another enchant."
maxed-out: "&cYou already have that enchant maxed on this item."
already-applied: "&cYou already have that enchant with that level applied on this item."
protected: "&aYour book would have broken your item, luckily it was protected!"
book:
discover:
- "&l&e(!) &r&eYou examine the {group_color}{group_name} Enchantment Book..."
- "&eand discover &n{enchant_format}!"

View File

@ -0,0 +1,15 @@
#MASTER CONFIG
language: "en_US"
roman-numbers: true
rates:
black-scroll-min: 20
black-scroll-max: 100
commands:
enchanter: "enchanter"
alchemist: "alchemist"
tinkerer: "tinkerer"

View File

@ -0,0 +1,98 @@
# The enchant identifier must be unique.
identifier: ExampleEnchant
# The max level for this enchant.
max-level: 3
# The group of this enchant. Configure the groups in the groups.yml file.
group: SIMPLE
# The item that the enchantment book is.
book-item:
material: BOOK
display-name: "&b&lExampleEnchant {level}"
# The lore on the enchantments books.
lore:
- "&7Drag on to enchant"
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
# How the enchant should be formatted on the enchanted item.
applied-format: "&cExampleEnchant {level}"
# What items this enchant can be applied too.
item-whitelist:
- "DIAMOND_HELMET"
- "IRON_HELMET"
- "LEATHER_HELMET"
# This enchantment can not be applied if then enchantment below is already on the item.
conflicting-enchants:
- "someEnchant"
# For a full list of effects, please visit: https://wiki.songoda.com/display/SON/EpicEnchants
effects:
# The "-1" is added because every effect key has to be unique.
POTION-1:
# The trigger that will fire this effect
trigger: DEFENSE_PLAYER_MELEE
# What player should the effect be ran on: WEARER/OPPONENT.
who: WEARER
# Potion Effect that should be applied.
potion-type: SPEED
# Duration of the Potion Effect in seconds.
duration: "10 * {level}"
# Chance that the Effect gets activated.
chance: "20 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level} - 1"
POTION-2:
trigger: STATIC_EFFECT
who: WEARER
potion-type: INCREASE_DAMAGE
amplifier: "{level} - 1"
# Chance of spawning when damaged by another player.
mobs:
# Type of Mob
ZOMBIE:
# Trigger event that spawns the mob.
trigger: DEFENSE_PLAYER_MELEE
# Max amount mobs that will be spawned.
max-amount: "{level}"
# Chance of trigger the mob spawning.
spawn-percentage: "20 * {level}"
# Drop chance of the mob its equipment upon death.
equipment-drop-chance: "10 * {level}"
# Health of the mob.
health: "3 * {level}"
# Amount of damage the mob deals.
attack-damage: "{level}"
# Display name of the spawned mob
display-name: "&cAngry guy level {level}"
# The equiment that the mob wears
equipment:
helmet:
material: DIAMOND_HELMET
enchants:
- "DURABILITY:{level}"
- "THORNS:{level} - 1"
chestplate:
material: DIAMOND_CHESTPLATE
enchants:
- "DURABILITY:{level}"
- "THORNS:{level} - 1"
leggings:
material: DIAMOND_LEGGINGS
enchants:
- "DURABILITY:{level}"
- "THORNS:{level} - 1"
boots:
material: DIAMOND_BOOTS
enchants:
- "DURABILITY:{level}"
- "THORNS:{level} - 1"
hand-item:
material: DIAMOND_SWORD
enchant:
- "SHARPNESS:{level}"

View File

@ -0,0 +1,86 @@
groups:
SIMPLE:
group-color: "&f"
group-name: "Simple"
group-lore-format: "{group_color} {enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 10
success-max: 100
book-item:
material: BOOK
display-name: "&l&n{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
UNIQUE:
group-color: "&a"
group-name: "Unique"
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 20
success-max: 80
book-item:
material: BOOK
display-name: "{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
ELITE:
group-color: "&b"
group-name: "Elite"
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 20
success-max: 80
book-item:
material: BOOK
display-name: "{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
ULTIMATE:
group-color: "&e"
group-name: "Ultimate"
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 20
success-max: 80
book-item:
material: BOOK
display-name: "{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."
LEGENDARY:
group-color: "&6"
group-name: "Legendary"
group-lore-format: "{group_color}{enchant} {level}"
rates:
destroy-min: 10
destroy-max: 100
success-min: 20
success-max: 80
book-item:
material: BOOK
display-name: "{group_color}{enchant} {level}"
lore:
- "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate"
- "{description}"
- "&7Drag and drop to enchant."

View File

@ -0,0 +1,39 @@
secret-dust:
material: FIREBALL
display-name: "{group-color}{group-name} Secret Dust &7(Right click)"
lore:
- "&aSuccess: +{min-rate}-{max-rate}%"
- "&7Contains &bMagic&7, &ePrimal&7 or &fMystery &7dust."
- "&7An unidentified satchel of dust."
dusts:
mystery:
chance: 50
material: SULPHUR
display-name: "&fMystery Dust"
lore:
- "&7The failed bi-product of"
- "&7Mystery and Primal dust."
magic:
chance: 40
material: SUGAR
display-name: "{group-color}{group-name} Magic Dust"
lore:
- "&a+{percentage}% success"
- "&7Apply to a &l{group-color}{group-name} Enchantment Book"
- "&7to increase its success rate by &l{group-color}{percentage}%"
- ""
- "&7Place dust on enchantment book."
primal:
chance: 10
min-rate: 10
max-rate: 30
material: GLOWSTONE_DUST
display-name: "&l{group-color}{group-name} Primal Dust"
lore:
- "&a&l+{percentage}% SUCCESS"
- "&fApply to a &l{group-color}{group-name} Enchantment Book"
- "&fto increase its success rate by &l{group-color}{percentage}%"
- ""
- "&fPlace dust on enchantment book."

View File

@ -0,0 +1,24 @@
white-scroll:
material: MAP
display-name: "&eWhite Scroll"
format: "&7&lPROTECTED"
lore:
- "&7Prevents an item from being destroyed"
- "&7due to a failed Enchantment Book."
- "&ePlace scroll on item to apply."
black-scroll:
material: INK_SACK
display-name: "&f&lBlack Scroll"
lore:
- "&7Removes a random enchantment"
- "&7from an item and converts"
- "&7it into a {success-rate} success book."
- "&fPlace scroll on item to extract."
mystery-book:
material: BOOK
display-name: "{group-color}{group-name} Enchantment Book &7(Right click)"
lore:
- "&7Examine to receive a random"
- "{group-color}{group-name} &7enchantment book."

View File

@ -0,0 +1,84 @@
title: "Enchanter"
rows: 1
#You can choose to fill the entire inventory with this material
#fill:
# material: "MATERIAL_HERE"
# display-name: "&r"
contents:
1:
material: "WHITE_STAINED_GLASS_PANE"
display-name: "&f&lSimple Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&fsimple &7enchantment book."
- ""
- "&fUse &f/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: SIMPLE
exp-cost: 400
eco-cost: 0
slot: 2
2:
material: "LIME_STAINED_GLASS_PANE"
display-name: "&a&lUnique Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&aunique &7enchantment book."
- ""
- "&fUse &a/ee list unique &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: UNIQUE
exp-cost: 800
eco-cost: 0
slot: 3
3:
material: "CYAN_STAINED_GLASS_PANE"
display-name: "&b&lElite Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&belite &7enchantment book."
- ""
- "&fUse &b/ee list elite &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: ELITE
exp-cost: 2500
eco-cost: 0
slot: 4
4:
material: "YELLOW_STAINED_GLASS_PANE"
display-name: "&e&lUltimate Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&eultimate &7enchantment book."
- ""
- "&fUse &e/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f {exp_cost} EXP"
group: ULTIMATE
exp-cost: 5000
eco-cost: 0
slot: 5
5:
material: "ORANGE_STAINED_GLASS_PANE"
display-name: "&6&lLegendary Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&6legendary &7enchantment book."
- ""
- "&fUse &6/ee list simple &7to view a list"
- "&fof possible enchants you could unlock!"
- ""
- "&b&lCOST &r&f{exp_cost} EXP"
group: LEGENDARY
exp-cost: 25000
eco-cost: 0
slot: 6

View File

@ -0,0 +1,15 @@
title: "Elite enchants"
size: 9
#Slots that you want enchants to be displayed on
slots: "4,5,6"
#The group of the enchants to be displayed
group: ELITE
enchant-item:
material: "PAPER"
display-name: "{group_color} {enchant}"
lore:
- "&7Description:"
- "{description}"

View File

@ -0,0 +1,15 @@
title: "Legendary enchants"
size: 9
#Slots that you want enchants to be displayed on
slots: "4,5,6"
#The group of the enchants to be displayed
group: LEGENDARY
enchant-item:
material: "PAPER"
display-name: "{group_color} {enchant}"
lore:
- "&7Description:"
- "{description}"

View File

@ -0,0 +1,15 @@
title: "Simple enchants"
size: 9
#Slots that you want enchants to be displayed on
slots: "4,5,6"
#The group of the enchants to be displayed
group: SIMPLE
enchant-item:
material: "PAPER"
display-name: "{group_color} {enchant}"
lore:
- "&7Description:"
- "{description}"

View File

@ -0,0 +1,15 @@
title: "Ultimate enchants"
size: 9
#Slots that you want enchants to be displayed on
slots: "4,5,6"
#The group of the enchants to be displayed
group: ULTIMATE
enchant-item:
material: "PAPER"
display-name: "{group_color} {enchant}"
lore:
- "&7Description:"
- "{description}"

View File

@ -0,0 +1,15 @@
title: "Unique enchants"
size: 9
#Slots that you want enchants to be displayed on
slots: "4,5,6"
#The group of the enchants to be displayed
group: UNIQUE
enchant-item:
material: "PAPER"
display-name: "{group_color} {enchant}"
lore:
- "&7Description:"
- "{description}"

View File

@ -0,0 +1,29 @@
title: "Main info menu"
rows: 1
contents:
1:
material: "PAPER"
display-name: "&f&lSimple Enchantments"
group: SIMPLE
slot: 0
2:
material: "PAPER"
display-name: "&a&lUnique Enchantments"
group: UNIQUE
slot: 1
3:
material: "PAPER"
display-name: "&b&lElite Enchantments"
group: ELITE
slot: 2
4:
material: "PAPER"
display-name: "&e&lUltimate Enchantments"
group: ULTIMATE
slot: 3
5:
material: "PAPER"
display-name: "&6&lLegendary Enchantments"
group: LEGENDARY
slot: 4

View File

@ -0,0 +1,41 @@
title: "Tinkerer"
rows: 6
player-slots: "1,2,3,9,10,11,12,18,19,20,21,27,28,29,30,36,37,38,39,45,46,47,48"
tinkerer-slots: "5,6,7,14,15,16,17,23,24,25,26,32,33,34,35,41,42,43,44,50,51,52,53"
slots: "(1,5) (2,6) (3,7) (9,14)
(10,15) (11,16) (12,17) (18,23)
(19,24) (20,25) (21,26) (27,32)
(28,33) (29,34) (30,35) (36,41)
(37,42) (38,43) (39,44) (45,50)
(46,51) (47,52) (48,53)"
contents:
1:
material: "STAINED_GLASS_PANE"
display-name: " "
slot: "4,13,22,31,40"
accept-left:
material: "STAINED_GLASS_PANE"
data: 4
display-name: "&eClick to accept trade"
slot: 0
accept-right:
material: "STAINED_GLASS_PANE"
data: 4
display-name: "&eClick to accept trade"
slot: 8
deposit-all:
material: "STAINED_GLASS_PANE"
data: 4
display-name: "&l&eDeposit All"
lore:
- "&7Click to deposit all tinkerable items."
slot: "49"
exp-table-per-level:
DEFAULT: 10
DEPTH_STRIDER: 20
ExampleEnchant: 50

View File

@ -1,24 +0,0 @@
title: "Enchanter"
rows: 1
#You can choose to fill the entire inventory witht this material
#fill:
# material: "MATERIAL_HERE"
# display-name: "&r"
# data: 7
contents:
1:
material: "PAPER"
display-name: "&f&lSimple Enchantment &7(Right Click)"
lore:
- "&7Examine to receive a random"
- "&fSimple &7enchantment book."
- ""
- "&b&lCOST&8:"
- "&f{exp_cost} EXP &7(You need {exp_left} more EXP)"
- "&f{eco_cost} $ &7(You need {eco_left} more $)"
group: SIMPLE
exp-cost: 20
eco-cost: 2000
slot: 4