Some fixes to biome config

This commit is contained in:
Zoë Gidiere 2025-07-09 16:41:53 -06:00
parent 70c448dd0d
commit 4c2ce65cdc
7 changed files with 17 additions and 13 deletions

View File

@ -28,7 +28,7 @@ public class SpawnEntryConfig implements ObjectTemplate<SpawnEntryConfig> {
return weight;
}
public SpawnerData getSpawnerData() {
public SpawnerData getSpawnEntry() {
return new SpawnerData(type, minGroupSize, maxGroupSize);
}

View File

@ -33,7 +33,7 @@ public class SpawnSettingsTemplate implements ObjectTemplate<MobSpawnSettings> {
for(SpawnTypeConfig spawn : spawns) {
MobCategory group = spawn.getGroup();
for(SpawnEntryConfig entry : spawn.getEntries()) {
builder.addSpawn(group, entry.getWeight(), entry.getSpawnerData());
builder.addSpawn(group, entry.getWeight(), entry.getSpawnEntry());
}
}
for(SpawnCostConfig cost : costs) {

View File

@ -90,7 +90,7 @@ public abstract class ModPlatform extends AbstractPlatform {
.registerLoader(MusicSound.class, MusicSoundTemplate::new)
.registerLoader(EntityType.class, EntityTypeTemplate::new)
.registerLoader(SpawnCostConfig.class, SpawnCostConfig::new)
.registerLoader(SpawnEntry.class, SpawnEntryConfig::new)
.registerLoader(SpawnEntryConfig.class, SpawnEntryConfig::new)
.registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new)
.registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new)
.registerLoader(VillagerType.class, VillagerTypeTemplate::new);

View File

@ -7,7 +7,7 @@ import net.minecraft.entity.EntityType;
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
public class SpawnEntryConfig implements ObjectTemplate<SpawnEntry> {
public class SpawnEntryConfig implements ObjectTemplate<SpawnEntryConfig> {
@Value("type")
@Default
private EntityType<?> type = null;
@ -28,8 +28,12 @@ public class SpawnEntryConfig implements ObjectTemplate<SpawnEntry> {
return weight;
}
@Override
public SpawnEntry get() {
public SpawnEntry getSpawnEntry() {
return new SpawnEntry(type, minGroupSize, maxGroupSize);
}
@Override
public SpawnEntryConfig get() {
return this;
}
}

View File

@ -27,8 +27,8 @@ public class SpawnSettingsTemplate implements ObjectTemplate<SpawnSettings> {
SpawnSettings.Builder builder = new SpawnSettings.Builder();
for(SpawnTypeConfig spawn : spawns) {
SpawnGroup group = spawn.getGroup();
for(SpawnEntryConfig entry : spawn.getEntry()) {
builder.spawn(group, entry.getWeight(), entry.get());
for(SpawnEntryConfig entry : spawn.getEntries()) {
builder.spawn(group, entry.getWeight(), entry.getSpawnEntry());
}
}
for(SpawnCostConfig cost : costs) {

View File

@ -15,14 +15,14 @@ public class SpawnTypeConfig implements ObjectTemplate<SpawnTypeConfig> {
@Value("entries")
@Default
private List<SpawnEntryConfig> entry = null;
private List<SpawnEntryConfig> entries = null;
public SpawnGroup getGroup() {
return group;
}
public List<SpawnEntryConfig> getEntry() {
return entry;
public List<SpawnEntryConfig> getEntries() {
return entries;
}
@Override

View File

@ -13,10 +13,10 @@ import net.minecraft.village.VillagerType;
public class VillagerTypeTemplate implements ObjectTemplate<RegistryKey<VillagerType>> {
@Value("id")
@Default
private String id = null;
private Identifier id = null;
@Override
public RegistryKey<VillagerType> get() {
return RegistryKey.of(RegistryKeys.VILLAGER_TYPE, Identifier.ofVanilla(id));
return RegistryKey.of(RegistryKeys.VILLAGER_TYPE, id);
}
}