Last commit for the night. Hook up some more components of the snapshotting system
This commit is contained in:
parent
7472db98d5
commit
059055044d
2 changed files with 20 additions and 0 deletions
|
@ -9,6 +9,12 @@ import java.util.List;
|
||||||
public abstract class BlockRestoreQueue
|
public abstract class BlockRestoreQueue
|
||||||
{
|
{
|
||||||
private List<PrimitiveBlock> BLOCK_QUEUE = new ArrayList<>();
|
private List<PrimitiveBlock> BLOCK_QUEUE = new ArrayList<>();
|
||||||
|
private BlockRestoreRunner RUNNER;
|
||||||
|
|
||||||
|
public BlockRestoreQueue()
|
||||||
|
{
|
||||||
|
RUNNER = new BlockRestoreRunner(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the restore queue name
|
* Returns the restore queue name
|
||||||
|
@ -97,4 +103,13 @@ public abstract class BlockRestoreQueue
|
||||||
BLOCK_QUEUE = queue;
|
BLOCK_QUEUE = queue;
|
||||||
notifyDirtyQueue(true);
|
notifyDirtyQueue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a tick. Spawns a thread which will modify 1 block from the queue
|
||||||
|
*/
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
Thread tx = new Thread(RUNNER);
|
||||||
|
tx.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,11 @@ import java.util.Random;
|
||||||
|
|
||||||
public class BlockRestoreRunner implements Runnable
|
public class BlockRestoreRunner implements Runnable
|
||||||
{
|
{
|
||||||
|
public BlockRestoreRunner(BlockRestoreQueue queue)
|
||||||
|
{
|
||||||
|
this.queue = queue;
|
||||||
|
}
|
||||||
|
|
||||||
private BlockRestoreQueue queue;
|
private BlockRestoreQueue queue;
|
||||||
public final SoundEvent pop = SoundEvents.ITEM_PICKUP;
|
public final SoundEvent pop = SoundEvents.ITEM_PICKUP;
|
||||||
|
|
||||||
|
|
Reference in a new issue