Package me.iron.WarpSpace.Mod
Class WarpJumpManager
java.lang.Object
me.iron.WarpSpace.Mod.WarpJumpManager
public class WarpJumpManager
extends java.lang.Object
handles all jumps happening and related methods like checking for interdiction etc.
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<org.schema.game.common.controller.SegmentController>dropQueuestatic java.util.List<org.schema.game.common.controller.SegmentController>entryQueue -
Constructor Summary
Constructors Constructor Description WarpJumpManager() -
Method Summary
Modifier and Type Method Description static booleancanExecuteWarpdrive(org.schema.game.common.controller.SegmentController ship)static voiddoSectorSwitch(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i newPos, boolean instant)static voidemptyWarpdrive(org.schema.game.common.controller.SegmentController ship)will remove one jump charge from the FTL drive of the specified ship.private static org.schema.common.util.linAlg.Vector3igetRandomSector()get a random sector in a 500 x 100 x 500 radiusstatic voidinvokeDrop(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean isJump, boolean force)will drop the given ship out of warp after x seconds to specified sector.static voidinvokeEntry(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean force)will make the given ship entry warp after x seconds to specified sector.static booleanisAllowedDropJump(org.schema.game.common.controller.SegmentController ship)Check if a ship is allowed to drop out of warp checks interdiction checks warpdrive.canExecutestatic booleanisAllowedEntry(org.schema.game.common.controller.SegmentController ship)Check if a ship is allowed to enter the warpstatic booleanisInterdicted(org.schema.game.common.controller.SegmentController ship)check if ship is interdicted at its current positionstatic booleanisInterdicted(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i position)check if this ship is/would be interdicted at specified position.static voidSendPlayerWarpSituation(org.schema.game.common.controller.SegmentController sc, WarpProcessController.WarpProcess process, java.lang.Integer processValue, java.util.List<java.lang.String> processArray)send HUD update to all clients of attached players of this segmentcontrollerstatic voidSendPlayerWarpSituation(org.schema.game.common.data.player.PlayerState p, WarpProcessController.WarpProcess s, java.lang.Integer v, java.util.List<java.lang.String> processArray)send hud update to specific player client computer
-
Field Details
-
dropQueue
public static java.util.List<org.schema.game.common.controller.SegmentController> dropQueue -
entryQueue
public static java.util.List<org.schema.game.common.controller.SegmentController> entryQueue
-
-
Constructor Details
-
WarpJumpManager
public WarpJumpManager()
-
-
Method Details
-
invokeDrop
public static void invokeDrop(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean isJump, boolean force)will drop the given ship out of warp after x seconds to specified sector. will not check if ship is allowed to drop, only if it already has a drop queued. Automatically handles effects etc.- Parameters:
countdown- do jump in x secondship- ship to warpsector- targeted sector to drop intoisJump- is a jump or an autodrop, will empty warpdrive if trueforce- overwrite all checks, admin
-
invokeEntry
public static void invokeEntry(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean force)will make the given ship entry warp after x seconds to specified sector.- Parameters:
countdown- in secondsship- segmentcontrollersector- target sector to enterforce- true if ignore all checks and force jump anyways
-
getRandomSector
private static org.schema.common.util.linAlg.Vector3i getRandomSector()get a random sector in a 500 x 100 x 500 radius- Returns:
- random pos Vector3i
-
doSectorSwitch
public static void doSectorSwitch(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i newPos, boolean instant) -
isAllowedEntry
public static boolean isAllowedEntry(org.schema.game.common.controller.SegmentController ship)Check if a ship is allowed to enter the warp- Parameters:
ship- segmentcontroller to check- Returns:
- boolean, true if allowed entry, false if interdicted or can fire warpdrive
-
isAllowedDropJump
public static boolean isAllowedDropJump(org.schema.game.common.controller.SegmentController ship)Check if a ship is allowed to drop out of warp checks interdiction checks warpdrive.canExecute- Parameters:
ship- segmentcontroller ship- Returns:
- boolean, true if not interdicted and can fire warpdrive
-
emptyWarpdrive
public static void emptyWarpdrive(org.schema.game.common.controller.SegmentController ship)will remove one jump charge from the FTL drive of the specified ship.- Parameters:
ship- ship segmentcontroller
-
canExecuteWarpdrive
public static boolean canExecuteWarpdrive(org.schema.game.common.controller.SegmentController ship) -
isInterdicted
public static boolean isInterdicted(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i position)check if this ship is/would be interdicted at specified position.- Parameters:
ship- shipposition- positon to check from- Returns:
- true if interdicted
-
isInterdicted
public static boolean isInterdicted(org.schema.game.common.controller.SegmentController ship)check if ship is interdicted at its current position- Parameters:
ship- ship to check for- Returns:
- true if is interdicted
-
SendPlayerWarpSituation
public static void SendPlayerWarpSituation(org.schema.game.common.data.player.PlayerState p, WarpProcessController.WarpProcess s, java.lang.Integer v, java.util.List<java.lang.String> processArray)send hud update to specific player client computer- Parameters:
p- playerstate players- process thats happeningv- value of processprocessArray- extra info, not used atm
-
SendPlayerWarpSituation
public static void SendPlayerWarpSituation(org.schema.game.common.controller.SegmentController sc, WarpProcessController.WarpProcess process, java.lang.Integer processValue, java.util.List<java.lang.String> processArray)send HUD update to all clients of attached players of this segmentcontroller- Parameters:
sc- shipprocess- warpprocessprocessValue- value of warpprocess (0 = off, 1 = on)processArray- extra info, not used atm
-