|
@@ -11,15 +11,15 @@ import org.bukkit.Material;
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
import org.bukkit.inventory.ItemStack;
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
public class RepairConfig extends ConfigLoader {
|
|
public class RepairConfig extends ConfigLoader {
|
|
private List<Repairable> repairables;
|
|
private List<Repairable> repairables;
|
|
|
|
+ private HashSet<String> notSupported;
|
|
|
|
|
|
public RepairConfig(String fileName) {
|
|
public RepairConfig(String fileName) {
|
|
super(fileName);
|
|
super(fileName);
|
|
|
|
+ notSupported = new HashSet<>();
|
|
loadKeys();
|
|
loadKeys();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -48,7 +48,8 @@ public class RepairConfig extends ConfigLoader {
|
|
Material itemMaterial = Material.matchMaterial(key);
|
|
Material itemMaterial = Material.matchMaterial(key);
|
|
|
|
|
|
if (itemMaterial == null) {
|
|
if (itemMaterial == null) {
|
|
- mcMMO.p.getLogger().info("No support for repair item "+key+ " in this version of Minecraft, skipping.");
|
|
|
|
|
|
+ //mcMMO.p.getLogger().info("No support for repair item "+key+ " in this version of Minecraft, skipping.");
|
|
|
|
+ notSupported.add(key); //Collect names of unsupported items
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -95,7 +96,7 @@ public class RepairConfig extends ConfigLoader {
|
|
Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultMaterial() : Material.matchMaterial(repairMaterialName));
|
|
Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultMaterial() : Material.matchMaterial(repairMaterialName));
|
|
|
|
|
|
if (repairMaterial == null) {
|
|
if (repairMaterial == null) {
|
|
- mcMMO.p.getLogger().info("Could not find a valid repair material for item named "+key+", skipping.");
|
|
|
|
|
|
+ notSupported.add(key); //Collect names of unsupported items
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -152,6 +153,25 @@ public class RepairConfig extends ConfigLoader {
|
|
repairables.add(repairable);
|
|
repairables.add(repairable);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //Report unsupported
|
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
+
|
|
|
|
+ if(notSupported.size() > 0) {
|
|
|
|
+ stringBuilder.append("mcMMO found the following materials in the Repair config that are not supported by the version of Minecraft running on this server: ");
|
|
|
|
+
|
|
|
|
+ for (Iterator<String> iterator = notSupported.iterator(); iterator.hasNext(); ) {
|
|
|
|
+ String unsupportedMaterial = iterator.next();
|
|
|
|
+
|
|
|
|
+ if(!iterator.hasNext()) {
|
|
|
|
+ stringBuilder.append(unsupportedMaterial);
|
|
|
|
+ } else {
|
|
|
|
+ stringBuilder.append(unsupportedMaterial).append(", ");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ mcMMO.p.getLogger().info(stringBuilder.toString());
|
|
|
|
+ mcMMO.p.getLogger().info("Items using materials that are not supported will simply be skipped.");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
protected List<Repairable> getLoadedRepairables() {
|
|
protected List<Repairable> getLoadedRepairables() {
|