diff --git a/modules/entity/src/main/java/io/github/fabricators_of_create/porting_lib/entity/mixin/common/ServerPlayerMixin.java b/modules/entity/src/main/java/io/github/fabricators_of_create/porting_lib/entity/mixin/common/ServerPlayerMixin.java index 13c1b80c..913017c5 100644 --- a/modules/entity/src/main/java/io/github/fabricators_of_create/porting_lib/entity/mixin/common/ServerPlayerMixin.java +++ b/modules/entity/src/main/java/io/github/fabricators_of_create/porting_lib/entity/mixin/common/ServerPlayerMixin.java @@ -91,6 +91,9 @@ public ServerPlayerMixin(Level world, BlockPos pos, float yaw, GameProfile gameP @Shadow protected abstract void createEndPlatform(ServerLevel world, BlockPos centerPos); + @Shadow + public abstract void setServerLevel(ServerLevel serverLevel); + @Inject(method = "", at = @At("RETURN")) private void port_lib$init(MinecraftServer minecraftServer, ServerLevel serverLevel, GameProfile gameProfile, CallbackInfo ci) { ServerPlayerCreationCallback.EVENT.invoker().onCreate((ServerPlayer) (Object) this); @@ -133,10 +136,10 @@ public Entity changeDimension(ServerLevel p_9180_, ITeleporter teleporter) { serverlevel.getProfiler().pop(); serverlevel.getProfiler().push("placing"); - this.setLevel(p_9180_); + this.setServerLevel(p_9180_); + this.connection.teleport(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.yRot, portalinfo.xRot); + this.connection.resetPosition(); p_9180_.addDuringPortalTeleport((ServerPlayer) (Object) this); - this.setRot(portalinfo.yRot, portalinfo.xRot); - this.moveTo(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z); serverlevel.getProfiler().pop(); this.triggerDimensionChangeTriggers(serverlevel); return this;//forge: this is part of the ITeleporter patch