Compare commits

...

12 Commits

Author SHA1 Message Date
OakLoaf 4e890f96e4 Corrected wolf variant spawn reasons list 2025-08-13 20:22:25 +01:00
OakLoaf 4e70ee99c9 Adjusted log scope 2025-08-13 20:22:03 +01:00
Zoë Gidiere b149497c60 Merge pull request #521 from PolyhedralDev/deps/cloud
Updated cloud-paper to resolve warning message
2025-08-11 21:34:11 -06:00
Zoë Gidiere d9f591bdb4 Merge pull request #524 from PolyhedralDev/dev/wolves
Made wolves generated with chunks correctly inherit variants
2025-08-11 21:34:01 -06:00
Zoë Gidiere a4b74e2e7f Merge pull request #522 from PolyhedralDev/dev/1.21.8
Added 1.21.8 support
2025-08-11 21:33:51 -06:00
OakLoaf b53d475f42 Made wolves generated with chunks correctly inherit variants 2025-08-01 16:53:32 +01:00
OakLoaf 4ddb741d0d Refactored packages for 1.21.8 2025-07-19 18:23:32 +01:00
OakLoaf 852f5aa610 Bumped dependencies 2025-07-18 16:02:54 +01:00
OakLoaf 953895a8d4 Bumped dependencies 2025-07-18 16:00:58 +01:00
OakLoaf 8788eab839 Added 1.21.8 bukkit support 2025-07-17 15:13:01 +01:00
Oak 2b62473372 Update Versions.kt 2025-07-17 14:13:40 +01:00
Zoë Gidiere 9f546370cd Merge pull request #519 from PolyhedralDev/feat/nmsplatform
Fixed NMSPlatform implementation
2025-07-13 16:44:10 -06:00
28 changed files with 76 additions and 59 deletions
+5 -5
View File
@@ -28,7 +28,7 @@ object Versions {
}
object Fabric {
const val fabricAPI = "0.128.1+${Mod.minecraft}"
const val fabricAPI = "0.129.0+${Mod.minecraft}"
const val cloud = "2.0.0-beta.11"
}
//
@@ -41,7 +41,7 @@ object Versions {
const val mixin = "0.15.5+mixin.0.8.7"
const val mixinExtras = "0.4.1"
const val minecraft = "1.21.7"
const val minecraft = "1.21.8"
const val yarn = "$minecraft+build.1"
const val fabricLoader = "0.16.14"
@@ -56,15 +56,15 @@ object Versions {
// }
object Bukkit {
const val minecraft = "1.21.7-R0.1"
const val paperBuild = "$minecraft-20250630.144242-1"
const val minecraft = "1.21.8-R0.1"
const val paperBuild = "$minecraft-20250717.233435-4"
const val paper = paperBuild
const val paperLib = "1.0.8"
const val reflectionRemapper = "0.1.2"
const val paperDevBundle = paperBuild
const val runPaper = "2.3.1"
const val paperWeight = "2.0.0-beta.17"
const val cloud = "2.0.0-beta.10"
const val cloud = "2.0.0-beta.11"
const val multiverse = "5.0.2"
}
+1 -1
View File
@@ -8,7 +8,7 @@ dependencies {
paperweight.paperDevBundle(Versions.Bukkit.paperDevBundle)
shaded(project(":platforms:bukkit:common"))
shaded(project(":platforms:bukkit:nms:v1_21_7"))
shaded(project(":platforms:bukkit:nms:v1_21_8"))
shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper)
}
@@ -27,6 +27,7 @@ import com.dfsek.terra.bukkit.world.BukkitPlatformBiome;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.Wolf.Variant;
import org.bukkit.event.EventHandler;
@@ -34,6 +35,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +48,7 @@ import java.util.List;
public class CommonListener implements Listener {
private static final Logger logger = LoggerFactory.getLogger(CommonListener.class);
private static final List<SpawnReason> WOLF_VARIANT_SPAWN_REASONS = List.of(
SpawnReason.SPAWNER, SpawnReason.TRIAL_SPAWNER, SpawnReason.SPAWNER_EGG, SpawnReason.DEFAULT
SpawnReason.SPAWNER, SpawnReason.TRIAL_SPAWNER, SpawnReason.SPAWNER_EGG, SpawnReason.NATURAL
);
private final Platform platform;
@@ -68,21 +70,12 @@ public class CommonListener implements Listener {
}
}
@EventHandler
public void onWolfSpawn(CreatureSpawnEvent event) {
if (!(event.getEntity() instanceof Wolf wolf)) {
return;
}
private void applyWolfVariant(Wolf wolf) {
// Doesn't apply if variant has already been applied
if (wolf.getVariant() != Variant.PALE) {
return;
}
if (!WOLF_VARIANT_SPAWN_REASONS.contains(event.getSpawnReason())) {
return;
}
World world = wolf.getWorld();
if (!(world.getGenerator() instanceof BukkitChunkGeneratorWrapper wrapper)) {
return;
@@ -113,4 +106,31 @@ public class CommonListener implements Listener {
}
});
}
@EventHandler
public void onWolfSpawn(CreatureSpawnEvent event) {
if (!(event.getEntity() instanceof Wolf wolf)) {
return;
}
if (!WOLF_VARIANT_SPAWN_REASONS.contains(event.getSpawnReason())) {
logger.debug("Ignoring wolf spawned with reason: " + event.getSpawnReason());
return;
}
applyWolfVariant(wolf);
}
@EventHandler
public void onChunkGenerate(ChunkLoadEvent event) {
if (!event.isNewChunk()) {
return;
}
for (Entity entity : event.getChunk().getEntities()) {
if (entity instanceof Wolf wolf) {
applyWolfVariant(wolf);
}
}
}
}
@@ -47,8 +47,8 @@ public interface Initializer {
private static PlatformImpl constructPlatform(TerraBukkitPlugin plugin) {
try {
String packageVersion = NMS;
if (NMS.equals("v1_21_5") || NMS.equals("v1_21_6")) {
packageVersion = "v1_21_7";
if (NMS.equals("v1_21_5") || NMS.equals("v1_21_6") || NMS.equals("v1_21_7")) {
packageVersion = "v1_21_8";
}
Class<?> platformClass = Class.forName(TERRA_PACKAGE + "." + packageVersion + ".NMSPlatform");
@@ -1,6 +1,6 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.world.BukkitBiomeInfo;
@@ -1,11 +1,11 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent;
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
import com.dfsek.terra.api.world.biome.Biome;
import com.dfsek.terra.bukkit.BukkitAddon;
import com.dfsek.terra.bukkit.PlatformImpl;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.VanillaBiomeProperties;
public class NMSAddon extends BukkitAddon {
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
@@ -12,7 +12,7 @@ import java.util.Objects;
import java.util.Optional;
import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.VanillaBiomeProperties;
public class NMSBiomeInjector {
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.Holder;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.server.level.ChunkMap;
import net.minecraft.server.level.ServerLevel;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import com.dfsek.tectonic.api.TypeRegistry;
@@ -12,22 +12,22 @@ import com.dfsek.terra.api.world.biome.PlatformBiome;
import com.dfsek.terra.bukkit.PlatformImpl;
import com.dfsek.terra.bukkit.TerraBukkitPlugin;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.BiomeAdditionsSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.BiomeMoodSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.BiomeParticleConfigTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.EntityTypeTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.BiomeAdditionsSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.BiomeMoodSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.BiomeParticleConfigTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.EntityTypeTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.MusicSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.MusicSoundTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.SoundEventTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.SoundEventTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.SpawnCostConfig;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.SpawnCostConfig;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.SpawnEntryConfig;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.SpawnSettingsTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.SpawnTypeConfig;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.SpawnEntryConfig;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.SpawnSettingsTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.SpawnTypeConfig;
import com.dfsek.terra.bukkit.nms.v1_21_7.config.VillagerTypeTemplate;
import com.dfsek.terra.bukkit.nms.v1_21_8.config.VillagerTypeTemplate;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.Music;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.world.level.LevelHeightAccessor;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.core.Holder;
import net.minecraft.core.Holder.Reference;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7;
package com.dfsek.terra.bukkit.nms.v1_21_8;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -7,10 +7,7 @@ import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.arguments.ParticleArgument;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.HolderLookup.Provider;
import net.minecraft.core.HolderLookup.RegistryLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.biome.AmbientParticleSettings;
import java.util.stream.Stream;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.ConfigTemplate;
import com.dfsek.tectonic.api.config.template.annotations.Default;
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21_7.config;
package com.dfsek.terra.bukkit.nms.v1_21_8.config;
import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;