public class ThreadSafeChange extends Object implements MassChange
Constructor and Description |
---|
ThreadSafeChange(World world) |
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
|
public ThreadSafeChange(World world)
public void setBlock(int x, int y, int z, int id) throws IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic void setBlock(int x, int y, int z, Substance substance) throws IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic void setBlock(int x, int y, int z, Substance substance, byte data) throws IllegalStateException
MassChange
setBlock
in interface MassChange
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
public void setBlock(int x, int y, int z, int id, byte data) throws IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic void setBlock(Position coords, int id) throws IllegalStateException
MassChange
setBlock
in interface MassChange
coords
- the position to set, values will be roundedid
- the id to change the block toIllegalStateException
- if this change has already been committedpublic void setBlock(Position coords, int id, byte data) throws IllegalArgumentException, IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic void setBlock(Position coords, Substance substance) throws IllegalArgumentException, IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic void setBlock(Position coords, Substance substance, byte data) throws IllegalArgumentException, IllegalStateException
MassChange
setBlock
in interface MassChange
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 committedpublic boolean commitChanges() throws IllegalStateException
MassChange
This instance of MassChange will be rendered useless after this method is called, and should be discarded
commitChanges
in interface MassChange
IllegalStateException
- if this change has already been committedCopyright © 2016. All rights reserved.