CraftTweaker

CraftTweaker

151M Downloads

[Suggestion] Don't fail when exporting things

Tokeli opened this issue ยท 5 comments

commented

Issue Description:

A very poor title, but: Currently if a block/biome/liquid/whatever is improperly made and doesn't have an appropriate name-getting function, the entire export command will fail. Instead, I think it should catch the exception, but continue to export the list, with a different attempt to get the name, or just a warning in chat and in the file.

Example:

[04:36:38] [Server thread/WARN] [minecraft/CommandHandler]: Couldn't process command: ct blocks
java.lang.NoClassDefFoundError: net/minecraft/client/resources/I18n
        at exterminatorjeff.undergroundbiomes.common.block.wall.UBStoneWall.getLocalizedName(UBStoneWall.java:75) ~[UBStoneWall.class:?]
        at crafttweaker.mc1120.block.MCBlockDefinition.getDisplayName(MCBlockDefinition.java:39) ~[MCBlockDefinition.class:?]
        at crafttweaker.mc1120.commands.Commands$2.executeCommand(Commands.java:80) ~[Commands$2.class:?]

What happens:

Entire export command fails.

What you expected to happen:

Error is noted and the offending thing is skipped.


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 14.23.4.2760
  • Crafttweaker: 1.12-4.1.10
  • Using a server: Yes
commented

Containing the errors from a bad input is not "fixing others mistakes", it's just doing your job as a programmer.

Tokeli wasn't clear, but it sounds like one missing name-getting function could kill a lengthy data dump. That would be a problem not for the programmers who didn't provide the functions (and probably aren't using CT), but for everyone else trying to use Craftweaker with the dubious mod.

commented

The actual issue is that the mod is calling client side in the server. It isn't my job to fix their bad coding, it is their job to fix their code, if the mod was coded correctly there would be no issue, so yes I can just add a try catch but what happens when another mod calls that mods bad code, it will still crash.

commented

Thank you for clarifying the issue, I have to confess I would not have expected that from Tokeli's original post.

commented

As the log says, it can't find the I18N class, in the CLIENT package, from the SERVER thread

commented

I don't think we should fix others mistakes, if we do, then they won't fix it.