@NotThreadSafe public interface MassChange
Don't forget to call commitChanges()
to finish the operation
An instance of this class can be acquired using
net.tridentsdk.registry.Factory#newMassChange(net.tridentsdk.world.World)
Normally, block changes cause changes to immediately be sent to the client which can be expensive with large amounts of changes being sent at once near a lot of players
Modifier and Type | Method and Description |
---|---|
boolean |
commitChanges()
Sends the block changes to the clients and does lighting recalculations
|
void |
setBlock(int x,
int y,
int z,
int id)
Add a change to make at when this change is committed
|
void |
setBlock(int x,
int y,
int z,
int id,
byte data)
Add a change to make at when this change is committed
|
void |
setBlock(int x,
int y,
int z,
Substance substance)
Add a change to make at when this change is committed
|
void |
setBlock(int x,
int y,
int z,
Substance substance,
byte data)
Add a change to make at when this change is committed
|
void |
setBlock(Position coords,
int id)
Add a change to make at when this change is committed
|
void |
setBlock(Position coords,
int id,
byte data)
Add a change to make at when this change is committed
|
void |
setBlock(Position coords,
Substance substance)
Add a change to make at when this change is committed
|
void |
setBlock(Position coords,
Substance substance,
byte data)
Add a change to make at when this change is committed
|
void setBlock(int x, int y, int z, int id) throws IllegalStateException
x
- the x of the block to sety
- the y of the block to setz
- the z of the block to setid
- the block id to change the block toIllegalStateException
- if this change has already been committedvoid setBlock(int x, int y, int z, Substance substance) throws IllegalStateException
x
- the x of the block to sety
- the y of the block to setz
- the z of the block to setsubstance
- the substance to change the block toIllegalStateException
- if this change has already been committedvoid setBlock(int x, int y, int z, int id, byte data) throws IllegalStateException
x
- the x of the block to sety
- the y of the block to setz
- the z of the block to setid
- the block id to change the block todata
- the data value to give the new blockIllegalStateException
- if this change has already been committedvoid setBlock(int x, int y, int z, Substance substance, byte data) throws IllegalStateException
x
- the x of the block to sety
- the y of the block to setz
- the z of the block to setsubstance
- the substance to change the block todata
- the data value to give the new blockIllegalStateException
void setBlock(Position coords, int id) throws IllegalArgumentException, IllegalStateException
coords
- the position to set, values will be roundedid
- the id to change the block toIllegalArgumentException
- if coords are not from the same world as this changeIllegalStateException
- if this change has already been committedvoid setBlock(Position coords, int id, byte data) throws IllegalArgumentException, IllegalStateException
coords
- the position to set, values will be roundedid
- the id to change the block todata
- the data value to change the block toIllegalArgumentException
- if coords are not from the same world as this changeIllegalStateException
- if this change has already been committedvoid setBlock(Position coords, Substance substance) throws IllegalArgumentException, IllegalStateException
coords
- the position to set, values will be roundedsubstance
- the substance to change the block toIllegalArgumentException
- if coords are not from the same world as this changeIllegalStateException
- if this change has already been committedvoid setBlock(Position coords, Substance substance, byte data) throws IllegalArgumentException, IllegalStateException
coords
- the position to set, values will be roundedsubstance
- the id to change the block todata
- the data value to change the block toIllegalArgumentException
- if coords are not from the same world as this changeIllegalStateException
- if this change has already been committedboolean commitChanges() throws IllegalStateException
This instance of MassChange will be rendered useless after this method is called, and should be discarded
IllegalStateException
- if this change has already been committedCopyright © 2016. All rights reserved.