mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
Requested changes
This commit is contained in:
-1
@@ -6,7 +6,6 @@ import com.dfsek.tectonic.api.exception.LoadException;
|
||||
|
||||
import com.dfsek.terra.api.addon.BaseAddon;
|
||||
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
||||
import com.dfsek.terra.bukkit.BukkitAddon;
|
||||
import com.dfsek.terra.bukkit.TerraBukkitPlugin;
|
||||
|
||||
import com.dfsek.terra.bukkit.nms.v1_19_R1.config.BiomeAdditionsSoundTemplate;
|
||||
|
||||
+7
-8
@@ -3,6 +3,8 @@ package com.dfsek.terra.bukkit.nms.v1_19_R1.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.sounds.Music;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
|
||||
@@ -12,13 +14,10 @@ public class MusicSoundTemplate implements ObjectTemplate<Music> {
|
||||
@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<Music> {
|
||||
|
||||
@Override
|
||||
public Music get() {
|
||||
if(sound == null || minDelay == null || maxDelay == null || replaceCurrentMusic == null) {
|
||||
if(sound == null || delay == null || replaceCurrentMusic == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Music(sound, minDelay, maxDelay, replaceCurrentMusic);
|
||||
return new Music(sound, delay.getMin(), delay.getMax(), replaceCurrentMusic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-2
@@ -20,17 +20,21 @@ package com.dfsek.terra.bukkit.nms.v1_19_R1.config;
|
||||
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
||||
import com.dfsek.terra.bukkit.nms.v1_19_R1.util.MinecraftUtil;
|
||||
|
||||
import com.dfsek.terra.bukkit.world.BukkitPlatformBiome;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock;
|
||||
|
||||
|
||||
public class ProtoPlatformBiome implements PlatformBiome {
|
||||
public class ProtoPlatformBiome implements PlatformBiome, BukkitPlatformBiome {
|
||||
private final ResourceLocation identifier;
|
||||
|
||||
private final ResourceKey<Biome> biome;
|
||||
|
||||
|
||||
public ProtoPlatformBiome(ResourceLocation identifier, ResourceKey<Biome> biome) {
|
||||
this.identifier = identifier;
|
||||
this.biome = biome;
|
||||
@@ -48,4 +52,9 @@ public class ProtoPlatformBiome implements PlatformBiome {
|
||||
public ResourceKey<Biome> getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.block.Biome getBukkitBiome() {
|
||||
return org.bukkit.block.Biome.CUSTOM;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-7
@@ -3,6 +3,8 @@ package com.dfsek.terra.bukkit.nms.v1_19_R1.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.world.entity.EntityType;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||
|
||||
@@ -16,16 +18,12 @@ public class SpawnEntryTemplate implements ObjectTemplate<SpawnerData> {
|
||||
@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 SpawnerData get() {
|
||||
return new SpawnerData(type, weight, minGroupSize, maxGroupSize);
|
||||
return new SpawnerData(type, weight, groupSize.getMin(), groupSize.getMax());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user