Skip to content

Commit

Permalink
EliteMobs 9.2.3:
Browse files Browse the repository at this point in the history
- [New] Several visual improvements to the elite scrolls, including brand new custom art and proper menu styling
- [Fix] Fixed some bugs related to elite scrolls

Signed-off-by: MagmaGuy <tiagoarnaut@gmail.com>
  • Loading branch information
MagmaGuy committed Dec 28, 2024
1 parent 405017e commit ed69afc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ processResources {
}

group 'com.magmaguy'
version '9.2.2'
version '9.2.3'

repositories {
maven {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public class ItemSettingsConfig extends ConfigurationFile {
private static String eliteItemScrollName;
@Getter
private static List<String> eliteItemScrollLore;
@Getter
private static String eliteItemModel;

public ItemSettingsConfig() {
super("ItemSettings.yml");
Expand Down Expand Up @@ -365,9 +367,10 @@ public void initializeValues() {
eliteItemScrollLore = ConfigurationEngine.setList(List.of(
"Sets the name of the elite item scroll item"),file,
fileConfiguration, "eliteItemScrollLore", List.of(
"&fUse at an anvil to enchant",
"&fa non-elite item into",
"&fa level $level elite item!"),
"&fUse at the Scroll Applier NPC to enchant",
"&fa non-elite item into a level $level",
"&felite item!"),
true);
eliteItemModel = ConfigurationEngine.setString(List.of(), file, fileConfiguration, "eliteItemModel", "elitemobs:elitescroll/elitescroll", false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void processAdditionalFields() {

outputInfoButton = ConfigurationEngine.setItemStack(file, fileConfiguration, "outputInfoButton",
ItemStackGenerator.generateItemStack(Material.RED_BANNER, "&2Result"), true);
CustomModelAdder.addCustomModel(outputInfoButton, CustomModelsConfig.boxOutput);
outputInfoSlot = ConfigurationEngine.setInt(fileConfiguration, "outputInfoSlot", 24);
outputSlot = ConfigurationEngine.setInt(fileConfiguration, "outputSlot", 33);
CustomModelAdder.addCustomModel(eliteScrollItemInfoButton, CustomModelsConfig.boxInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public EliteItemLore(ItemStack itemStack, boolean showItemWorth) {
}

public EliteItemLore(ItemStack itemStack, boolean showItemWorth, boolean isNewItem) {
if (isNewItem && itemStack.getItemMeta().getLore() != null || !itemStack.getItemMeta().getLore().isEmpty()) {
if (isNewItem
&& itemStack.hasItemMeta()
&& itemStack.getItemMeta().hasLore()
&& itemStack.getItemMeta().getLore() != null
&& !itemStack.getItemMeta().getLore().isEmpty()) {
thirdPartyLore = itemStack.getItemMeta().getLore();
}
initialize(itemStack, showItemWorth);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/magmaguy/elitemobs/items/EliteScroll.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.magmaguy.elitemobs.MetadataHandler;
import com.magmaguy.elitemobs.api.utils.EliteItemManager;
import com.magmaguy.elitemobs.config.ItemSettingsConfig;
import com.magmaguy.elitemobs.utils.CustomModelAdder;
import com.magmaguy.magmacore.util.ItemStackGenerator;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
Expand All @@ -27,6 +28,7 @@ public static ItemStack generateScroll(int scrollLevel) {
ItemStack itemStack = ItemStackGenerator.generateItemStack(scrollMaterial, ItemSettingsConfig.getEliteItemScrollName(), lore);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.getPersistentDataContainer().set(eliteScrollNamespacedKey, PersistentDataType.INTEGER, scrollLevel);
CustomModelAdder.addCustomModel(itemMeta, ItemSettingsConfig.getEliteItemModel());
itemStack.setItemMeta(itemMeta);
return itemStack;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: EliteMobs
version: 9.2.2
version: 9.2.3
author: MagmaGuy
main: com.magmaguy.elitemobs.EliteMobs
api-version: 1.14
Expand Down

0 comments on commit ed69afc

Please sign in to comment.