Project MMO

Project MMO

10M Downloads

Mob Scaling Settings Config Generation

SomewhatDamaged opened this issue ยท 3 comments

commented

Describe the bug
When pmmo-server.toml is created, the settings for mob scaling ratios is set up badly.

This code:

https://github.com/Caltinor/Project-MMO-2.0/blob/main/src/main/java/harmonised/pmmo/config/Config.java#L501-#L506

Produces the following:

	[Mob_Scaling.Scaling_Settings]

		[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"]

			[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic"]

				[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic".max_health]
					combat = 0.01

				[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic".attack_damage]
					combat = 0.001

				[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic".movement_speed]
					combat = 1.0E-5

Note the ."minecraft:generic" in the 3rd key down and the ."minecraft:generic".attack_damage and the like in the deeper keys.

Expected behavior
It should produce this, I believe:

	[Mob_Scaling.Scaling_Settings]

		[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"]

			[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic.max_health"]
				combat = 0.01

			[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic.attack_damage"]
				combat = 0.001

			[Mob_Scaling.Scaling_Settings."Mob Scaling IDs and Ratios"."minecraft:generic.movement_speed"]
				combat = 1.0E-5

To Reproduce
Steps to reproduce the behavior:

  1. Try to edit any of the default values, even to 0.0
  2. They do nothing because it isn't reading them
  3. Cry in a corner as a warp-zombie pwns you

Versions:
All rework version

Additional context
Pattern analysis.

commented

This is unfortunately an issue with TOML. Because MC uses a period within the ID path, these specific strings get parsed by TOML into separate period-delimited elements. The only fix is to ensure you have your quotations in the correct place.

commented

Perhaps add a description of that to the comment before them?

commented

Done.