mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-19 11:02:33 +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;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpawnerData getSpawnerData() {
|
public SpawnerData getSpawnEntry() {
|
||||||
return new SpawnerData(type, minGroupSize, maxGroupSize);
|
return new SpawnerData(type, minGroupSize, maxGroupSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class SpawnSettingsTemplate implements ObjectTemplate<MobSpawnSettings> {
|
|||||||
for(SpawnTypeConfig spawn : spawns) {
|
for(SpawnTypeConfig spawn : spawns) {
|
||||||
MobCategory group = spawn.getGroup();
|
MobCategory group = spawn.getGroup();
|
||||||
for(SpawnEntryConfig entry : spawn.getEntries()) {
|
for(SpawnEntryConfig entry : spawn.getEntries()) {
|
||||||
builder.addSpawn(group, entry.getWeight(), entry.getSpawnerData());
|
builder.addSpawn(group, entry.getWeight(), entry.getSpawnEntry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(SpawnCostConfig cost : costs) {
|
for(SpawnCostConfig cost : costs) {
|
||||||
|
@ -90,7 +90,7 @@ public abstract class ModPlatform extends AbstractPlatform {
|
|||||||
.registerLoader(MusicSound.class, MusicSoundTemplate::new)
|
.registerLoader(MusicSound.class, MusicSoundTemplate::new)
|
||||||
.registerLoader(EntityType.class, EntityTypeTemplate::new)
|
.registerLoader(EntityType.class, EntityTypeTemplate::new)
|
||||||
.registerLoader(SpawnCostConfig.class, SpawnCostConfig::new)
|
.registerLoader(SpawnCostConfig.class, SpawnCostConfig::new)
|
||||||
.registerLoader(SpawnEntry.class, SpawnEntryConfig::new)
|
.registerLoader(SpawnEntryConfig.class, SpawnEntryConfig::new)
|
||||||
.registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new)
|
.registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new)
|
||||||
.registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new)
|
.registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new)
|
||||||
.registerLoader(VillagerType.class, VillagerTypeTemplate::new);
|
.registerLoader(VillagerType.class, VillagerTypeTemplate::new);
|
||||||
|
@ -7,7 +7,7 @@ import net.minecraft.entity.EntityType;
|
|||||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||||
|
|
||||||
|
|
||||||
public class SpawnEntryConfig implements ObjectTemplate<SpawnEntry> {
|
public class SpawnEntryConfig implements ObjectTemplate<SpawnEntryConfig> {
|
||||||
@Value("type")
|
@Value("type")
|
||||||
@Default
|
@Default
|
||||||
private EntityType<?> type = null;
|
private EntityType<?> type = null;
|
||||||
@ -28,8 +28,12 @@ public class SpawnEntryConfig implements ObjectTemplate<SpawnEntry> {
|
|||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public SpawnEntry getSpawnEntry() {
|
||||||
public SpawnEntry get() {
|
|
||||||
return new SpawnEntry(type, minGroupSize, maxGroupSize);
|
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();
|
SpawnSettings.Builder builder = new SpawnSettings.Builder();
|
||||||
for(SpawnTypeConfig spawn : spawns) {
|
for(SpawnTypeConfig spawn : spawns) {
|
||||||
SpawnGroup group = spawn.getGroup();
|
SpawnGroup group = spawn.getGroup();
|
||||||
for(SpawnEntryConfig entry : spawn.getEntry()) {
|
for(SpawnEntryConfig entry : spawn.getEntries()) {
|
||||||
builder.spawn(group, entry.getWeight(), entry.get());
|
builder.spawn(group, entry.getWeight(), entry.getSpawnEntry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(SpawnCostConfig cost : costs) {
|
for(SpawnCostConfig cost : costs) {
|
||||||
|
@ -15,14 +15,14 @@ public class SpawnTypeConfig implements ObjectTemplate<SpawnTypeConfig> {
|
|||||||
|
|
||||||
@Value("entries")
|
@Value("entries")
|
||||||
@Default
|
@Default
|
||||||
private List<SpawnEntryConfig> entry = null;
|
private List<SpawnEntryConfig> entries = null;
|
||||||
|
|
||||||
public SpawnGroup getGroup() {
|
public SpawnGroup getGroup() {
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SpawnEntryConfig> getEntry() {
|
public List<SpawnEntryConfig> getEntries() {
|
||||||
return entry;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,10 +13,10 @@ import net.minecraft.village.VillagerType;
|
|||||||
public class VillagerTypeTemplate implements ObjectTemplate<RegistryKey<VillagerType>> {
|
public class VillagerTypeTemplate implements ObjectTemplate<RegistryKey<VillagerType>> {
|
||||||
@Value("id")
|
@Value("id")
|
||||||
@Default
|
@Default
|
||||||
private String id = null;
|
private Identifier id = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RegistryKey<VillagerType> get() {
|
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