public abstract class ManagedEnvironment extends java.lang.Object implements ManagedEnvironment
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NODE_TAG |
| Constructor and Description |
|---|
ManagedEnvironment() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUpdate()
Like the method of the same name on tile entities, this is used to
decide whether to put a component in the list of components that need
updating, i.e.
|
void |
load(net.minecraft.nbt.NBTTagCompound nbt)
Restores a previous state of the object from the specified NBT tag.
|
Node |
node()
The node this environment wraps.
|
void |
onConnect(Node node)
This is called when a node is added to a network.
|
void |
onDisconnect(Node node)
This is called when a node is removed from the network.
|
void |
onMessage(Message message)
This is the generic message handler.
|
void |
save(net.minecraft.nbt.NBTTagCompound nbt)
Saves the current state of the object into the specified NBT tag.
|
protected void |
setNode(Node value) |
void |
update()
This is called by the host of this managed environment once per tick.
|
public static final java.lang.String NODE_TAG
public Node node()
Environmentnode in interface Environmentprotected void setNode(Node value)
public boolean canUpdate()
ManagedEnvironmentManagedEnvironment.update() should be called each tick.
Return false here, if you do not need updates, to improve performance.canUpdate in interface ManagedEnvironmentpublic void update()
ManagedEnvironmentupdate in interface ManagedEnvironmentpublic void onConnect(Node node)
EnvironmentonConnect in interface Environmentpublic void onDisconnect(Node node)
EnvironmentonDisconnect in interface Environmentpublic void onMessage(Message message)
EnvironmentNode receives a message
that was sent via one of the send methods in the Network
or the Node itself.onMessage in interface Environmentmessage - the message to handle.public void load(net.minecraft.nbt.NBTTagCompound nbt)
Persistableload in interface Persistablenbt - the tag to read the state from.public void save(net.minecraft.nbt.NBTTagCompound nbt)
PersistablePersistable.load(net.minecraft.nbt.NBTTagCompound) is called with that tag.save in interface Persistablenbt - the tag to save the state to.