diff --git a/build.gradle b/build.gradle index 04aabb3..a25bb87 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'fabric-loom' version '1.8-SNAPSHOT' id 'maven-publish' - id "org.jetbrains.kotlin.jvm" version "1.9.+" + id "org.jetbrains.kotlin.jvm" version "2.0.21" } def ENV = System.getenv() diff --git a/gradle.properties b/gradle.properties index 6705436..5a60c1e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.21.1 -yarn_build=3 +minecraft_version=1.21.3 +yarn_build=2 loader_version=0.16.7 -fabric_version=0.106.0+1.21.1 -fabric_kotlin_version=1.10.20+kotlin.1.9.24 +fabric_version=0.107.0+1.21.3 +fabric_kotlin_version=1.12.3+kotlin.2.0.21 kache_version=1.0.5 inject_version=1.3.1 # Mod Properties -mod_version=2.13.2 +mod_version=3.1 maven_group=dev.andante diff --git a/src/main/java/dev/andante/audience/Audience.java b/src/main/java/dev/andante/audience/Audience.java index b7cc8d2..3483ffd 100644 --- a/src/main/java/dev/andante/audience/Audience.java +++ b/src/main/java/dev/andante/audience/Audience.java @@ -9,6 +9,7 @@ import net.minecraft.network.packet.s2c.play.BundleS2CPacket; import net.minecraft.network.packet.s2c.play.ClearTitleS2CPacket; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; +import net.minecraft.network.packet.s2c.play.PositionFlag; import net.minecraft.network.packet.s2c.play.WorldBorderInitializeS2CPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; @@ -21,6 +22,8 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.border.WorldBorder; +import java.util.Collections; +import java.util.Set; import java.util.function.Consumer; import java.util.function.Function; @@ -29,6 +32,8 @@ @SuppressWarnings("unused") public interface Audience { + Set EMPTY_POSITION_FLAG_SET = Collections.emptySet(); + /** * The players of this audience. */ @@ -40,7 +45,7 @@ default PlayerSet getAudiencePlayers() { * Teleports the audience to the given world using the given position and rotation. */ default void teleport(ServerWorld world, Vec3d position, Vec2f rotation) { - forEachAudience(player -> player.teleport(world, position.x, position.y, position.z, rotation.x, rotation.y)); + forEachAudience(player -> player.teleport(world, position.x, position.y, position.z, EMPTY_POSITION_FLAG_SET, rotation.x, rotation.y, true)); } /** @@ -49,7 +54,7 @@ default void teleport(ServerWorld world, Vec3d position, Vec2f rotation) { default void teleport(ServerWorld world, Function positionFunction) { forEachAudience( player -> { Vec3d position = positionFunction.apply(player); - player.teleport(world, position.x, position.y, position.z, 0.0f, 0.0f); + player.teleport(world, position.x, position.y, position.z, EMPTY_POSITION_FLAG_SET, 0.0f, 0.0f, true); }); } @@ -61,7 +66,7 @@ default void teleportWithRotation(ServerWorld world, Function positionAndRotation = positionRotationFunction.apply(player); Vec3d position = positionAndRotation.getLeft(); Vec2f rotation = positionAndRotation.getRight(); - player.teleport(world, position.x, position.y, position.z, rotation.x, rotation.y); + player.teleport(world, position.x, position.y, position.z, EMPTY_POSITION_FLAG_SET, rotation.x, rotation.y, true); }); } @@ -172,7 +177,7 @@ default void stopSound(SoundStop soundStop) { * Teleports all audience players to the given [world] and [position]. */ default void teleport(ServerWorld world, Vec3d position) { - forEachAudience(player -> player.teleport(world, position.x, position.y, position.z, 0.0f, 0.0f)); + forEachAudience(player -> player.teleport(world, position.x, position.y, position.z, EMPTY_POSITION_FLAG_SET, 0.0f, 0.0f, true)); } /** diff --git a/src/main/java/dev/andante/audience/mixin/ServerWorldMixin.java b/src/main/java/dev/andante/audience/mixin/ServerWorldMixin.java index c3dc78d..2df45df 100644 --- a/src/main/java/dev/andante/audience/mixin/ServerWorldMixin.java +++ b/src/main/java/dev/andante/audience/mixin/ServerWorldMixin.java @@ -23,12 +23,12 @@ @SuppressWarnings("AddedMixinMembersNamePattern") @Mixin(ServerWorld.class) public abstract class ServerWorldMixin extends World implements Audience { - private ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates) { - super(properties, registryRef, registryManager, dimensionEntry, profiler, isClient, debugWorld, biomeAccess, maxChainedNeighborUpdates); - } - @Shadow @Final private MinecraftServer server; + private ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimensionEntry, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) { + super(properties, registryRef, registryManager, dimensionEntry, isClient, debugWorld, seed, maxChainedNeighborUpdates); + } + @Override public PlayerSet getAudiencePlayers() { RegistryKey registryKey = this.getRegistryKey();