Requested changes

This commit is contained in:
Zoë
2022-07-14 19:43:50 -07:00
parent f75880acac
commit 4b518c28a0
15 changed files with 57 additions and 59 deletions
@@ -3,6 +3,9 @@ package com.dfsek.terra.mod.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
import com.dfsek.terra.api.util.Range;
import net.minecraft.sound.MusicSound;
import net.minecraft.sound.SoundEvent;
@@ -12,13 +15,9 @@ public class MusicSoundTemplate implements ObjectTemplate<MusicSound> {
@Default
private SoundEvent sound = null;
@Value("min-delay")
@Value("delay")
@Default
private Integer minDelay = null;
@Value("max-delay")
@Default
private Integer maxDelay = null;
private Range delay = null;
@Value("replace-current-music")
@Default
@@ -26,10 +25,10 @@ public class MusicSoundTemplate implements ObjectTemplate<MusicSound> {
@Override
public MusicSound get() {
if(sound == null || minDelay == null || maxDelay == null || replaceCurrentMusic == null) {
if(sound == null || delay == null || replaceCurrentMusic == null) {
return null;
} else {
return new MusicSound(sound, minDelay, maxDelay, replaceCurrentMusic);
return new MusicSound(sound, delay.getMin(), delay.getMax(), replaceCurrentMusic);
}
}
}
@@ -3,6 +3,9 @@ package com.dfsek.terra.mod.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
import com.dfsek.terra.api.util.Range;
import net.minecraft.entity.EntityType;
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
@@ -16,16 +19,12 @@ public class SpawnEntryTemplate implements ObjectTemplate<SpawnEntry> {
@Default
private Integer weight = null;
@Value("min-group-size")
@Value("group-size")
@Default
private Integer minGroupSize = null;
@Value("max-group-size")
@Default
private Integer maxGroupSize = null;
private Range groupSize = null;
@Override
public SpawnEntry get() {
return new SpawnEntry(type, weight, minGroupSize, maxGroupSize);
return new SpawnEntry(type, weight, groupSize.getMin(), groupSize.getMax());
}
}
@@ -45,7 +45,7 @@ public class TerraBiomeSource extends BiomeSource {
.stream(pack.getBiomeProvider()
.getBiomes()
.spliterator(), false)
.map(b -> biomes.getOrCreateEntry(((ProtoPlatformBiome) b.getPlatformBiome()).getBiome())));
.map(b -> biomes.getOrCreateEntry(((ProtoPlatformBiome) b.getPlatformBiome().get()).getBiome())));
this.biomeRegistry = biomes;
this.pack = pack;
@@ -63,7 +63,7 @@ public class TerraBiomeSource extends BiomeSource {
.entryOf(((ProtoPlatformBiome) pack
.getBiomeProvider()
.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2, SeedHack.getSeed(noiseSampler))
.getPlatformBiome()).getBiome()
.getPlatformBiome().get()).getBiome()
);
}