mmb.content.wireworld.WorldLoadDetector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
/**
*
*/
package mmb.content.wireworld;
import mmb.content.ContentsBlocks;
import mmb.engine.block.BlockEntityDataless;
import mmb.engine.block.BlockType;
import mmb.engine.debug.Debugger;
import mmb.engine.rotate.Side;
import mmb.engine.worlds.MapProxy;
/**
* @author oskar
*
*/
public class WorldLoadDetector extends BlockEntityDataless{
private boolean signal = true;
private boolean hasrun = false; //not set properly
private static final Debugger debug = new Debugger("ON LOAD SIGNAL PROVIDER");
@Override
public BlockType type() {
return ContentsBlocks.ONLOAD;
}
@Override
public boolean provideSignal(Side s) {
if(signal) debug.printl("Signal provided");
hasrun = true;
return signal;
}
@Override
public void onTick(MapProxy map) {
map.later(() -> signal = !hasrun&&signal);
if(hasrun) debug.printl("Signal provided");
}
}