From 2950f7376f0a66fab0d79eb3a90c3dff1226bdbb Mon Sep 17 00:00:00 2001 From: TechTastic <74630543+TechTastic@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:51:05 -0600 Subject: [PATCH] Updated FTB Chunks Mixin to new API --- .../ftb_chunks/MixinClaimedChunkManager.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/ftb_chunks/MixinClaimedChunkManager.java b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/ftb_chunks/MixinClaimedChunkManager.java index 55c8cc7f..60795640 100644 --- a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/ftb_chunks/MixinClaimedChunkManager.java +++ b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/ftb_chunks/MixinClaimedChunkManager.java @@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; -import org.joml.Vector3d; +import net.minecraft.world.phys.Vec3; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Pseudo; import org.spongepowered.asm.mixin.Unique; @@ -12,9 +12,8 @@ import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.valkyrienskies.core.api.ships.Ship; -import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.api.ValkyrienSkies; import org.valkyrienskies.mod.common.config.VSGameConfig; -import org.valkyrienskies.mod.common.util.VectorConversionsMCKt; @Pseudo @Mixin(ClaimedChunkManager.class) @@ -42,13 +41,13 @@ public abstract class MixinClaimedChunkManager { final Level level = entity.level; - final Ship ship = VSGameUtilsKt.getShipManagingPos(level, pos); + final Ship ship = ValkyrienSkies.getShipManagingBlock(level, pos); if (ship == null) { return pos; } - final Vector3d vec = ship.getShipToWorld().transformPosition(VectorConversionsMCKt.toJOMLD(pos)); - final BlockPos newPos = new BlockPos(VectorConversionsMCKt.toMinecraft(vec)); + final Vec3 vec = ValkyrienSkies.positionToWorld(ship, Vec3.atCenterOf(pos)); + final BlockPos newPos = new BlockPos(vec); if ((newPos.getY() > level.getMaxBuildHeight() || newPos.getY() < level.getMinBuildHeight()) && !VSGameConfig.SERVER.getFTBChunks().getShipsProtectionOutOfBuildHeight()) {