Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Oct 28, 2024
1 parent 322b050 commit 08a2792
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 9 additions & 4 deletions src/main/java/dev/andante/audience/Audience.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -29,6 +32,8 @@

@SuppressWarnings("unused")
public interface Audience {
Set<PositionFlag> EMPTY_POSITION_FLAG_SET = Collections.emptySet();

/**
* The players of this audience.
*/
Expand All @@ -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));
}

/**
Expand All @@ -49,7 +54,7 @@ default void teleport(ServerWorld world, Vec3d position, Vec2f rotation) {
default void teleport(ServerWorld world, Function<ServerPlayerEntity, Vec3d> 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);
});
}

Expand All @@ -61,7 +66,7 @@ default void teleportWithRotation(ServerWorld world, Function<ServerPlayerEntity
Pair<Vec3d, Vec2f> 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);
});
}

Expand Down Expand Up @@ -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));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
@SuppressWarnings("AddedMixinMembersNamePattern")
@Mixin(ServerWorld.class)
public abstract class ServerWorldMixin extends World implements Audience {
private ServerWorldMixin(MutableWorldProperties properties, RegistryKey<World> registryRef, DynamicRegistryManager registryManager, RegistryEntry<DimensionType> dimensionEntry, Supplier<Profiler> 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<World> registryRef, DynamicRegistryManager registryManager, RegistryEntry<DimensionType> dimensionEntry, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) {
super(properties, registryRef, registryManager, dimensionEntry, isClient, debugWorld, seed, maxChainedNeighborUpdates);
}

@Override
public PlayerSet getAudiencePlayers() {
RegistryKey<World> registryKey = this.getRegistryKey();
Expand Down

0 comments on commit 08a2792

Please sign in to comment.