Create

Create

86M Downloads

Duplicate config key between `maxSchematics` and `maxTotalSchematicSize`

hlysine opened this issue ยท 2 comments

commented

Describe the Bug

The maxSchematics and maxTotalSchematicSize configs share the same name, effectively making the maxSchematics config useless, because it is always overwritten by maxTotalSchematicSize. This also has the effect of allowing players to upload a LOT more schematics to the server than the default limit of 10.

public final ConfigInt maxSchematics = i(10, 1, "maxSchematics", Comments.maxSchematics);
public final ConfigInt maxTotalSchematicSize = i(256, 16, "maxSchematics", Comments.kb, Comments.maxSize);

Reproduction Steps

Not required. See code snippet above.

Expected Result

The two configs should have different names.

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Windows 11

Mod Version

0.5.1f

Minecraft Version

1.20.1

Forge Version

47.1.47

Other Mods

No response

Additional Context

No response

commented

Total size = how big each schematic can be and maxSchematics sets the max amount the server will save per player so I can have 10 256kb schematics before they get overridden by my 11th schematic deleting the oldest schematic I have uploaded - Non issue, working as intended

Edit: misread, issue was that 2 configs were being set to the same key config a and config b both were being set to the key "a"

commented

That's what you think is happening, but as I've mentioned on discord, the two configs are set to the same key incorrectly, so you cannot change their values independently. What actually happens is that maxSchematics sets the default value to 10, but that value gets overwritten by maxTotalSchematicSize to become 256. This value is then loaded by both configs, causing the true default to be 256 schematics of size 256kb per player.

image
See the highlighted strings above