public class SimulationController extends java.lang.Object implements ISimulationController
ISimulationController.HackingSide| Constructor and Description |
|---|
SimulationController(TileEntitySecurityStation te,
net.minecraft.entity.player.PlayerEntity hacker,
boolean justTesting)
Called server-side when a hack is started
|
SimulationController(TileEntitySecurityStation te,
net.minecraft.entity.player.PlayerEntity hacker,
HackSimulation playerSimulation,
HackSimulation aiSimulation,
boolean justTesting)
Called client-side on start of hack to sync the initial simulation state.
|
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.entity.player.PlayerEntity |
getHacker()
Get the player currently trying to hack the security station.
|
HackSimulation |
getSimulation(ISimulationController.HackingSide side)
Get the simulation object for the given side (player or AI)
|
boolean |
isJustTesting()
Is this just a test by the station's owner, or other whitelisted player? If just testing, the security
station will not retaliate on a failed hack.
|
boolean |
isSimulationDone()
Are we done with this hack simulation?
|
void |
onConnectionStarted(HackSimulation hackSimulation,
int fromPos,
int toPos,
float initialProgress)
A connection from one node to another has just begun.
|
void |
onNodeFortified(HackSimulation hackSimulation,
int pos)
A simulation has just had a hacked node fortified by the player
|
void |
onNodeHacked(HackSimulation hackSimulation,
int pos)
A simulation has just had a node hacked (connection completed).
|
void |
tick()
Called every game tick (both client and server) by the owning security station tile entity.
|
void |
toBytes(net.minecraft.network.PacketBuffer buffer)
Serialize the simulation controller for sync to client on open of hacking GUI
|
public SimulationController(TileEntitySecurityStation te, net.minecraft.entity.player.PlayerEntity hacker, boolean justTesting)
te - the security stationhacker - the hacking playerpublic SimulationController(TileEntitySecurityStation te, net.minecraft.entity.player.PlayerEntity hacker, HackSimulation playerSimulation, HackSimulation aiSimulation, boolean justTesting)
te - the security stationhacker - the hacking player (will be the client player)playerSimulation - the hacking player's simulation objectaiSimulation - the security station's simulation objectpublic void onConnectionStarted(HackSimulation hackSimulation, int fromPos, int toPos, float initialProgress)
ISimulationControlleronConnectionStarted in interface ISimulationControllerhackSimulation - the simulationfromPos - position of the hacking nodetoPos - position of the target nodeinitialProgress - initial progress of the connection (usually but not necessarily 0)public boolean isJustTesting()
ISimulationControllerisJustTesting in interface ISimulationControllerpublic void toBytes(net.minecraft.network.PacketBuffer buffer)
ISimulationControllertoBytes in interface ISimulationControllerbuffer - packet bufferpublic void onNodeHacked(HackSimulation hackSimulation, int pos)
ISimulationControlleronNodeHacked in interface ISimulationControllerhackSimulation - the simulationpos - position of the newly hacked nodepublic void onNodeFortified(HackSimulation hackSimulation, int pos)
ISimulationControlleronNodeFortified in interface ISimulationControllerhackSimulation - the simulationpos - position of the newly fortified nodepublic void tick()
ISimulationControllertick in interface ISimulationControllerpublic boolean isSimulationDone()
ISimulationControllerisSimulationDone in interface ISimulationControllerpublic HackSimulation getSimulation(ISimulationController.HackingSide side)
ISimulationControllergetSimulation in interface ISimulationControllerside - the side to getpublic net.minecraft.entity.player.PlayerEntity getHacker()
ISimulationControllergetHacker in interface ISimulationController