mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-17 10:03:15 +00:00
Some fixes to biome config
This commit is contained in:
parent
70c448dd0d
commit
4c2ce65cdc
@ -28,7 +28,7 @@ public class SpawnEntryConfig implements ObjectTemplate<SpawnEntryConfig> {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public SpawnerData getSpawnerData() {
|
||||
public SpawnerData getSpawnEntry() {
|
||||
return new SpawnerData(type, minGroupSize, maxGroupSize);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user