mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
Requested changes
This commit is contained in:
@@ -34,8 +34,6 @@ object Versions {
|
|||||||
const val yarn = "$minecraft+build.1"
|
const val yarn = "$minecraft+build.1"
|
||||||
const val fabricLoader = "0.14.2"
|
const val fabricLoader = "0.14.2"
|
||||||
|
|
||||||
const val minecraftGudAsm = "v0.3.1"
|
|
||||||
|
|
||||||
const val architecuryLoom = "0.12.0.290"
|
const val architecuryLoom = "0.12.0.290"
|
||||||
const val architecturyPlugin = "3.4-SNAPSHOT"
|
const val architecturyPlugin = "3.4-SNAPSHOT"
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -9,6 +9,7 @@ package com.dfsek.terra.addons.biome;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.dfsek.terra.api.properties.Context;
|
import com.dfsek.terra.api.properties.Context;
|
||||||
@@ -44,8 +45,8 @@ public class UserDefinedBiome implements Biome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable PlatformBiome getPlatformBiome() {
|
public Optional<PlatformBiome> getPlatformBiome() {
|
||||||
return platformBiome;
|
return Optional.ofNullable(platformBiome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package com.dfsek.terra.api.world.biome;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.dfsek.terra.api.properties.PropertyHolder;
|
import com.dfsek.terra.api.properties.PropertyHolder;
|
||||||
@@ -26,7 +27,7 @@ public interface Biome extends PropertyHolder, StringIdentifiable {
|
|||||||
*
|
*
|
||||||
* @return The platform biome.
|
* @return The platform biome.
|
||||||
*/
|
*/
|
||||||
@Nullable PlatformBiome getPlatformBiome();
|
Optional<PlatformBiome> getPlatformBiome();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color of this biome.
|
* Get the color of this biome.
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.bukkit.generator;
|
package com.dfsek.terra.bukkit.generator;
|
||||||
|
|
||||||
|
import com.dfsek.terra.bukkit.world.BukkitPlatformBiome;
|
||||||
|
|
||||||
import org.bukkit.generator.BiomeProvider;
|
import org.bukkit.generator.BiomeProvider;
|
||||||
import org.bukkit.generator.WorldInfo;
|
import org.bukkit.generator.WorldInfo;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -20,13 +22,13 @@ public class BukkitBiomeProvider extends BiomeProvider implements Handle {
|
|||||||
@Override
|
@Override
|
||||||
public @NotNull org.bukkit.block.Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) {
|
public @NotNull org.bukkit.block.Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) {
|
||||||
Biome biome = delegate.getBiome(x, y, z, worldInfo.getSeed());
|
Biome biome = delegate.getBiome(x, y, z, worldInfo.getSeed());
|
||||||
return (org.bukkit.block.Biome) biome.getPlatformBiome().getHandle();
|
return ((BukkitPlatformBiome)biome.getPlatformBiome().get()).getBukkitBiome();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull List<org.bukkit.block.Biome> getBiomes(@NotNull WorldInfo worldInfo) {
|
public @NotNull List<org.bukkit.block.Biome> getBiomes(@NotNull WorldInfo worldInfo) {
|
||||||
return StreamSupport.stream(delegate.getBiomes().spliterator(), false)
|
return StreamSupport.stream(delegate.getBiomes().spliterator(), false)
|
||||||
.map(terraBiome -> (org.bukkit.block.Biome) terraBiome.getPlatformBiome().getHandle())
|
.map(terraBiome -> ((BukkitPlatformBiome)terraBiome.getPlatformBiome().get()).getBukkitBiome())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package com.dfsek.terra.bukkit.world;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
||||||
|
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
|
|
||||||
|
|
||||||
|
public interface BukkitPlatformBiome extends PlatformBiome {
|
||||||
|
Biome getBukkitBiome();
|
||||||
|
}
|
||||||
-1
@@ -6,7 +6,6 @@ import com.dfsek.tectonic.api.exception.LoadException;
|
|||||||
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
import com.dfsek.terra.api.addon.BaseAddon;
|
||||||
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
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.TerraBukkitPlugin;
|
||||||
|
|
||||||
import com.dfsek.terra.bukkit.nms.v1_19_R1.config.BiomeAdditionsSoundTemplate;
|
import com.dfsek.terra.bukkit.nms.v1_19_R1.config.BiomeAdditionsSoundTemplate;
|
||||||
|
|||||||
+6
-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.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
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.Music;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
|
||||||
@@ -12,13 +14,10 @@ public class MusicSoundTemplate implements ObjectTemplate<Music> {
|
|||||||
@Default
|
@Default
|
||||||
private SoundEvent sound = null;
|
private SoundEvent sound = null;
|
||||||
|
|
||||||
@Value("min-delay")
|
@Value("delay")
|
||||||
@Default
|
@Default
|
||||||
private Integer minDelay = null;
|
private Range delay = null;
|
||||||
|
|
||||||
@Value("max-delay")
|
|
||||||
@Default
|
|
||||||
private Integer maxDelay = null;
|
|
||||||
|
|
||||||
@Value("replace-current-music")
|
@Value("replace-current-music")
|
||||||
@Default
|
@Default
|
||||||
@@ -26,10 +25,10 @@ public class MusicSoundTemplate implements ObjectTemplate<Music> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Music get() {
|
public Music get() {
|
||||||
if(sound == null || minDelay == null || maxDelay == null || replaceCurrentMusic == null) {
|
if(sound == null || delay == null || replaceCurrentMusic == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new Music(sound, minDelay, maxDelay, replaceCurrentMusic);
|
return new Music(sound, delay.getMin(), delay.getMax(), replaceCurrentMusic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -20,13 +20,17 @@ package com.dfsek.terra.bukkit.nms.v1_19_R1.config;
|
|||||||
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
import com.dfsek.terra.api.world.biome.PlatformBiome;
|
||||||
import com.dfsek.terra.bukkit.nms.v1_19_R1.util.MinecraftUtil;
|
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.core.Registry;
|
||||||
|
import net.minecraft.data.BuiltinRegistries;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
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 ResourceLocation identifier;
|
||||||
|
|
||||||
private final ResourceKey<Biome> biome;
|
private final ResourceKey<Biome> biome;
|
||||||
@@ -48,4 +52,9 @@ public class ProtoPlatformBiome implements PlatformBiome {
|
|||||||
public ResourceKey<Biome> getBiome() {
|
public ResourceKey<Biome> getBiome() {
|
||||||
return biome;
|
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.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
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.entity.EntityType;
|
||||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||||
|
|
||||||
@@ -16,16 +18,12 @@ public class SpawnEntryTemplate implements ObjectTemplate<SpawnerData> {
|
|||||||
@Default
|
@Default
|
||||||
private Integer weight = null;
|
private Integer weight = null;
|
||||||
|
|
||||||
@Value("min-group-size")
|
@Value("group-size")
|
||||||
@Default
|
@Default
|
||||||
private Integer minGroupSize = null;
|
private Range groupSize = null;
|
||||||
|
|
||||||
@Value("max-group-size")
|
|
||||||
@Default
|
|
||||||
private Integer maxGroupSize = null;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpawnerData get() {
|
public SpawnerData get() {
|
||||||
return new SpawnerData(type, weight, minGroupSize, maxGroupSize);
|
return new SpawnerData(type, weight, groupSize.getMin(), groupSize.getMax());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ dependencies {
|
|||||||
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
||||||
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
||||||
|
|
||||||
modImplementation("com.github.the-glitch-network:minecraft-gudasm:${Versions.Mod.minecraftGudAsm}")
|
|
||||||
include("com.github.the-glitch-network:minecraft-gudasm:${Versions.Mod.minecraftGudAsm}")
|
|
||||||
|
|
||||||
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
"developmentFabric"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
"developmentFabric"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
shaded(project(path = ":platforms:mixin-common", configuration = "transformProductionFabric")) { isTransitive = false }
|
shaded(project(path = ":platforms:mixin-common", configuration = "transformProductionFabric")) { isTransitive = false }
|
||||||
|
|||||||
+7
-8
@@ -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.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
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.MusicSound;
|
||||||
import net.minecraft.sound.SoundEvent;
|
import net.minecraft.sound.SoundEvent;
|
||||||
|
|
||||||
@@ -12,13 +15,9 @@ public class MusicSoundTemplate implements ObjectTemplate<MusicSound> {
|
|||||||
@Default
|
@Default
|
||||||
private SoundEvent sound = null;
|
private SoundEvent sound = null;
|
||||||
|
|
||||||
@Value("min-delay")
|
@Value("delay")
|
||||||
@Default
|
@Default
|
||||||
private Integer minDelay = null;
|
private Range delay = null;
|
||||||
|
|
||||||
@Value("max-delay")
|
|
||||||
@Default
|
|
||||||
private Integer maxDelay = null;
|
|
||||||
|
|
||||||
@Value("replace-current-music")
|
@Value("replace-current-music")
|
||||||
@Default
|
@Default
|
||||||
@@ -26,10 +25,10 @@ public class MusicSoundTemplate implements ObjectTemplate<MusicSound> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MusicSound get() {
|
public MusicSound get() {
|
||||||
if(sound == null || minDelay == null || maxDelay == null || replaceCurrentMusic == null) {
|
if(sound == null || delay == null || replaceCurrentMusic == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new MusicSound(sound, minDelay, maxDelay, replaceCurrentMusic);
|
return new MusicSound(sound, delay.getMin(), delay.getMax(), replaceCurrentMusic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-7
@@ -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.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.Range;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||||
|
|
||||||
@@ -16,16 +19,12 @@ public class SpawnEntryTemplate implements ObjectTemplate<SpawnEntry> {
|
|||||||
@Default
|
@Default
|
||||||
private Integer weight = null;
|
private Integer weight = null;
|
||||||
|
|
||||||
@Value("min-group-size")
|
@Value("group-size")
|
||||||
@Default
|
@Default
|
||||||
private Integer minGroupSize = null;
|
private Range groupSize = null;
|
||||||
|
|
||||||
@Value("max-group-size")
|
|
||||||
@Default
|
|
||||||
private Integer maxGroupSize = null;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpawnEntry get() {
|
public SpawnEntry get() {
|
||||||
return new SpawnEntry(type, weight, minGroupSize, maxGroupSize);
|
return new SpawnEntry(type, weight, groupSize.getMin(), groupSize.getMax());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -45,7 +45,7 @@ public class TerraBiomeSource extends BiomeSource {
|
|||||||
.stream(pack.getBiomeProvider()
|
.stream(pack.getBiomeProvider()
|
||||||
.getBiomes()
|
.getBiomes()
|
||||||
.spliterator(), false)
|
.spliterator(), false)
|
||||||
.map(b -> biomes.getOrCreateEntry(((ProtoPlatformBiome) b.getPlatformBiome()).getBiome())));
|
.map(b -> biomes.getOrCreateEntry(((ProtoPlatformBiome) b.getPlatformBiome().get()).getBiome())));
|
||||||
this.biomeRegistry = biomes;
|
this.biomeRegistry = biomes;
|
||||||
this.pack = pack;
|
this.pack = pack;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ public class TerraBiomeSource extends BiomeSource {
|
|||||||
.entryOf(((ProtoPlatformBiome) pack
|
.entryOf(((ProtoPlatformBiome) pack
|
||||||
.getBiomeProvider()
|
.getBiomeProvider()
|
||||||
.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2, SeedHack.getSeed(noiseSampler))
|
.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2, SeedHack.getSeed(noiseSampler))
|
||||||
.getPlatformBiome()).getBiome()
|
.getPlatformBiome().get()).getBiome()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,6 @@ dependencies {
|
|||||||
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
||||||
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
||||||
|
|
||||||
modImplementation("com.github.the-glitch-network:minecraft-gudasm:${Versions.Mod.minecraftGudAsm}") {
|
|
||||||
exclude("net.fabricmc")
|
|
||||||
exclude("net.fabricmc.fabric-api")
|
|
||||||
}
|
|
||||||
|
|
||||||
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
|
|
||||||
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
||||||
|
|||||||
@@ -15,15 +15,6 @@ dependencies {
|
|||||||
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
annotationProcessor("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
||||||
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
annotationProcessor("dev.architectury:architectury-loom:${Versions.Mod.architecuryLoom}")
|
||||||
|
|
||||||
modImplementation("com.github.the-glitch-network:minecraft-gudasm:${Versions.Mod.minecraftGudAsm}") {
|
|
||||||
exclude("net.fabricmc")
|
|
||||||
exclude("net.fabricmc.fabric-api")
|
|
||||||
}
|
|
||||||
include("com.github.the-glitch-network:minecraft-gudasm:${Versions.Mod.minecraftGudAsm}") {
|
|
||||||
exclude("net.fabricmc")
|
|
||||||
exclude("net.fabricmc.fabric-api")
|
|
||||||
}
|
|
||||||
|
|
||||||
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
"developmentQuilt"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
"developmentQuilt"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
shaded(project(path = ":platforms:mixin-common", configuration = "transformProductionQuilt")) { isTransitive = false }
|
shaded(project(path = ":platforms:mixin-common", configuration = "transformProductionQuilt")) { isTransitive = false }
|
||||||
|
|||||||
Reference in New Issue
Block a user