mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-20 15:51:11 +00:00
Started migration to 1.21.11
This commit is contained in:
@@ -32,7 +32,7 @@ object Versions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object Fabric {
|
object Fabric {
|
||||||
const val fabricAPI = "0.134.1+${Mod.minecraft}"
|
const val fabricAPI = "0.139.4+${Mod.minecraft}"
|
||||||
const val cloud = "2.0.0-beta.13"
|
const val cloud = "2.0.0-beta.13"
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@@ -45,11 +45,11 @@ object Versions {
|
|||||||
const val mixin = "0.16.4+mixin.0.8.7"
|
const val mixin = "0.16.4+mixin.0.8.7"
|
||||||
const val mixinExtras = "0.5.0"
|
const val mixinExtras = "0.5.0"
|
||||||
|
|
||||||
const val minecraft = "1.21.10"
|
const val minecraft = "1.21.11"
|
||||||
const val yarn = "$minecraft+build.1"
|
const val yarn = "$minecraft+build.1"
|
||||||
const val fabricLoader = "0.17.2"
|
const val fabricLoader = "0.18.2"
|
||||||
|
|
||||||
const val architecuryLoom = "1.11.451"
|
const val architecturyLoom = "1.13.467"
|
||||||
const val architecturyPlugin = "3.4.162"
|
const val architecturyPlugin = "3.4.162"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -60,9 +60,9 @@ object Versions {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
object Bukkit {
|
object Bukkit {
|
||||||
const val minecraft = "1.21.10"
|
const val minecraft = "1.21.11-rc3"
|
||||||
const val nms = "$minecraft-R0.1"
|
const val nms = "$minecraft-R0.1"
|
||||||
const val paperBuild = "$nms-20251012.013929-7"
|
const val paperBuild = "$nms-20251208.200020-2"
|
||||||
const val paper = paperBuild
|
const val paper = paperBuild
|
||||||
const val paperLib = "1.0.8"
|
const val paperLib = "1.0.8"
|
||||||
const val reflectionRemapper = "0.1.3"
|
const val reflectionRemapper = "0.1.3"
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import net.minecraft.core.HolderSet.Named;
|
|||||||
import net.minecraft.core.MappedRegistry;
|
import net.minecraft.core.MappedRegistry;
|
||||||
import net.minecraft.core.RegistrationInfo;
|
import net.minecraft.core.RegistrationInfo;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.tags.TagKey;
|
import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.world.entity.npc.VillagerType;
|
import net.minecraft.world.entity.npc.villager.VillagerType;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -34,7 +34,7 @@ import com.dfsek.terra.registry.master.ConfigRegistry;
|
|||||||
public class AwfulBukkitHacks {
|
public class AwfulBukkitHacks {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class);
|
||||||
|
|
||||||
private static final Map<ResourceLocation, List<ResourceLocation>> terraBiomeMap = new HashMap<>();
|
private static final Map<Identifier, List<Identifier>> terraBiomeMap = new HashMap<>();
|
||||||
|
|
||||||
public static void registerBiomes(ConfigRegistry configRegistry) {
|
public static void registerBiomes(ConfigRegistry configRegistry) {
|
||||||
try {
|
try {
|
||||||
@@ -50,7 +50,7 @@ public class AwfulBukkitHacks {
|
|||||||
BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome();
|
BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome();
|
||||||
|
|
||||||
NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey();
|
NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey();
|
||||||
ResourceLocation vanillaMinecraftKey = ResourceLocation.fromNamespaceAndPath(vanillaBukkitKey.getNamespace(),
|
Identifier vanillaMinecraftKey = Identifier.fromNamespaceAndPath(vanillaBukkitKey.getNamespace(),
|
||||||
vanillaBukkitKey.getKey());
|
vanillaBukkitKey.getKey());
|
||||||
|
|
||||||
VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class);
|
VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class);
|
||||||
@@ -58,7 +58,7 @@ public class AwfulBukkitHacks {
|
|||||||
Biome platform = NMSBiomeInjector.createBiome(biomeRegistry.get(vanillaMinecraftKey).orElseThrow().value(),
|
Biome platform = NMSBiomeInjector.createBiome(biomeRegistry.get(vanillaMinecraftKey).orElseThrow().value(),
|
||||||
vanillaBiomeProperties);
|
vanillaBiomeProperties);
|
||||||
|
|
||||||
ResourceLocation delegateMinecraftKey = ResourceLocation.fromNamespaceAndPath("terra",
|
Identifier delegateMinecraftKey = Identifier.fromNamespaceAndPath("terra",
|
||||||
NMSBiomeInjector.createBiomeID(pack, key));
|
NMSBiomeInjector.createBiomeID(pack, key));
|
||||||
NamespacedKey delegateBukkitKey = NamespacedKey.fromString(delegateMinecraftKey.toString());
|
NamespacedKey delegateBukkitKey = NamespacedKey.fromString(delegateMinecraftKey.toString());
|
||||||
ResourceKey<Biome> delegateKey = ResourceKey.create(Registries.BIOME, delegateMinecraftKey);
|
ResourceKey<Biome> delegateKey = ResourceKey.create(Registries.BIOME, delegateMinecraftKey);
|
||||||
@@ -75,7 +75,7 @@ public class AwfulBukkitHacks {
|
|||||||
Objects.requireNonNullElse(vanillaBiomeProperties.getVillagerType(),
|
Objects.requireNonNullElse(vanillaBiomeProperties.getVillagerType(),
|
||||||
villagerMap.getOrDefault(delegateKey, VillagerType.PLAINS)));
|
villagerMap.getOrDefault(delegateKey, VillagerType.PLAINS)));
|
||||||
|
|
||||||
terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location());
|
terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.identifier());
|
||||||
|
|
||||||
LOGGER.debug("Registered biome: " + delegateKey);
|
LOGGER.debug("Registered biome: " + delegateKey);
|
||||||
} catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
|
} catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
|
||||||
@@ -100,8 +100,8 @@ public class AwfulBukkitHacks {
|
|||||||
tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb).ifPresentOrElse(
|
tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb).ifPresentOrElse(
|
||||||
terra -> {
|
terra -> {
|
||||||
LOGGER.debug("{} (vanilla for {}): {}",
|
LOGGER.debug("{} (vanilla for {}): {}",
|
||||||
vanilla.unwrapKey().orElseThrow().location(),
|
vanilla.unwrapKey().orElseThrow().identifier(),
|
||||||
terra.unwrapKey().orElseThrow().location(),
|
terra.unwrapKey().orElseThrow().identifier(),
|
||||||
vanilla.tags().toList());
|
vanilla.tags().toList());
|
||||||
vanilla.tags()
|
vanilla.tags()
|
||||||
.forEach(tag -> collect
|
.forEach(tag -> collect
|
||||||
|
|||||||
+42
-37
@@ -2,7 +2,8 @@ package com.dfsek.terra.bukkit.nms;
|
|||||||
|
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.world.attribute.EnvironmentAttributes;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.biome.BiomeGenerationSettings;
|
import net.minecraft.world.level.biome.BiomeGenerationSettings;
|
||||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||||
@@ -17,7 +18,7 @@ import com.dfsek.terra.bukkit.nms.config.VanillaBiomeProperties;
|
|||||||
|
|
||||||
public class NMSBiomeInjector {
|
public class NMSBiomeInjector {
|
||||||
|
|
||||||
public static <T> Optional<Holder<T>> getEntry(Registry<T> registry, ResourceLocation identifier) {
|
public static <T> Optional<Holder<T>> getEntry(Registry<T> registry, Identifier identifier) {
|
||||||
return registry.getOptional(identifier)
|
return registry.getOptional(identifier)
|
||||||
.flatMap(registry::getResourceKey)
|
.flatMap(registry::getResourceKey)
|
||||||
.flatMap(registry::get);
|
.flatMap(registry::get);
|
||||||
@@ -29,55 +30,59 @@ public class NMSBiomeInjector {
|
|||||||
|
|
||||||
BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder();
|
BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder();
|
||||||
|
|
||||||
effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor()))
|
// TODO: Migrate to EnvironmentAttributes
|
||||||
.waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor()))
|
// builder.setAttribute(EnvironmentAttributes.FOG_COLOR, Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getAttributes().get(EnvironmentAttributes.FOG_COLOR)))
|
||||||
.waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor()))
|
|
||||||
.skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor()))
|
// effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor()));
|
||||||
|
effects.waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor()))
|
||||||
|
// .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor()))
|
||||||
|
// .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor()))
|
||||||
.grassColorModifier(Objects.requireNonNullElse(vanillaBiomeProperties.getGrassColorModifier(),
|
.grassColorModifier(Objects.requireNonNullElse(vanillaBiomeProperties.getGrassColorModifier(),
|
||||||
vanilla.getSpecialEffects().getGrassColorModifier()))
|
vanilla.getSpecialEffects().grassColorModifier()));
|
||||||
.backgroundMusicVolume(Objects.requireNonNullElse(vanillaBiomeProperties.getMusicVolume(), vanilla.getBackgroundMusicVolume()));
|
// .backgroundMusicVolume(Objects.requireNonNullElse(vanillaBiomeProperties.getMusicVolume(), vanilla.getBackgroundMusicVolume()));
|
||||||
|
|
||||||
if(vanillaBiomeProperties.getGrassColor() == null) {
|
if(vanillaBiomeProperties.getGrassColor() == null) {
|
||||||
vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride);
|
vanilla.getSpecialEffects().grassColorOverride().ifPresent(effects::grassColorOverride);
|
||||||
} else {
|
} else {
|
||||||
effects.grassColorOverride(vanillaBiomeProperties.getGrassColor());
|
effects.grassColorOverride(vanillaBiomeProperties.getGrassColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vanillaBiomeProperties.getFoliageColor() == null) {
|
if(vanillaBiomeProperties.getFoliageColor() == null) {
|
||||||
vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride);
|
vanilla.getSpecialEffects().foliageColorOverride().ifPresent(effects::foliageColorOverride);
|
||||||
} else {
|
} else {
|
||||||
effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor());
|
effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vanillaBiomeProperties.getParticleConfig() == null) {
|
// TODO
|
||||||
vanilla.getSpecialEffects().getAmbientParticleSettings().ifPresent(effects::ambientParticle);
|
// if(vanillaBiomeProperties.getParticleConfig() == null) {
|
||||||
} else {
|
// vanilla.getSpecialEffects().getAmbientParticleSettings().ifPresent(effects::ambientParticle);
|
||||||
effects.ambientParticle(vanillaBiomeProperties.getParticleConfig());
|
// } else {
|
||||||
}
|
// effects.ambientParticle(vanillaBiomeProperties.getParticleConfig());
|
||||||
|
// }
|
||||||
|
|
||||||
if(vanillaBiomeProperties.getLoopSound() == null) {
|
// if(vanillaBiomeProperties.getLoopSound() == null) {
|
||||||
vanilla.getSpecialEffects().getAmbientLoopSoundEvent().ifPresent(effects::ambientLoopSound);
|
// vanilla.getSpecialEffects().getAmbientLoopSoundEvent().ifPresent(effects::ambientLoopSound);
|
||||||
} else {
|
// } else {
|
||||||
RegistryFetcher.soundEventRegistry().get(vanillaBiomeProperties.getLoopSound().location()).ifPresent(effects::ambientLoopSound);
|
// RegistryFetcher.soundEventRegistry().get(vanillaBiomeProperties.getLoopSound().location()).ifPresent(effects::ambientLoopSound);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(vanillaBiomeProperties.getMoodSound() == null) {
|
// if(vanillaBiomeProperties.getMoodSound() == null) {
|
||||||
vanilla.getSpecialEffects().getAmbientMoodSettings().ifPresent(effects::ambientMoodSound);
|
// vanilla.getSpecialEffects().getAmbientMoodSettings().ifPresent(effects::ambientMoodSound);
|
||||||
} else {
|
// } else {
|
||||||
effects.ambientMoodSound(vanillaBiomeProperties.getMoodSound());
|
// effects.ambientMoodSound(vanillaBiomeProperties.getMoodSound());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if(vanillaBiomeProperties.getAdditionsSound() == null) {
|
// if(vanillaBiomeProperties.getAdditionsSound() == null) {
|
||||||
vanilla.getSpecialEffects().getAmbientAdditionsSettings().ifPresent(effects::ambientAdditionsSound);
|
// vanilla.getSpecialEffects().getAmbientAdditionsSettings().ifPresent(effects::ambientAdditionsSound);
|
||||||
} else {
|
// } else {
|
||||||
effects.ambientAdditionsSound(vanillaBiomeProperties.getAdditionsSound());
|
// effects.ambientAdditionsSound(vanillaBiomeProperties.getAdditionsSound());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if(vanillaBiomeProperties.getMusic() == null) {
|
// if(vanillaBiomeProperties.getMusic() == null) {
|
||||||
vanilla.getSpecialEffects().getBackgroundMusic().ifPresent(effects::backgroundMusic);
|
// vanilla.getSpecialEffects().getBackgroundMusic().ifPresent(effects::backgroundMusic);
|
||||||
} else {
|
// } else {
|
||||||
effects.backgroundMusic(vanillaBiomeProperties.getMusic());
|
// effects.backgroundMusic(vanillaBiomeProperties.getMusic());
|
||||||
}
|
// }
|
||||||
|
|
||||||
builder.hasPrecipitation(Objects.requireNonNullElse(vanillaBiomeProperties.getPrecipitation(), vanilla.hasPrecipitation()));
|
builder.hasPrecipitation(Objects.requireNonNullElse(vanillaBiomeProperties.getPrecipitation(), vanilla.hasPrecipitation()));
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ package com.dfsek.terra.bukkit.nms;
|
|||||||
|
|
||||||
import com.dfsek.tectonic.api.TypeRegistry;
|
import com.dfsek.tectonic.api.TypeRegistry;
|
||||||
import com.dfsek.tectonic.api.exception.LoadException;
|
import com.dfsek.tectonic.api.exception.LoadException;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.sounds.Music;
|
import net.minecraft.sounds.Music;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.world.attribute.AmbientParticle;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.MobCategory;
|
import net.minecraft.world.entity.MobCategory;
|
||||||
import net.minecraft.world.entity.npc.VillagerType;
|
import net.minecraft.world.attribute.AmbientAdditionsSettings;
|
||||||
import net.minecraft.world.level.biome.AmbientAdditionsSettings;
|
import net.minecraft.world.attribute.AmbientMoodSettings;
|
||||||
import net.minecraft.world.level.biome.AmbientMoodSettings;
|
import net.minecraft.world.entity.npc.villager.VillagerType;
|
||||||
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
|
||||||
import net.minecraft.world.level.biome.Biome.Precipitation;
|
import net.minecraft.world.level.biome.Biome.Precipitation;
|
||||||
import net.minecraft.world.level.biome.Biome.TemperatureModifier;
|
import net.minecraft.world.level.biome.Biome.TemperatureModifier;
|
||||||
import net.minecraft.world.level.biome.BiomeSpecialEffects.GrassColorModifier;
|
import net.minecraft.world.level.biome.BiomeSpecialEffects.GrassColorModifier;
|
||||||
@@ -52,8 +52,8 @@ public class NMSPlatform extends PlatformImpl {
|
|||||||
public void register(TypeRegistry registry) {
|
public void register(TypeRegistry registry) {
|
||||||
super.register(registry);
|
super.register(registry);
|
||||||
registry.registerLoader(PlatformBiome.class, (type, o, loader, depthTracker) -> parseBiome((String) o, depthTracker))
|
registry.registerLoader(PlatformBiome.class, (type, o, loader, depthTracker) -> parseBiome((String) o, depthTracker))
|
||||||
.registerLoader(ResourceLocation.class, (type, o, loader, depthTracker) -> {
|
.registerLoader(Identifier.class, (type, o, loader, depthTracker) -> {
|
||||||
ResourceLocation identifier = ResourceLocation.tryParse((String) o);
|
Identifier identifier = Identifier.tryParse((String) o);
|
||||||
if(identifier == null)
|
if(identifier == null)
|
||||||
throw new LoadException("Invalid identifier: " + o, depthTracker);
|
throw new LoadException("Invalid identifier: " + o, depthTracker);
|
||||||
return identifier;
|
return identifier;
|
||||||
@@ -67,7 +67,7 @@ public class NMSPlatform extends PlatformImpl {
|
|||||||
(type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase(
|
(type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase(
|
||||||
Locale.ROOT)))
|
Locale.ROOT)))
|
||||||
.registerLoader(MobCategory.class, (type, o, loader, depthTracker) -> MobCategory.valueOf((String) o))
|
.registerLoader(MobCategory.class, (type, o, loader, depthTracker) -> MobCategory.valueOf((String) o))
|
||||||
.registerLoader(AmbientParticleSettings.class, BiomeParticleConfigTemplate::new)
|
.registerLoader(AmbientParticle.class, BiomeParticleConfigTemplate::new)
|
||||||
.registerLoader(SoundEvent.class, SoundEventTemplate::new)
|
.registerLoader(SoundEvent.class, SoundEventTemplate::new)
|
||||||
.registerLoader(AmbientMoodSettings.class, BiomeMoodSoundTemplate::new)
|
.registerLoader(AmbientMoodSettings.class, BiomeMoodSoundTemplate::new)
|
||||||
.registerLoader(AmbientAdditionsSettings.class, BiomeAdditionsSoundTemplate::new)
|
.registerLoader(AmbientAdditionsSettings.class, BiomeAdditionsSoundTemplate::new)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import net.minecraft.core.MappedRegistry;
|
|||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.server.level.ChunkMap;
|
import net.minecraft.server.level.ChunkMap;
|
||||||
import net.minecraft.tags.TagKey;
|
import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.world.entity.npc.VillagerType;
|
import net.minecraft.world.entity.npc.villager.VillagerType;
|
||||||
import net.minecraft.world.level.LevelAccessor;
|
import net.minecraft.world.level.LevelAccessor;
|
||||||
import net.minecraft.world.level.StructureManager;
|
import net.minecraft.world.level.StructureManager;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ 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 net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.world.level.biome.AmbientAdditionsSettings;
|
import net.minecraft.world.attribute.AmbientAdditionsSettings;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeAdditionsSoundTemplate implements ObjectTemplate<AmbientAdditionsSettings> {
|
public class BiomeAdditionsSoundTemplate implements ObjectTemplate<AmbientAdditionsSettings> {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ 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 net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.world.level.biome.AmbientMoodSettings;
|
import net.minecraft.world.attribute.AmbientMoodSettings;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeMoodSoundTemplate implements ObjectTemplate<AmbientMoodSettings> {
|
public class BiomeMoodSoundTemplate implements ObjectTemplate<AmbientMoodSettings> {
|
||||||
|
|||||||
+4
-4
@@ -8,12 +8,12 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import net.minecraft.commands.arguments.ParticleArgument;
|
import net.minecraft.commands.arguments.ParticleArgument;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
import net.minecraft.world.attribute.AmbientParticle;
|
||||||
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientParticleSettings> {
|
public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientParticle> {
|
||||||
@Value("particle")
|
@Value("particle")
|
||||||
@Default
|
@Default
|
||||||
private String particle = null;
|
private String particle = null;
|
||||||
@@ -23,13 +23,13 @@ public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientPartic
|
|||||||
private Float probability = 0.1f;
|
private Float probability = 0.1f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AmbientParticleSettings get() {
|
public AmbientParticle get() {
|
||||||
if(particle == null) {
|
if(particle == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new AmbientParticleSettings(ParticleArgument.readParticle(new StringReader(particle),
|
return new AmbientParticle(ParticleArgument.readParticle(new StringReader(particle),
|
||||||
HolderLookup.Provider.create(Stream.of(BuiltInRegistries.PARTICLE_TYPE))), probability);
|
HolderLookup.Provider.create(Stream.of(BuiltInRegistries.PARTICLE_TYPE))), probability);
|
||||||
} catch(CommandSyntaxException e) {
|
} catch(CommandSyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
+2
-2
@@ -4,14 +4,14 @@ 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 net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
|
||||||
|
|
||||||
public class EntityTypeTemplate implements ObjectTemplate<EntityType<?>> {
|
public class EntityTypeTemplate implements ObjectTemplate<EntityType<?>> {
|
||||||
@Value("id")
|
@Value("id")
|
||||||
@Default
|
@Default
|
||||||
private ResourceLocation id = null;
|
private Identifier id = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityType<?> get() {
|
public EntityType<?> get() {
|
||||||
|
|||||||
+2
-2
@@ -3,14 +3,14 @@ package com.dfsek.terra.bukkit.nms.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 net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
|
||||||
|
|
||||||
public class SoundEventTemplate implements ObjectTemplate<SoundEvent> {
|
public class SoundEventTemplate implements ObjectTemplate<SoundEvent> {
|
||||||
@Value("id")
|
@Value("id")
|
||||||
@Default
|
@Default
|
||||||
private ResourceLocation id = null;
|
private Identifier id = null;
|
||||||
|
|
||||||
@Value("distance-to-travel")
|
@Value("distance-to-travel")
|
||||||
@Default
|
@Default
|
||||||
|
|||||||
+6
-6
@@ -6,10 +6,10 @@ import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.sounds.Music;
|
import net.minecraft.sounds.Music;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.world.entity.npc.VillagerType;
|
import net.minecraft.world.entity.npc.villager.VillagerType;
|
||||||
import net.minecraft.world.level.biome.AmbientAdditionsSettings;
|
import net.minecraft.world.attribute.AmbientAdditionsSettings;
|
||||||
import net.minecraft.world.level.biome.AmbientMoodSettings;
|
import net.minecraft.world.attribute.AmbientMoodSettings;
|
||||||
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
import net.minecraft.world.attribute.AmbientParticle;
|
||||||
import net.minecraft.world.level.biome.Biome.TemperatureModifier;
|
import net.minecraft.world.level.biome.Biome.TemperatureModifier;
|
||||||
import net.minecraft.world.level.biome.BiomeSpecialEffects.GrassColorModifier;
|
import net.minecraft.world.level.biome.BiomeSpecialEffects.GrassColorModifier;
|
||||||
import net.minecraft.world.level.biome.MobSpawnSettings;
|
import net.minecraft.world.level.biome.MobSpawnSettings;
|
||||||
@@ -52,7 +52,7 @@ public class VanillaBiomeProperties implements ConfigTemplate, Properties {
|
|||||||
|
|
||||||
@Value("particles")
|
@Value("particles")
|
||||||
@Default
|
@Default
|
||||||
private AmbientParticleSettings particleConfig = null;
|
private AmbientParticle particleConfig = null;
|
||||||
|
|
||||||
@Value("climate.precipitation")
|
@Value("climate.precipitation")
|
||||||
@Default
|
@Default
|
||||||
@@ -130,7 +130,7 @@ public class VanillaBiomeProperties implements ConfigTemplate, Properties {
|
|||||||
return grassColorModifier;
|
return grassColorModifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AmbientParticleSettings getParticleConfig() {
|
public AmbientParticle getParticleConfig() {
|
||||||
return particleConfig;
|
return particleConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -5,14 +5,14 @@ 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 net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.entity.npc.VillagerType;
|
import net.minecraft.world.entity.npc.villager.VillagerType;
|
||||||
|
|
||||||
|
|
||||||
public class VillagerTypeTemplate implements ObjectTemplate<ResourceKey<VillagerType>> {
|
public class VillagerTypeTemplate implements ObjectTemplate<ResourceKey<VillagerType>> {
|
||||||
@Value("id")
|
@Value("id")
|
||||||
@Default
|
@Default
|
||||||
private ResourceLocation id = null;
|
private Identifier id = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceKey<VillagerType> get() {
|
public ResourceKey<VillagerType> get() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("dev.architectury.loom") version Versions.Mod.architecuryLoom
|
id("dev.architectury.loom") version Versions.Mod.architecturyLoom
|
||||||
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("dev.architectury.loom") version Versions.Mod.architecuryLoom
|
id("dev.architectury.loom") version Versions.Mod.architecturyLoom
|
||||||
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
compileOnly("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
||||||
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.architecturyLoom}")
|
||||||
|
|
||||||
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
||||||
mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2")
|
mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("dev.architectury.loom") version Versions.Mod.architecuryLoom
|
id("dev.architectury.loom") version Versions.Mod.architecturyLoom
|
||||||
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
id("architectury-plugin") version Versions.Mod.architecturyPlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compileOnly("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
compileOnly("net.fabricmc:sponge-mixin:${Versions.Mod.mixin}")
|
||||||
compileOnly("io.github.llamalad7:mixinextras-common:${Versions.Mod.mixinExtras}")
|
compileOnly("io.github.llamalad7:mixinextras-common:${Versions.Mod.mixinExtras}")
|
||||||
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.architecturyLoom}")
|
||||||
|
|
||||||
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user