From 364476d8ae1d10c32a24129bbfff28881ffde647 Mon Sep 17 00:00:00 2001 From: GuyApooye Date: Tue, 14 Jan 2025 14:26:00 +0200 Subject: [PATCH 1/2] better ship and entity teleportation handler. --- build.gradle | 7 +- src/main/java/net/jcm/vsch/VSCHEvents.java | 1 + .../java/net/jcm/vsch/ducks/IEntityDuck.java | 7 + .../jcm/vsch/event/AtmosphericCollision.java | 6 +- .../net/jcm/vsch/event/PlanetCollision.java | 6 +- .../java/net/jcm/vsch/mixin/MixinEntity.java | 50 +++++ .../java/net/jcm/vsch/util/ShipUtils.java | 43 ++++ .../java/net/jcm/vsch/util/TeleportUtils.java | 1 + .../jcm/vsch/util/TeleportationHandler.java | 203 ++++++++++++++++++ .../java/net/jcm/vsch/util/VSCHUtils.java | 33 ++- src/main/resources/vsch.mixins.json | 2 +- 11 files changed, 352 insertions(+), 7 deletions(-) create mode 100644 src/main/java/net/jcm/vsch/ducks/IEntityDuck.java create mode 100644 src/main/java/net/jcm/vsch/mixin/MixinEntity.java create mode 100644 src/main/java/net/jcm/vsch/util/ShipUtils.java create mode 100644 src/main/java/net/jcm/vsch/util/TeleportationHandler.java diff --git a/build.gradle b/build.gradle index 5116c2b..cc615b0 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,7 @@ minecraft { // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - property 'forge.logging.console.level', 'debug' + property 'forge.logging.console.level', 'info' mods { "${mod_id}" { @@ -191,6 +191,11 @@ dependencies { implementation ("org.valkyrienskies.core:util:${vs_core_version}") implementation fg.deobf("org.valkyrienskies:valkyrienskies-120-forge:${vs2_version}") + compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1")) + implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.4.1")) { + jarJar.ranged(it, "[0.4.1,)") + } + //implementation fg.deobf("mekanism:Mekanism:${mekanism_version}") //runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}:generators") //runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}:additions") diff --git a/src/main/java/net/jcm/vsch/VSCHEvents.java b/src/main/java/net/jcm/vsch/VSCHEvents.java index 7fbf53a..ac6b184 100644 --- a/src/main/java/net/jcm/vsch/VSCHEvents.java +++ b/src/main/java/net/jcm/vsch/VSCHEvents.java @@ -1,5 +1,6 @@ package net.jcm.vsch; +import com.mojang.logging.LogUtils; import net.jcm.vsch.entity.VSCHEntities; import net.lointain.cosmos.network.CosmosModVariables; import net.jcm.vsch.event.GravityInducer; diff --git a/src/main/java/net/jcm/vsch/ducks/IEntityDuck.java b/src/main/java/net/jcm/vsch/ducks/IEntityDuck.java new file mode 100644 index 0000000..837468b --- /dev/null +++ b/src/main/java/net/jcm/vsch/ducks/IEntityDuck.java @@ -0,0 +1,7 @@ +package net.jcm.vsch.ducks; + +import net.minecraft.world.entity.Entity; + +public interface IEntityDuck { + Entity vsch$getNewEntity(); +} diff --git a/src/main/java/net/jcm/vsch/event/AtmosphericCollision.java b/src/main/java/net/jcm/vsch/event/AtmosphericCollision.java index 4839e70..b3cd17e 100644 --- a/src/main/java/net/jcm/vsch/event/AtmosphericCollision.java +++ b/src/main/java/net/jcm/vsch/event/AtmosphericCollision.java @@ -1,6 +1,7 @@ package net.jcm.vsch.event; import net.jcm.vsch.util.TeleportUtils; +import net.jcm.vsch.util.TeleportationHandler; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.LevelAccessor; import net.minecraft.nbt.Tag; @@ -12,8 +13,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.joml.Vector3d; import org.valkyrienskies.core.api.ships.Ship; import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.common.ValkyrienSkiesMod; import java.util.ArrayList; import java.util.List; @@ -79,8 +82,7 @@ public static void atmosphericCollisionTick(ServerLevel level, LevelAccessor wor }*/ - TeleportUtils.teleportShipAndConstrained(ship, level, gotoDimension, posX, posY, posZ); - + new TeleportationHandler(VSCHUtils.dimToLevel(ValkyrienSkiesMod.getCurrentServer(), gotoDimension), level, false).handleTeleport(ship, new Vector3d(posX, posY, posZ)); } } diff --git a/src/main/java/net/jcm/vsch/event/PlanetCollision.java b/src/main/java/net/jcm/vsch/event/PlanetCollision.java index af930ad..728b36b 100644 --- a/src/main/java/net/jcm/vsch/event/PlanetCollision.java +++ b/src/main/java/net/jcm/vsch/event/PlanetCollision.java @@ -2,7 +2,7 @@ import io.netty.buffer.Unpooled; import net.jcm.vsch.VSCHMod; -import net.jcm.vsch.util.TeleportUtils; +import net.jcm.vsch.util.TeleportationHandler; import net.jcm.vsch.util.VSCHUtils; import net.lointain.cosmos.network.CosmosModVariables; import net.lointain.cosmos.world.inventory.LandingSelectorMenu; @@ -25,9 +25,11 @@ import net.minecraftforge.network.NetworkHooks; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.joml.Vector3d; import org.valkyrienskies.core.api.ships.Ship; import org.valkyrienskies.core.util.datastructures.DenseBlockPosSet; import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.common.ValkyrienSkiesMod; import org.valkyrienskies.mod.common.util.VectorConversionsMCKt; import java.util.List; @@ -102,7 +104,7 @@ public static void playerMenuTick(Player player, Ship ship, ServerLevel level, C return; } logger.info("[VSCH]: Teleporting VS ship into planet!"); - TeleportUtils.teleportShipAndConstrained(ship, level, dimension, posX, posY, posZ); + new TeleportationHandler(VSCHUtils.dimToLevel(ValkyrienSkiesMod.getCurrentServer(), dimension), level, true).handleTeleport(ship, new Vector3d(posX, posY, posZ)); vars.landing_coords = "^"; vars.check_collision = true; vars.syncPlayerVariables(player); diff --git a/src/main/java/net/jcm/vsch/mixin/MixinEntity.java b/src/main/java/net/jcm/vsch/mixin/MixinEntity.java new file mode 100644 index 0000000..3330c04 --- /dev/null +++ b/src/main/java/net/jcm/vsch/mixin/MixinEntity.java @@ -0,0 +1,50 @@ +package net.jcm.vsch.mixin; + +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.sugar.Local; +import net.jcm.vsch.ducks.IEntityDuck; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.RelativeMovement; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import javax.annotation.Nullable; +import java.util.Set; + +@Mixin(Entity.class) +public abstract class MixinEntity implements IEntityDuck { + @Shadow public abstract void moveTo(double pX, double pY, double pZ, float pYRot, float pXRot); + + @Shadow protected abstract void teleportPassengers(); + + @Shadow public abstract void setYHeadRot(float pYHeadRot); + + @Shadow public abstract void unRide(); + + @Shadow public abstract EntityType getType(); + + @Shadow public abstract void setRemoved(Entity.RemovalReason pRemovalReason); + + @Shadow @Nullable private Entity vehicle; + + @Unique + private Entity vsch$weirdEntity; + + public Entity vsch$getNewEntity() { + return vsch$weirdEntity; + } + + @Inject(method = "teleportTo(Lnet/minecraft/server/level/ServerLevel;DDDLjava/util/Set;FF)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;addDuringTeleport(Lnet/minecraft/world/entity/Entity;)V")) + private void getNewEntity(ServerLevel pLevel, double pX, double pY, double pZ, Set pRelativeMovements, float pYRot, float pXRot, CallbackInfoReturnable cir, @Local(name = "entity") Entity entity) { + vsch$weirdEntity = entity; + } +} diff --git a/src/main/java/net/jcm/vsch/util/ShipUtils.java b/src/main/java/net/jcm/vsch/util/ShipUtils.java new file mode 100644 index 0000000..395217b --- /dev/null +++ b/src/main/java/net/jcm/vsch/util/ShipUtils.java @@ -0,0 +1,43 @@ +package net.jcm.vsch.util; + +import net.minecraft.world.entity.Entity; +import org.joml.Quaterniond; +import org.joml.Vector3d; +import org.valkyrienskies.core.api.ships.Ship; +import org.valkyrienskies.core.api.ships.properties.ShipTransform; +import org.valkyrienskies.core.apigame.physics.PhysicsEntityServer; +import org.valkyrienskies.core.apigame.world.ServerShipWorldCore; +import org.valkyrienskies.core.impl.game.ships.ShipObjectServerWorld; +import org.valkyrienskies.core.impl.game.ships.ShipTransformImpl; +import org.valkyrienskies.mod.common.util.EntityDraggingInformation; +import org.valkyrienskies.mod.common.util.IEntityDraggingInformationProvider; + +import java.util.Objects; + +public class ShipUtils { + public static ShipTransform transformFromId(Long id, ServerShipWorldCore shipWorld) { + Ship ship = shipWorld.getAllShips().getById(id); + if (ship == null) { + PhysicsEntityServer physicsEntity = ((ShipObjectServerWorld)shipWorld).getLoadedPhysicsEntities().get(id); + if (physicsEntity == null) return new ShipTransformImpl(new Vector3d(), new Vector3d(), new Quaterniond(), new Vector3d()); + return physicsEntity.getShipTransform(); + } + return ship.getTransform(); + } + + public static boolean isEntityDraggedByShip(Ship ship, Entity entity) { + IEntityDraggingInformationProvider provider = (IEntityDraggingInformationProvider) entity; + if (!provider.vs$shouldDrag()) return false; + EntityDraggingInformation information = provider.getDraggingInformation(); + if (!information.isEntityBeingDraggedByAShip()) return false; + return Objects.equals(information.getLastShipStoodOn(), ship.getId()); + } + + public static boolean isEntityDraggedByShip(Long id, Entity entity) { + IEntityDraggingInformationProvider provider = (IEntityDraggingInformationProvider) entity; + if (!provider.vs$shouldDrag()) return false; + EntityDraggingInformation information = provider.getDraggingInformation(); + if (!information.isEntityBeingDraggedByAShip()) return false; + return Objects.equals(information.getLastShipStoodOn(), id); + } +} diff --git a/src/main/java/net/jcm/vsch/util/TeleportUtils.java b/src/main/java/net/jcm/vsch/util/TeleportUtils.java index 0baf6a7..6cf5488 100644 --- a/src/main/java/net/jcm/vsch/util/TeleportUtils.java +++ b/src/main/java/net/jcm/vsch/util/TeleportUtils.java @@ -25,6 +25,7 @@ import java.util.*; +@Deprecated(forRemoval = true) public class TeleportUtils { public static void teleportShipAndConstrained(Ship ship, ServerLevel level, String newDim, double x, double y, double z) { ServerShipObjectWorldAccessor shipWorld = (ServerShipObjectWorldAccessor) VSGameUtilsKt.getShipObjectWorld(level); diff --git a/src/main/java/net/jcm/vsch/util/TeleportationHandler.java b/src/main/java/net/jcm/vsch/util/TeleportationHandler.java new file mode 100644 index 0000000..27f487c --- /dev/null +++ b/src/main/java/net/jcm/vsch/util/TeleportationHandler.java @@ -0,0 +1,203 @@ +package net.jcm.vsch.util; + +import net.jcm.vsch.VSCHMod; +import net.jcm.vsch.ducks.IEntityDuck; +import net.jcm.vsch.mixin.accessor.ServerShipObjectWorldAccessor; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.phys.AABB; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.joml.Vector3d; +import org.joml.Vector3dc; +import org.valkyrienskies.core.api.ships.*; +import org.valkyrienskies.core.apigame.ShipTeleportData; +import org.valkyrienskies.core.apigame.constraints.VSConstraint; +import org.valkyrienskies.core.apigame.physics.PhysicsEntityServer; +import org.valkyrienskies.core.apigame.world.ServerShipWorldCore; +import org.valkyrienskies.core.impl.game.ShipTeleportDataImpl; +import org.valkyrienskies.core.impl.game.ships.ShipObjectServerWorld; +import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.common.ValkyrienSkiesMod; +import org.valkyrienskies.mod.common.util.DimensionIdProvider; +import org.valkyrienskies.mod.common.util.VectorConversionsMCKt; + +import java.util.*; + +import static net.jcm.vsch.util.ShipUtils.transformFromId; + +public class TeleportationHandler { + + private static final Logger logger = LogManager.getLogger(VSCHMod.MODID); + + private static final Map> shipIdToConstraints = ((ServerShipObjectWorldAccessor) VSGameUtilsKt.getShipObjectWorld(ValkyrienSkiesMod.getCurrentServer())).getShipIdToConstraints(); + private static final Map constraintIdToConstraint = ((ServerShipObjectWorldAccessor) VSGameUtilsKt.getShipObjectWorld(ValkyrienSkiesMod.getCurrentServer())).getConstraints(); + + private final Map shipToPos = new HashMap<>(); + private final Map entityToPos = new HashMap<>(); + //Minecraft teleports entities between dimensions by creating a new entity and discarding the previous one. therefore, a map from entity to entity would not work. + private final Map passengerVehicleMap = new HashMap<>(); + private final ServerShipWorldCore shipWorld; + private double greatestOffset; + private final ServerLevel newDim; + private final ServerLevel originalDim; + private final boolean isReturning; + + public TeleportationHandler(ServerLevel newDim, ServerLevel originalDim, boolean isReturning) { + shipWorld = VSGameUtilsKt.getShipObjectWorld(newDim); + this.newDim = newDim; + this.originalDim = originalDim; + //Look for the lowest ship when escaping, in order to not collide with the planet. + //Look for the highest ship when reentering, in order to not collide with the atmosphere. + this.isReturning = isReturning; + } + + public void handleTeleport(Ship ship, Vector3d newPos) { + logger.info(newPos); + logger.info(newPos); + logger.info(newPos); + logger.info(newPos); + logger.info(newPos); + logger.info(newPos); + collectShips(ship, newPos); + handleTeleport(); + } + + + private void collectConnected(Long currentPhysObject, Vector3dc origin, Vector3d newPos) { + if (currentPhysObject == null) return; + if (shipToPos.containsKey(currentPhysObject)) return; + Set constraints = shipIdToConstraints.get(currentPhysObject); + Vector3dc pos = transformFromId(currentPhysObject, shipWorld).getPositionInWorld(); + + + //TODO if planet collision position matters for reentry angle THIS SHOULD BE FIXED!! Currently a fix is not needed. + double offset = pos.get(1) - origin.get(1); + + offset *= isReturning ? 1 : -1; + if (offset > greatestOffset) greatestOffset = offset; + + shipToPos.put(currentPhysObject, pos.sub(origin, new Vector3d()).add(newPos, new Vector3d())); + if (constraints != null) { + constraints.iterator().forEachRemaining(id -> { + VSConstraint constraint = constraintIdToConstraint.get(id); + collectConnected(constraint.getShipId0(), origin, newPos); + collectConnected(constraint.getShipId1(), origin, newPos); + }); + } + } + + private void collectShips(Ship ship, Vector3d newPos) { + Vector3dc origin = ship.getTransform().getPositionInWorld(); + collectConnected(ship.getId(), origin, newPos); + collectNearby(origin, newPos); + } + + private void collectNearby(Vector3dc origin, Vector3d newPos) { + Map newShipToPos = new HashMap<>(); + shipToPos.keySet().forEach(id -> { + if (shipToPos.containsKey(id)) return; + QueryableShipData loadedShips = shipWorld.getLoadedShips(); + Ship ship = loadedShips.getById(id); + if (ship == null) return; + loadedShips.getIntersecting(VectorConversionsMCKt.toJOML(VectorConversionsMCKt.toMinecraft(ship.getWorldAABB()).inflate(10))) + .forEach(intersecting -> newShipToPos.put(intersecting.getId(), intersecting.getTransform().getPositionInWorld().sub(origin, new Vector3d()).add(newPos, new Vector3d()))); + }); + shipToPos.putAll(newShipToPos); + } + + private void handleTeleport() { + greatestOffset *= isReturning ? 1 : -1; + shipToPos.forEach((id, newPos) -> { + collectEntities(id, newPos); + handleShipTeleport(id, newPos); + teleportEntities(); + }); + + } + + private void collectEntities(Long id, Vector3d shipNewPos) { + ServerShip ship = shipWorld.getLoadedShips().getById(id); + if (ship == null) return; + originalDim.getAllEntities().forEach(entity -> { + if (collectEntity(entity, id,ship, shipNewPos) && entity.isVehicle()) { + entity.getPassengers().forEach(e -> { + passengerVehicleMap.put(e, entity); + collectEntity(entity, id,ship, shipNewPos); + }); + } + }); + } + + private boolean collectEntity(Entity entity,Long id , Ship ship, Vector3d shipNewPos) { + if (entityToPos.containsKey(entity)) return false; + //Entities mounted to shipyard entities + if (VSGameUtilsKt.getShipMountedTo(entity) == ship) { + collectWorldEntity(entity, ship, shipNewPos); + return true; + } + //Shipyard entities + if (VSGameUtilsKt.getShipObjectManagingPos(originalDim, VectorConversionsMCKt.toJOML(entity.position())) == ship) { + //Shipyard coordinates are maintained between dimensions + entityToPos.put(entity, VectorConversionsMCKt.toJOML(entity.position())); + return true; + } + //Entities dragged by ships + if (ShipUtils.isEntityDraggedByShip(id, entity)) { + collectWorldEntity(entity, ship, shipNewPos); + return true; + } + //Entities in range + AABB inflatedAABB = VectorConversionsMCKt.toMinecraft(VSCHUtils.transformToAABBd(ship.getPrevTickTransform(), ship.getShipAABB())).inflate(10); + if(entity.getBoundingBox().intersects(inflatedAABB)) { + collectWorldEntity(entity, ship, shipNewPos); + return true; + } + return false; + } + + private void collectWorldEntity(Entity entity, Ship ship, Vector3d shipNewPos) { + Vector3d newPos = shipNewPos.add(VectorConversionsMCKt.toJOML(entity.position()).sub(ship.getTransform().getPositionInWorld()), new Vector3d()); + entityToPos.put(entity, newPos.add(0,greatestOffset,0)); + + } + + + private void teleportEntities() { + entityToPos.forEach((entity, newPos) -> { + if (entity instanceof ServerPlayer player) + player.teleportTo(newDim, newPos.x, newPos.y, newPos.z, entity.getYRot(), entity.getXRot()); + else { + entity.teleportTo(newDim, newPos.x, newPos.y, newPos.z, null, entity.getYRot(), entity.getXRot()); + } + }); + passengerVehicleMap.forEach((e1,e2) -> { + ifPlayerThenNormal(e1).startRiding(ifPlayerThenNormal(e2)); + }); + } + + private Entity ifPlayerThenNormal(Entity entity) { + if (entity instanceof ServerPlayer) return entity; + else return ((IEntityDuck) entity).vsch$getNewEntity(); + } + + private void handleShipTeleport(Long id, Vector3d newPos) { + String vsDimName = ((DimensionIdProvider) newDim).getDimensionId(); + + ServerShip ship = shipWorld.getLoadedShips().getById(id); + if (ship == null) { + PhysicsEntityServer physEntity = ((ShipObjectServerWorld) shipWorld).getLoadedPhysicsEntities().get(id); + if (physEntity == null) { + logger.warn("[VSCH]: Failed to teleport physics object with id " + id + "! It's neither a Ship nor a Physics Entity!"); + return; + } + ShipTeleportData teleportData = new ShipTeleportDataImpl(newPos.add(0,greatestOffset,0), physEntity.getShipTransform().getShipToWorldRotation(), new Vector3d(), new Vector3d(), vsDimName, null); + shipWorld.teleportPhysicsEntity(physEntity, teleportData); + } + ShipTeleportData teleportData = new ShipTeleportDataImpl(newPos.add(0,greatestOffset,0), ship.getTransform().getShipToWorldRotation(), new Vector3d(), new Vector3d(), vsDimName, null); + shipWorld.teleportShip(ship, teleportData); + + } + +} diff --git a/src/main/java/net/jcm/vsch/util/VSCHUtils.java b/src/main/java/net/jcm/vsch/util/VSCHUtils.java index fe4d690..78a990a 100644 --- a/src/main/java/net/jcm/vsch/util/VSCHUtils.java +++ b/src/main/java/net/jcm/vsch/util/VSCHUtils.java @@ -146,6 +146,10 @@ public static ServerLevel VSDimToLevel(MinecraftServer server, String VSdimensio return server.getLevel(ResourceKey.create(Registries.DIMENSION, rl)); } + public static ServerLevel dimToLevel(MinecraftServer server, String dimensionString) { + return server.getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(dimensionString))); + } + /** * NOT USED ANYMORE, ALWAYS RETURNS TRUE. To be removed at a later date * @@ -196,7 +200,7 @@ public static void DimensionTeleportShip(Ship ship, ServerLevel level, String ne * @param x x position in world to tp to * @param y y position in world to tp to * @param z z position in world to tp to - * @deprecated Use {@link net.jcm.vsch.util.TeleportUtils#DimensionTeleportShip(Ship, ServerLevel, String, double, double, double)} instead + * @deprecated Use {@link net.jcm.vsch.util.TeleportUtils#dimensionTeleportShip(Ship, ServerLevel, String, double, double, double)} instead */ @Deprecated public static void DimensionTeleportShip(Ship ship, ServerLevel level, String newDim, double x, double y, double z) { @@ -438,6 +442,33 @@ public static boolean isCollidingWithPlanet(@Nonnull CompoundTag planetData, Vec return (distanceSqrX <= range && distanceSqrY <= range && distanceSqrZ <= range); } + /** + * DEPRECATED, will crash on cosmic horizons 0.7.2+ + * + * Gets all landing locations available from a planet and gives them to the entry_world global variable. + * @param world The LevelAccessor to get the cosmos world variables from + * @param target_planet The CompoundTag of the planet you are entering + */ +// @Deprecated(forRemoval = true) +// public static void setEntryLocations(LevelAccessor world, CompoundTag target_planet) { +// WorldVariables worldVars = CosmosModVariables.WorldVariables.get(world); +// +// Tag travel_to = target_planet.get("travel_to"); +// +// String travel_to_str = ""; +// if (travel_to instanceof StringTag _stringTag) { +// travel_to_str = _stringTag.getAsString(); +// } +// +// Tag locations = (worldVars.antena_locations.get(travel_to_str)); +// if (locations instanceof ListTag _listTag) { +// worldVars.entry_world = _listTag; +// worldVars.syncData(world); +// } else { +// logger.error("[VSCH:VSCHUtils:396] Locations were not ListTags, travel_to was possibly empty"); +// return; +// } +// } /** * Gets a players Cosmos variables capability, or if it doesn't exist, creates a new one. diff --git a/src/main/resources/vsch.mixins.json b/src/main/resources/vsch.mixins.json index d8a5457..3dae245 100644 --- a/src/main/resources/vsch.mixins.json +++ b/src/main/resources/vsch.mixins.json @@ -6,6 +6,7 @@ "refmap": "vsch.refmap.json", "mixins": [ "MixinCreateNewShipWithBlocks", + "MixinEntity", "MixinGetY", "MixinLightRenderer", "MixinLivingEntityProcedure", @@ -13,7 +14,6 @@ "accessor.ServerShipObjectWorldAccessor" ], "client": [ - "MixinAerialLightRenderer" ], "injectors": { "defaultRequire": 1 From 94d0e3cb74bc7b697b6fb65647907202ac0a4cdd Mon Sep 17 00:00:00 2001 From: GuyApooye Date: Tue, 14 Jan 2025 14:29:54 +0200 Subject: [PATCH 2/2] hotfix but not really --- src/main/java/net/jcm/vsch/util/TeleportationHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/net/jcm/vsch/util/TeleportationHandler.java b/src/main/java/net/jcm/vsch/util/TeleportationHandler.java index 27f487c..56a03db 100644 --- a/src/main/java/net/jcm/vsch/util/TeleportationHandler.java +++ b/src/main/java/net/jcm/vsch/util/TeleportationHandler.java @@ -36,7 +36,6 @@ public class TeleportationHandler { private final Map shipToPos = new HashMap<>(); private final Map entityToPos = new HashMap<>(); - //Minecraft teleports entities between dimensions by creating a new entity and discarding the previous one. therefore, a map from entity to entity would not work. private final Map passengerVehicleMap = new HashMap<>(); private final ServerShipWorldCore shipWorld; private double greatestOffset;