mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-17 03:05:03 +00:00
Minor improvements for AE2 recipe logging
This commit is contained in:
1 parent
152fa40b9a
commit
a0a8f2f26e
4 files changed
+87
-48
No files matched your search
@@ -1,8 +1,12 @@
|
||||
package modtweaker2.helpers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LogHelper {
|
||||
public static void logPrinted(IPlayer player) {
|
||||
@@ -37,4 +41,44 @@ public class LogHelper {
|
||||
public static void logInfo(String message) {
|
||||
MineTweakerAPI.logInfo("[ModTweaker2] " + message);
|
||||
}
|
||||
|
||||
public static String getArrayDescription(List<ItemStack> stacks) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append('[');
|
||||
for(ItemStack stack : stacks) {
|
||||
sb.append(InputHelper.getStackDescription(stack)).append(", ");
|
||||
}
|
||||
sb.setLength(sb.length() - 2);
|
||||
sb.append(']');
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static List<String> toLowerCase(List<String> stringList) {
|
||||
ListIterator<String> iterator = stringList.listIterator();
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
iterator.set(iterator.next().toLowerCase());
|
||||
}
|
||||
|
||||
return stringList;
|
||||
}
|
||||
|
||||
public static String join(List<String> list, String conjunction) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if(conjunction == null) {
|
||||
conjunction = ", ";
|
||||
}
|
||||
|
||||
if(list != null && !list.isEmpty()) {
|
||||
for(String string : list) {
|
||||
sb.append(string).append(conjunction);
|
||||
}
|
||||
|
||||
sb.setLength(sb.length() - conjunction.length());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user