A few tweaks to things. Make the mods command a bit better, make the

IndexedMessageCodec actually log which network channel it got back packets
on. Also, improve the custom directorymodlocator with actual custom names,
finally, allow up to 99 log rollovers, up from 7 default (this means a
repeatedly crashing server is less likely to roll out the log of the first
crash).

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-11-03 12:33:07 -05:00
1 parent fab4ce894a
commit 1e1644f6d4
8 files changed
+37 -15

No files matched your search

@@ -24,6 +24,7 @@ import net.minecraft.command.CommandSource;
import net.minecraft.command.Commands;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
import java.util.stream.Collectors;
@@ -35,9 +36,15 @@ public class CommandModList {
.requires(cs->cs.hasPermissionLevel(0)) //permission
.executes(ctx -> {
ctx.getSource().sendFeedback(new TranslationTextComponent("commands.forge.mods.list",
ModList.get().applyForEachModContainer(
mc->String.format("%s:%s(%s)", mc.getModId(), mc.getModInfo().getVersion().toString(), mc.getCurrentState())).
collect(Collectors.joining(","))),
ModList.get().applyForEachModFile(modFile ->
// locator - filename : firstmod (version) - numberofmods\n
String.format("%s %s : %s (%s) - %d",
modFile.getLocator().name().replace(' ', '_'),
modFile.getFileName(),
modFile.getModInfos().get(0).getModId(),
modFile.getModInfos().get(0).getVersion(),
modFile.getModInfos().size())).
collect(Collectors.joining("\n• ","• ", ""))),
true);
return 0;
}