Skip to content

Commit 60e5592

Browse files
committed
Implement last shinx modifications for 3.2.11
1 parent 7b40ee9 commit 60e5592

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

src/main/java/com/iridium/iridiumskyblock/configs/Biomes.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Biomes {
2020

2121
public Map<String, BiomeCategoryConfig> categories = ImmutableMap.<String, BiomeCategoryConfig>builder()
2222
.put("Overworld", new BiomeCategoryConfig(new Item(XMaterial.GRASS_BLOCK, 11, 1, "&9&lOverworld", Collections.emptyList()), 6))
23-
.put("Nether", new BiomeCategoryConfig(new Item(XMaterial.CRIMSON_HYPHAE, 13, 1, "&9&lNether", Collections.emptyList()), 6))
23+
.put("Nether", new BiomeCategoryConfig(new Item(XMaterial.NETHERRACK, 13, 1, "&9&lNether", Collections.emptyList()), 6))
2424
.put("End", new BiomeCategoryConfig(new Item(XMaterial.END_STONE, 15, 1, "&9&lEnd", Collections.emptyList()), 6))
2525
.build();
2626

src/main/java/com/iridium/iridiumskyblock/gui/BiomeCategoryGUI.java

+16-19
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.util.Optional;
2020

2121
/**
22-
* GUI which shows all items in a {@link BiomeCategory} and allows players to purchase them.
22+
* GUI which shows all biomes in a {@link BiomeCategory} and allows players to purchase them.
2323
*/
2424
public class BiomeCategoryGUI extends GUI {
2525

@@ -28,7 +28,7 @@ public class BiomeCategoryGUI extends GUI {
2828
/**
2929
* The default constructor.
3030
*
31-
* @param category The category whose items should be displayed in this GUI
31+
* @param category The category whose biomes should be displayed in this GUI
3232
*/
3333
public BiomeCategoryGUI(BiomeCategory category, Inventory previousInventory) {
3434
super(previousInventory);
@@ -44,7 +44,7 @@ public BiomeCategoryGUI(BiomeCategory category, Inventory previousInventory) {
4444
@Override
4545
public Inventory getInventory() {
4646
Inventory inventory = Bukkit.createInventory(this, category.size, StringUtils.color(IridiumSkyblock.getInstance().getBiomes().categoryTitle
47-
.replace("%category_name%", category.name)
47+
.replace("%biomecategory_name%", category.name)
4848
));
4949

5050
Bukkit.getScheduler().runTaskAsynchronously(IridiumSkyblock.getInstance(), () -> addContent(inventory));
@@ -61,20 +61,20 @@ public void addContent(Inventory inventory) {
6161

6262
InventoryUtils.fillInventory(inventory, IridiumSkyblock.getInstance().getBiomes().categoryBackground);
6363

64-
for (BiomeItem item : category.items) {
65-
ItemStack itemStack = item.item.parseItem();
64+
for (BiomeItem biomeItem : category.items) {
65+
ItemStack itemStack = biomeItem.item.parseItem();
6666
ItemMeta itemMeta = itemStack.getItemMeta();
6767

68-
itemStack.setAmount(item.defaultAmount);
69-
itemMeta.setDisplayName(StringUtils.color(item.name));
68+
itemStack.setAmount(biomeItem.defaultAmount);
69+
itemMeta.setDisplayName(StringUtils.color(biomeItem.name));
7070

71-
List<String> lore = item.lore == null ? new ArrayList<>() : new ArrayList<>(StringUtils.color(item.lore));
72-
addBiomeLore(lore, item);
71+
List<String> lore = biomeItem.lore == null ? new ArrayList<>() : new ArrayList<>(StringUtils.color(biomeItem.lore));
72+
addBiomeLore(lore, biomeItem);
7373

7474
itemMeta.setLore(lore);
7575
itemStack.setItemMeta(itemMeta);
7676

77-
inventory.setItem(item.slot, itemStack);
77+
inventory.setItem(biomeItem.slot, itemStack);
7878
}
7979

8080
if (IridiumSkyblock.getInstance().getConfiguration().backButtons && getPreviousInventory() != null) {
@@ -107,24 +107,21 @@ public void onInventoryClick(InventoryClickEvent event) {
107107
}
108108
}
109109

110-
private void addBiomeLore(List<String> lore, BiomeItem item) {
111-
if (item.isPurchasable()) {
110+
private void addBiomeLore(List<String> lore, BiomeItem biomeItem) {
111+
if (biomeItem.isPurchasable()) {
112112
lore.add(
113113
StringUtils.color(IridiumSkyblock.getInstance().getBiomes().buyPriceLore
114-
.replace("%amount%", String.valueOf(item.defaultAmount))
115-
.replace("%buy_price_vault%", formatPrice(item.buyCost.vault))
116-
.replace("%buy_price_crystals%", formatPrice(item.buyCost.crystals))
114+
.replace("%amount%", String.valueOf(biomeItem.defaultAmount))
115+
.replace("%buy_price_vault%", formatPrice(biomeItem.buyCost.vault))
116+
.replace("%buy_price_crystals%", formatPrice(biomeItem.buyCost.crystals))
117117
)
118118
);
119119
} else {
120120
lore.add(StringUtils.color(IridiumSkyblock.getInstance().getBiomes().notPurchasableLore));
121121
}
122122

123123
IridiumSkyblock.getInstance().getBiomes().biomeItemLore.stream()
124-
.map(StringUtils::color)
125-
.forEach(line -> lore.add(
126-
line.replace("%amount%", String.valueOf(item.defaultAmount))
127-
));
124+
.map(StringUtils::color);
128125
}
129126

130127
private String formatPrice(double value) {

0 commit comments

Comments
 (0)