Interface ISimulationController
- All Known Implementing Classes:
SimulationController
public interface ISimulationController
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.entity.player.PlayerGet the player currently trying to hack the security station.Get the simulation object for the given side (player or AI)booleanIs 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.booleanAre we done with this hack simulation?voidonConnectionStarted(HackSimulation hackSimulation, int fromPos, int toPos, float initialProgress) A connection from one node to another has just begun.voidonNodeFortified(HackSimulation hackSimulation, int pos) A simulation has just had a hacked node fortified by the playervoidonNodeHacked(HackSimulation hackSimulation, int pos) A simulation has just had a node hacked (connection completed).voidtick()Called every game tick (both client and server) by the owning security station block entity.voidtoBytes(net.minecraft.network.FriendlyByteBuf buf) Serialize the simulation controller for sync to client on open of hacking GUI
-
Method Details
-
onConnectionStarted
void onConnectionStarted(HackSimulation hackSimulation, int fromPos, int toPos, float initialProgress) A connection from one node to another has just begun.- Parameters:
hackSimulation- the simulationfromPos- position of the hacking nodetoPos- position of the target nodeinitialProgress- initial progress of the connection (usually but not necessarily 0)
-
onNodeHacked
A simulation has just had a node hacked (connection completed).- Parameters:
hackSimulation- the simulationpos- position of the newly hacked node
-
onNodeFortified
A simulation has just had a hacked node fortified by the player- Parameters:
hackSimulation- the simulationpos- position of the newly fortified node
-
tick
void tick()Called every game tick (both client and server) by the owning security station block entity. -
isSimulationDone
boolean isSimulationDone()Are we done with this hack simulation?- Returns:
- true if finished, false otherwise
-
getSimulation
Get the simulation object for the given side (player or AI)- Parameters:
side- the side to get- Returns:
- the simulation
-
getHacker
net.minecraft.world.entity.player.Player getHacker()Get the player currently trying to hack the security station. This does not validate if the player is still online.- Returns:
- the player
-
isJustTesting
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.- Returns:
- true if just testing, false otherwise
-
toBytes
void toBytes(net.minecraft.network.FriendlyByteBuf buf) Serialize the simulation controller for sync to client on open of hacking GUI- Parameters:
buf- packet buffer
-