From ce7b203b9c8c8abc30e4051e1396869991c90cb8 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 3 May 2023 18:04:42 -0400 Subject: [PATCH] slottest function expanded. --- src/engine/devcmd/cmds/SlotTestCmd.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/engine/devcmd/cmds/SlotTestCmd.java b/src/engine/devcmd/cmds/SlotTestCmd.java index 7ba17dd8..2d48f9f2 100644 --- a/src/engine/devcmd/cmds/SlotTestCmd.java +++ b/src/engine/devcmd/cmds/SlotTestCmd.java @@ -14,6 +14,7 @@ import engine.Enum.GameObjectType; import engine.devcmd.AbstractDevCmd; import engine.gameManager.BuildingManager; import engine.gameManager.ChatManager; +import engine.math.Vector3fImmutable; import engine.objects.*; import java.util.ArrayList; @@ -47,6 +48,20 @@ public class SlotTestCmd extends AbstractDevCmd { return; } + // Goto slot location + + if (args.length == 1) { + + int slot = Integer.parseInt(args[0]); + Vector3fImmutable slotPosition; + BuildingLocation slotLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot); + slotPosition = slotLocation.getLocation(); + slotPosition = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotPosition, building.getBounds().getQuaternion().angleY); + playerCharacter.teleport(slotPosition); + return; + } + + for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID)) outString += buildingLocation.getSlot() + buildingLocation.getLocation().toString() + "\r\n"; @@ -73,7 +88,7 @@ public class SlotTestCmd extends AbstractDevCmd { @Override protected String _getUsageString() { - return "./slottest "; + return "./slottest n"; }