Skip to content

Commit 752ca2f

Browse files
committed
handle the issues in this file too
1 parent e7d54d2 commit 752ca2f

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/main/java/com/mcmoddev/orespawn/commands/AddOreCommand.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.mcmoddev.orespawn.api.os3.OreBuilder;
99
import com.mcmoddev.orespawn.api.os3.SpawnBuilder;
1010
import com.mcmoddev.orespawn.data.ReplacementsRegistry;
11+
import com.mcmoddev.orespawn.data.Constants.ConfigNames;
1112
import com.mcmoddev.orespawn.util.StateUtil;
1213
import net.minecraft.block.state.IBlockState;
1314
import net.minecraft.command.CommandBase;
@@ -25,8 +26,6 @@
2526
import java.util.List;
2627

2728
public class AddOreCommand extends CommandBase {
28-
private static final String BLOCK = "block";
29-
private static final String STATE2 = "state";
3029
private static final String ALL = "all";
3130

3231
@Override
@@ -71,13 +70,13 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
7170
}
7271

7372
JsonObject ore = new JsonObject();
74-
ore.addProperty(BLOCK, state.getBlock().getRegistryName().toString());
75-
ore.addProperty(STATE2, StateUtil.serializeState(state));
76-
ore.addProperty("size", 25);
77-
ore.addProperty("variation", 12);
78-
ore.addProperty("frequency", 20);
79-
ore.addProperty("min_height", 0);
80-
ore.addProperty("max_height", 128);
73+
ore.addProperty(ConfigNames.BLOCK, state.getBlock().getRegistryName().toString());
74+
ore.addProperty(ConfigNames.STATE, StateUtil.serializeState(state));
75+
ore.addProperty(ConfigNames.DefaultFeatureProperties.SIZE, 25);
76+
ore.addProperty(ConfigNames.DefaultFeatureProperties.VARIATION, 12);
77+
ore.addProperty(ConfigNames.DefaultFeatureProperties.FREQUENCY, 20);
78+
ore.addProperty(ConfigNames.DefaultFeatureProperties.MINHEIGHT, 0);
79+
ore.addProperty(ConfigNames.DefaultFeatureProperties.MAXHEIGHT, 128);
8180

8281
this.putFile(file, ore, dimension);
8382

@@ -88,17 +87,17 @@ private void putFile(String file, JsonObject ore, int id) {
8887
DimensionBuilder db = OreSpawn.API.getLogic(file).newDimensionBuilder(id);
8988
SpawnBuilder sb = db.newSpawnBuilder(null);
9089
OreBuilder ob = sb.newOreBuilder();
91-
String b = ore.get(BLOCK).getAsString();
92-
ore.remove(BLOCK);
93-
String s = ore.get(STATE2).getAsString();
94-
ore.remove(STATE2);
95-
if( "normal".equals(s) ) {
90+
String b = ore.get(ConfigNames.BLOCK).getAsString();
91+
ore.remove(ConfigNames.BLOCK);
92+
String s = ore.get(ConfigNames.STATE).getAsString();
93+
ore.remove(ConfigNames.STATE);
94+
if( ConfigNames.STATE_NORMAL.equals(s) ) {
9695
ob.setOre(b);
9796
} else {
9897
ob.setOre(b, s);
9998
}
100-
FeatureBuilder fb = sb.newFeatureBuilder("default");
101-
fb.setGenerator("default").setDefaultParameters().setParameters(ore);
99+
FeatureBuilder fb = sb.newFeatureBuilder(ConfigNames.DEFAULT);
100+
fb.setGenerator(ConfigNames.DEFAULT).setDefaultParameters().setParameters(ore);
102101
BiomeBuilder bb = sb.newBiomeBuilder();
103102
IBlockState rep = ReplacementsRegistry.getDimensionDefault(id);
104103
List<IBlockState> rl = new ArrayList<>();

0 commit comments

Comments
 (0)