public abstract class Syncable extends UpdatingTile
Constructor and Description |
---|
Syncable(net.minecraft.tileentity.TileEntityType<?> tileEntityTypeIn) |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Double |
getVariable(int id)
Used to get the field on the server, this will fetch the server value and overwrite the current
|
void |
sendValueToClient(int id,
double value)
Sends the value to the clients nearby
|
void |
sendValueToServer(int id,
double value)
Sends the value to the server, you should probably only call this from the client
|
abstract void |
setVariable(int id,
double value)
Used to set the value of a field
|
void |
updateClientValueFromServer(int id)
Will get the value from the server and set it to our current value, call from client
Only use if you lose data and want to update from server.
|
getUpdatePacket, getUpdateTag, markForUpdate, onClientTick, onDataPacket, onServerTick, tick
addInfoToCrashReport, create, getBlockState, getDistanceSq, getMaxRenderDistanceSquared, getPos, getTileData, getType, getWorld, hasWorld, isRemoved, markDirty, mirror, onlyOpsCanSetNbt, read, receiveClientEvent, remove, rotate, setPos, setWorld, updateContainingBlockInfo, validate, warnInvalidBlock, write
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Syncable(net.minecraft.tileentity.TileEntityType<?> tileEntityTypeIn)
public abstract void setVariable(int id, double value)
id
- The field idvalue
- The value of the fieldpublic abstract java.lang.Double getVariable(int id)
id
- The field idpublic void sendValueToServer(int id, double value)
public void updateClientValueFromServer(int id)
public void sendValueToClient(int id, double value)