diff --git a/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java b/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java index 14938a3b..cf012e54 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java +++ b/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java @@ -10,7 +10,7 @@ import net.Indyuce.mmoitems.api.crafting.ConfigMMOItem; import net.Indyuce.mmoitems.api.crafting.CraftingStation; import net.Indyuce.mmoitems.api.crafting.CraftingStatus.CraftingQueue; import net.Indyuce.mmoitems.api.crafting.IngredientInventory; -import net.Indyuce.mmoitems.api.event.crafting.CraftingStationCraftEvent; +import net.Indyuce.mmoitems.api.event.crafting.PlayerUseCraftingStationEvent; import net.Indyuce.mmoitems.api.item.plugin.ConfigItem; import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.util.message.Message; @@ -20,8 +20,8 @@ public class CraftingRecipe extends Recipe { private final ConfigMMOItem output; /* - * there can't be any crafting time for upgrading recipes since there is no way - * to save an MMOItem in the config file TODO save as ItemStack + * there can't be any crafting time for upgrading recipes since there is no + * way to save an MMOItem in the config file TODO save as ItemStack */ private final double craftingTime; @@ -55,18 +55,19 @@ public class CraftingRecipe extends Recipe { * directly add the ingredients to the player inventory */ if (isInstant()) { - CraftingStationCraftEvent event = new CraftingStationCraftEvent(data, station, this, true); + PlayerUseCraftingStationEvent event = new PlayerUseCraftingStationEvent(data, station, recipe); Bukkit.getPluginManager().callEvent(event); - if(event.isCancelled()) return; - + if (event.isCancelled()) + return; + if (hasOption(RecipeOption.OUTPUT_ITEM)) new SmartGive(data.getPlayer()).give(getOutput().generate()); recipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(data)); if (!hasOption(RecipeOption.SILENT_CRAFT)) data.getPlayer().playSound(data.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); /* - * if recipe not instant, add item to crafting queue, either way RELOAD - * inventory data and reopen inventory! + * if recipe not instant, add item to crafting queue, either way + * RELOAD inventory data and reopen inventory! */ } else data.getCrafting().getQueue(station).add(this); diff --git a/src/main/java/net/Indyuce/mmoitems/api/event/crafting/CraftingStationCraftEvent.java b/src/main/java/net/Indyuce/mmoitems/api/event/crafting/CraftingStationCraftEvent.java deleted file mode 100644 index 3c4871e2..00000000 --- a/src/main/java/net/Indyuce/mmoitems/api/event/crafting/CraftingStationCraftEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.Indyuce.mmoitems.api.event.crafting; - -import org.bukkit.event.HandlerList; - -import net.Indyuce.mmoitems.api.crafting.CraftingStation; -import net.Indyuce.mmoitems.api.crafting.recipe.Recipe; -import net.Indyuce.mmoitems.api.event.PlayerDataEvent; -import net.Indyuce.mmoitems.api.player.PlayerData; - -public class CraftingStationCraftEvent extends PlayerDataEvent { - private final Recipe recipe; - private final CraftingStation station; - private final boolean instant; - - private static final HandlerList handlers = new HandlerList(); - - public CraftingStationCraftEvent(PlayerData playerData, CraftingStation station, Recipe recipe, boolean instant) { - super(playerData); - - this.recipe = recipe; - this.station = station; - this.instant = instant; - } - - public CraftingStation getStation() { - return station; - } - - public Recipe getRecipe() { - return recipe; - } - - public boolean isInstant() { - return instant; - } - - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } -} diff --git a/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseCraftingStationEvent.java b/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseCraftingStationEvent.java new file mode 100644 index 00000000..cb58d805 --- /dev/null +++ b/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseCraftingStationEvent.java @@ -0,0 +1,110 @@ +package net.Indyuce.mmoitems.api.event.crafting; + +import org.apache.commons.lang.Validate; +import org.bukkit.event.HandlerList; + +import net.Indyuce.mmoitems.api.crafting.CraftingStation; +import net.Indyuce.mmoitems.api.crafting.recipe.CraftingRecipe; +import net.Indyuce.mmoitems.api.crafting.recipe.Recipe; +import net.Indyuce.mmoitems.api.crafting.recipe.RecipeInfo; +import net.Indyuce.mmoitems.api.event.PlayerDataEvent; +import net.Indyuce.mmoitems.api.player.PlayerData; + +public class PlayerUseCraftingStationEvent extends PlayerDataEvent { + private final Recipe recipe; + private final RecipeInfo recipeInfo; + private final CraftingStation station; + private final StationAction action; + + private static final HandlerList handlers = new HandlerList(); + + /** + * Called when a player directly interacts with a recipe in the crafting + * station GUI. The recipe is either instant and the item is given + * instaneously, or the item is sent in the crafting queue + * + * @param playerData + * The player interacting with the crafting station + * @param station + * The crafting station being used + * @param recipeInfo + * The recipe being used to craft the item + */ + public PlayerUseCraftingStationEvent(PlayerData playerData, CraftingStation station, RecipeInfo recipeInfo) { + super(playerData); + + this.recipeInfo = recipeInfo; + this.recipe = recipeInfo.getRecipe(); + this.station = station; + this.action = StationAction.INTERACT_WITH_RECIPE; + } + + /** + * Called when a player claims an item from the crafting queue. + * + * @param playerData + * The player interacting with the crafting station + * @param station + * The crafting station being used + * @param recipeInfo + * The recipe being used to craft the item + */ + public PlayerUseCraftingStationEvent(PlayerData playerData, CraftingStation station, Recipe recipe) { + super(playerData); + + this.recipeInfo = null; + this.recipe = recipe; + this.station = station; + this.action = StationAction.CRAFTING_QUEUE; + } + + public CraftingStation getStation() { + return station; + } + + /** + * @return The corresponding recipe info IF AND ONLY IF the player is + * interacting with a recipe. This method cannot be used when a + * player claims an item from the crafting queue. + */ + public RecipeInfo getRecipeInfo() { + Validate.notNull(recipeInfo, "No recipe info is provided when a player claims an item in the crafting queue"); + return recipeInfo; + } + + public Recipe getRecipe() { + return recipe; + } + + public StationAction getInteraction() { + return action; + } + + @Deprecated + public boolean isInstant() { + return recipe instanceof CraftingRecipe && ((CraftingRecipe) recipe).isInstant(); + } + + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + public enum StationAction { + + /** + * Called when a player places an item in the crafting queue when the + * recipe is not instantaneous. + */ + INTERACT_WITH_RECIPE, + + /** + * Called when a player claims the item either in the crafting queue or + * because the recipe is instantaneous + */ + CRAFTING_QUEUE; + } +} diff --git a/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseRecipeEvent.java b/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseRecipeEvent.java deleted file mode 100644 index cf91c8e8..00000000 --- a/src/main/java/net/Indyuce/mmoitems/api/event/crafting/PlayerUseRecipeEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.Indyuce.mmoitems.api.event.crafting; - -import org.bukkit.event.HandlerList; - -import net.Indyuce.mmoitems.api.crafting.CraftingStation; -import net.Indyuce.mmoitems.api.crafting.recipe.Recipe; -import net.Indyuce.mmoitems.api.crafting.recipe.RecipeInfo; -import net.Indyuce.mmoitems.api.event.PlayerDataEvent; -import net.Indyuce.mmoitems.api.player.PlayerData; - -public class PlayerUseRecipeEvent extends PlayerDataEvent { - private final RecipeInfo info; - private final CraftingStation station; - - private static final HandlerList handlers = new HandlerList(); - - public PlayerUseRecipeEvent(PlayerData playerData, CraftingStation station, RecipeInfo info) { - super(playerData); - - this.info = info; - this.station = station; - } - - public CraftingStation getStation() { - return station; - } - - public RecipeInfo getRecipeInfo() { - return info; - } - - public Recipe getRecipe() { - return info.getRecipe(); - } - - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } -} diff --git a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GeneratedItemBuilder.java b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GeneratedItemBuilder.java index afdcd5aa..306e37b8 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GeneratedItemBuilder.java +++ b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GeneratedItemBuilder.java @@ -111,11 +111,11 @@ public class GeneratedItemBuilder { nameModifiers.removeIf(current -> current.getType() == modifier.getType() && current.getPriority() < modifier.getPriority()); nameModifiers.add(modifier); } - + private Collection rollModifiers(GenerationTemplate template) { if (!template.hasOption(TemplateOption.ROLL_MODIFIER_CHECK_ORDER)) return template.getModifiers(); - + List modifiers = new ArrayList<>(template.getModifiers()); Collections.shuffle(modifiers); return modifiers; diff --git a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationModifier.java b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationModifier.java index 65cb6ea2..f4b36525 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationModifier.java +++ b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationModifier.java @@ -31,13 +31,23 @@ public class GenerationModifier { this(null, config); } + /** + * Loads an item gen modifier from a configuration section. If you provide + * the ItemGenManager, you will be able to use the 'parent' option to + * redirect that modifier to a public gen modifier. + * + * @param manager + * Provide the ItemGenManager to use the 'parent' option + * @param config + * The configuration section to load the modifier from + */ public GenerationModifier(ItemGenManager manager, ConfigurationSection config) { Validate.notNull(config, "Could not read config"); id = config.getName().toLowerCase().replace("_", "-"); /* * when providing a non-null itemGenManager, it indicates that public - * modifiers were loaded and that the constructor can them + * modifiers were loaded and that the constructor can use them */ if (manager != null && config.contains("parent")) { String parentFormat = config.get("parent").toString().toLowerCase().replace("_", "-").replace(" ", "_"); diff --git a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationTemplate.java b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationTemplate.java index 8bf00857..1d6148fe 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationTemplate.java +++ b/src/main/java/net/Indyuce/mmoitems/api/itemgen/GenerationTemplate.java @@ -46,8 +46,7 @@ public class GenerationTemplate { if (config.contains("modifiers")) for (String key : config.getConfigurationSection("modifiers").getKeys(false)) try { - modifiers.add(new GenerationModifier(MMOItems.plugin.getItemGenerator(), - config.getConfigurationSection("modifiers." + key))); + modifiers.add(new GenerationModifier(MMOItems.plugin.getItemGenerator(), config.getConfigurationSection("modifiers." + key))); } catch (IllegalArgumentException exception) { MMOItems.plugin.getLogger().log(Level.INFO, "An error occured while trying to load modifier '" + key + "' from item gen template '" + id + "': " + exception.getMessage()); @@ -62,8 +61,8 @@ public class GenerationTemplate { ItemStat stat = MMOItems.plugin.getStats().get(id); base.put(stat, stat.whenInitializedGeneration(config.get("base." + key))); } catch (IllegalArgumentException exception) { - MMOItems.plugin.getLogger().log(Level.INFO, "An error occured while trying to load base item data '" - + key + "' from item gen template '" + id + "': " + exception.getMessage()); + MMOItems.plugin.getLogger().log(Level.INFO, "An error occured while trying to load base item data '" + key + + "' from item gen template '" + id + "': " + exception.getMessage()); } } @@ -87,6 +86,12 @@ public class GenerationTemplate { return options.contains(option); } + /** + * @param player + * The rpg info about the player whom you want to give a random + * item to + * @return A random item builder which scales on the player's level. + */ public GeneratedItemBuilder newBuilder(RPGPlayer player) { int itemLevel = MMOItems.plugin.getItemGenerator().rollLevel(player.getLevel()); RolledTier itemTier = MMOItems.plugin.getItemGenerator().rollTier(itemLevel); @@ -100,8 +105,8 @@ public class GenerationTemplate { public enum TemplateOption { /* - * when the item is being generated, modifiers are rolled in a random order so - * you never the same modifiers again and again + * when the item is being generated, modifiers are rolled in a random + * order so you never the same modifiers again and again */ ROLL_MODIFIER_CHECK_ORDER; } diff --git a/src/main/java/net/Indyuce/mmoitems/api/itemgen/NameModifier.java b/src/main/java/net/Indyuce/mmoitems/api/itemgen/NameModifier.java index 43d4d2b7..9fbc5d4b 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/itemgen/NameModifier.java +++ b/src/main/java/net/Indyuce/mmoitems/api/itemgen/NameModifier.java @@ -11,6 +11,14 @@ public class NameModifier { private final String format; private final int priority; + /** + * Loads a prefix/suffix from either a config section or a string + * + * @param type + * Either a prefix or a suffix + * @param object + * The object to load the modifier from + */ public NameModifier(ModifierType type, Object object) { Validate.notNull(object, "Object cannot be null"); this.type = type; diff --git a/src/main/java/net/Indyuce/mmoitems/api/itemgen/RandomStatData.java b/src/main/java/net/Indyuce/mmoitems/api/itemgen/RandomStatData.java index 1691ccd7..c79eac2b 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/itemgen/RandomStatData.java +++ b/src/main/java/net/Indyuce/mmoitems/api/itemgen/RandomStatData.java @@ -2,11 +2,19 @@ package net.Indyuce.mmoitems.api.itemgen; import net.Indyuce.mmoitems.stat.data.type.StatData; +/** + * RandomStatDatas are basically the bricks of the generation templates. They + * are the first instances called when loading gen templates from config files. + * + * @author cympe + */ public interface RandomStatData { - /* - * generate a real stat data based on the item builder which contains - * information about the item level. + /** + * @param builder + * The builder of the random item being generated + * @return A random stat data instance which will then be merged onto the + * base item template */ public StatData randomize(GeneratedItemBuilder builder); } diff --git a/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java b/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java index 980025e0..27ebd504 100644 --- a/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java +++ b/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java @@ -3,7 +3,6 @@ package net.Indyuce.mmoitems.gui; import java.util.List; import java.util.UUID; -import net.Indyuce.mmoitems.api.crafting.recipe.Recipe; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Sound; @@ -21,9 +20,9 @@ import net.Indyuce.mmoitems.api.crafting.CraftingStatus.CraftingQueue.CraftingIn import net.Indyuce.mmoitems.api.crafting.IngredientInventory; import net.Indyuce.mmoitems.api.crafting.ingredient.Ingredient; import net.Indyuce.mmoitems.api.crafting.recipe.CraftingRecipe; +import net.Indyuce.mmoitems.api.crafting.recipe.Recipe; import net.Indyuce.mmoitems.api.crafting.recipe.RecipeInfo; -import net.Indyuce.mmoitems.api.event.crafting.CraftingStationCraftEvent; -import net.Indyuce.mmoitems.api.event.crafting.PlayerUseRecipeEvent; +import net.Indyuce.mmoitems.api.event.crafting.PlayerUseCraftingStationEvent; import net.Indyuce.mmoitems.api.item.plugin.ConfigItem; import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.util.message.Message; @@ -184,9 +183,9 @@ public class CraftingStationView extends PluginInventory { if (craft.isReady()) { CraftingRecipe recipe = craft.getRecipe(); - CraftingStationCraftEvent cscevent = new CraftingStationCraftEvent(data, station, recipe, true); - Bukkit.getPluginManager().callEvent(cscevent); - if(!cscevent.isCancelled()) { + PlayerUseCraftingStationEvent called = new PlayerUseCraftingStationEvent(data, station, recipe); + Bukkit.getPluginManager().callEvent(called); + if (!called.isCancelled()) { recipe.getTriggers().forEach(trigger -> trigger.whenCrafting(data)); ItemStack craftedItem = recipe.getOutput().generate(); CustomSoundListener.stationCrafting(craftedItem, data.getPlayer()); @@ -195,8 +194,7 @@ public class CraftingStationView extends PluginInventory { if (recipe.hasOption(Recipe.RecipeOption.OUTPUT_ITEM)) new SmartGive(data.getPlayer()).give(craftedItem); } - } - else { + } else { data.getPlayer().playSound(data.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); for (Ingredient ingredient : craft.getRecipe().getIngredients()) new SmartGive(data.getPlayer()).give(ingredient.generateItemStack()); @@ -225,7 +223,7 @@ public class CraftingStationView extends PluginInventory { return; } - PlayerUseRecipeEvent called = new PlayerUseRecipeEvent(data, station, recipe); + PlayerUseCraftingStationEvent called = new PlayerUseCraftingStationEvent(data, station, recipe); Bukkit.getPluginManager().callEvent(called); if (called.isCancelled()) return; diff --git a/src/main/java/net/Indyuce/mmoitems/stat/CustomSounds.java b/src/main/java/net/Indyuce/mmoitems/stat/CustomSounds.java index f853e39d..5f8450af 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/CustomSounds.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/CustomSounds.java @@ -160,7 +160,7 @@ public class CustomSounds extends ItemStat implements ProperStat { mmoitem.getNBT().getDouble("MMOITEMS_SOUND_" + sound.name() + "_PIT")); } - if (sounds.total() > 0) + if (sounds.getCustomSounds().size() > 0) mmoitem.setData(ItemStat.CUSTOM_SOUNDS, sounds); } } diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/CommandListData.java b/src/main/java/net/Indyuce/mmoitems/stat/data/CommandListData.java index 43d39e8d..949cff7e 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/CommandListData.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/CommandListData.java @@ -11,9 +11,15 @@ import net.Indyuce.mmoitems.stat.data.type.Mergeable; import net.Indyuce.mmoitems.stat.data.type.StatData; public class CommandListData implements StatData, Mergeable, RandomStatData { - private final Set commands = new HashSet<>(); + private final Set commands; + + public CommandListData(Set commands) { + this.commands = commands; + } public CommandListData(CommandData... commands) { + this(new HashSet<>()); + add(commands); } @@ -34,6 +40,6 @@ public class CommandListData implements StatData, Mergeable, RandomStatData { @Override public StatData randomize(GeneratedItemBuilder builder) { - return this; + return new CommandListData(new HashSet<>(commands)); } } \ No newline at end of file diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/GemSocketsData.java b/src/main/java/net/Indyuce/mmoitems/stat/data/GemSocketsData.java index 4aab79a8..259ea91c 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/GemSocketsData.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/GemSocketsData.java @@ -1,5 +1,6 @@ package net.Indyuce.mmoitems.stat.data; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -42,7 +43,7 @@ public class GemSocketsData implements StatData, Mergeable, RandomStatData { emptySlots.remove(getEmptySocket(gem)); gems.add(gemstone); } - + public void addEmptySlot(String slot) { emptySlots.add(slot); } @@ -77,6 +78,6 @@ public class GemSocketsData implements StatData, Mergeable, RandomStatData { @Override public StatData randomize(GeneratedItemBuilder builder) { - return this; + return new GemSocketsData(new ArrayList<>(emptySlots)); } } diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/SoundListData.java b/src/main/java/net/Indyuce/mmoitems/stat/data/SoundListData.java index 6084a82f..2df91853 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/SoundListData.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/SoundListData.java @@ -13,37 +13,41 @@ import net.Indyuce.mmoitems.stat.data.type.Mergeable; import net.Indyuce.mmoitems.stat.data.type.StatData; public class SoundListData implements StatData, Mergeable, RandomStatData { - private final Map stats = new HashMap<>(); + private final Map sounds; + + public SoundListData() { + this(new HashMap<>()); + } + + public SoundListData(Map sounds) { + this.sounds = sounds; + } public Set getCustomSounds() { - return stats.keySet(); + return sounds.keySet(); } public Map mapData() { - return stats; + return sounds; } public SoundData get(CustomSound sound) { - return stats.get(sound); + return sounds.get(sound); } public void set(CustomSound type, String sound, double volume, double pitch) { - this.stats.put(type, new SoundData(sound, volume, pitch)); - } - - public int total() { - return stats.size(); + this.sounds.put(type, new SoundData(sound, volume, pitch)); } @Override public void merge(StatData data) { Validate.isTrue(data instanceof SoundListData, "Cannot merge two different stat data types"); SoundListData cast = (SoundListData) data; - cast.stats.keySet().forEach(key -> stats.put(key, cast.stats.get(key))); + cast.sounds.forEach((sound, soundData) -> sounds.put(sound, soundData)); } @Override public StatData randomize(GeneratedItemBuilder builder) { - return this; + return new SoundListData(new HashMap<>(sounds)); } } \ No newline at end of file diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/StringListData.java b/src/main/java/net/Indyuce/mmoitems/stat/data/StringListData.java index 7385949a..f2eec8cd 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/StringListData.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/StringListData.java @@ -40,7 +40,7 @@ public class StringListData implements StatData, RandomStatData, Mergeable { @Override public StatData randomize(GeneratedItemBuilder builder) { - return this; + return new StringListData(new ArrayList<>(list)); } @Override diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/type/Mergeable.java b/src/main/java/net/Indyuce/mmoitems/stat/data/type/Mergeable.java index 01fb54cc..858569f2 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/type/Mergeable.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/type/Mergeable.java @@ -2,8 +2,8 @@ package net.Indyuce.mmoitems.stat.data.type; public interface Mergeable { - /* - * merging two stat data is used when either applying a gem stone to an item + /** + * Merging two stat data is used when either applying a gem stone to an item * which already has this type of item data, or when generating an item * randomly so that the item benefits from all modifiers */ diff --git a/src/main/java/net/Indyuce/mmoitems/stat/type/StringStat.java b/src/main/java/net/Indyuce/mmoitems/stat/type/StringStat.java index c80914ed..565e4951 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/type/StringStat.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/type/StringStat.java @@ -76,7 +76,7 @@ public class StringStat extends ItemStat { lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.GREEN + value); } else - lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + " None"); + lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + "None"); lore.add(""); lore.add(ChatColor.YELLOW + AltChar.listDash + " Left click to change this value.");