Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Double check to prevent /f upgrades items showing up when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Svenja Reissaus committed Aug 2, 2018
1 parent 5fe55af commit 640871d
Showing 1 changed file with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,29 @@ public void openMainMenu(FPlayer fme) {
inventory.setItem(dummySlots.get(i), dummyItem);
}
ItemStack[] items = buildItems(fme);

List<Integer> cropSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
for (int i = 0; i <= cropSlots.size() - 1; i++) {
inventory.setItem(cropSlots.get(i), items[2]);
}
List<Integer> spawnerSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
for (int i = 0; i <= spawnerSlots.size() - 1; i++) {
inventory.setItem(spawnerSlots.get(i), items[1]);
}
List<Integer> expSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
for (int i = 0; i <= expSlots.size() - 1; i++) {
inventory.setItem(expSlots.get(i), items[0]);
}
List<Integer> chestSlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
for (int i = 0; i <= chestSlots.size() - 1; i++) {
inventory.setItem(chestSlots.get(i), items[3]);
if (cropSlots != -1) {
for (int i = 0; i <= cropSlots.size() - 1; i++) {
inventory.setItem(cropSlots.get(i), items[2]);
}
}
if (spawnerSlots != -1) {
for (int i = 0; i <= spawnerSlots.size() - 1; i++) {
inventory.setItem(spawnerSlots.get(i), items[1]);
}
}
if (expSlots != -1) {
for (int i = 0; i <= expSlots.size() - 1; i++) {
inventory.setItem(expSlots.get(i), items[0]);
}
}
if (chestSlots != -1) {
for (int i = 0; i <= chestSlots.size() - 1; i++) {
inventory.setItem(chestSlots.get(i), items[3]);
}
}
fme.getPlayer().openInventory(inventory);
}
Expand Down

0 comments on commit 640871d

Please sign in to comment.