Skip to content

Commit 74f3115

Browse files
committed
~
1 parent f7babb6 commit 74f3115

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

src/Oneblock/ChestItems.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.HashMap;
66
import java.util.List;
77
import java.util.Map;
8+
import java.util.Set;
89

910
import org.bukkit.Material;
1011
import org.bukkit.configuration.file.YamlConfiguration;
@@ -16,7 +17,7 @@ public class ChestItems {
1617
private static Map<String, List<ItemStack>> chests = new HashMap<>();
1718

1819
public static void save() {
19-
YamlConfiguration config = YamlConfiguration.loadConfiguration(chest);
20+
YamlConfiguration config = new YamlConfiguration();
2021

2122
for (Map.Entry<String, List<ItemStack>> entry : chests.entrySet()) {
2223
List<Object> simplifiedItems = new ArrayList<>();
@@ -49,28 +50,26 @@ public static void load() {
4950
private static void loadItems(List<ItemStack> arr, List<?> data) {
5051
if (data == null) return;
5152
for (Object entry : data) {
52-
if (entry instanceof ItemStack) {
53+
if (entry instanceof ItemStack)
5354
arr.add((ItemStack) entry);
54-
}
5555
else if (entry instanceof String) {
5656
Material m = Material.getMaterial((String) entry);
57-
if (m != null) {
57+
if (m != null)
5858
arr.add(new ItemStack(m));
59-
}
6059
}
6160
}
6261
}
6362

64-
public static ArrayList<String> getChestNames() {
65-
return new ArrayList<>(chests.keySet());
63+
public static Set<String> getChestNames() {
64+
return chests.keySet();
6665
}
6766

68-
public static List <ItemStack> getChest(String chestType) {
67+
public static List<ItemStack> getChest(String chestType) {
6968
return chests.get(chestType);
7069
}
7170

7271
public static boolean fillChest(Inventory inv, String chestType) {
73-
List <ItemStack> ch = getChest(chestType);
72+
List<ItemStack> ch = getChest(chestType);
7473

7574
final int max = Oneblock.rnd.nextInt(3) + 2;
7675
try { for (int i = 0; i < max; i++) {

src/Oneblock/ConfigManager.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import java.io.File;
66
import java.util.List;
7-
import java.util.Optional;
8-
97
import org.bukkit.Bukkit;
108
import org.bukkit.Material;
119
import org.bukkit.boss.BarColor;

0 commit comments

Comments
 (0)