Fix logically breaking change to ForgeConfigSpec.Builder#comment where modders could not add a empty line to the start of comments. (#9061)

This commit is contained in:
Paint_Ninja authored and GitHub committed 2022-10-03 11:50:32 -07:00
1 parent 6f8ba9d295
commit e1017a4c7e
6 files changed
+73 -25

No files matched your search

@@ -63,6 +63,22 @@ public class ForgeConfigSpecTest
executeSpeedTest("test.test.test.test.test.test.test.test.test.test", "deepKeyValue", "deepKeySpeedTest");
}
@Test(expected = IllegalStateException.class)
public void allEmptyCommentTest() throws IllegalStateException
{
final ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder();
final ForgeConfigSpec.ConfigValue<String> simpleValue = builder.comment("", "").define("allEmptyCommentTest", "someDefaultValue");
final ForgeConfigSpec spec = builder.build();
}
@Test
public void topPaddedCommentTest()
{
final ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder();
final ForgeConfigSpec.ConfigValue<String> simpleValue = builder.comment("", "Test").define("topPaddedCommentTest", "someDefaultValue");
final ForgeConfigSpec spec = builder.build();
}
private <T> void executeSpeedTest(final String configKey, final T defaultKeyValue, final String testName) throws IOException
{
final ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder();
@@ -1,3 +1,8 @@
/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.debug.block;
import net.minecraft.core.BlockPos;
@@ -1,3 +1,8 @@
/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.debug.entity.living;
import net.minecraft.world.entity.monster.piglin.AbstractPiglin;
@@ -1,3 +1,8 @@
/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.debug.world;
import net.minecraft.data.worldgen.features.TreeFeatures;