mmb.content.wireworld.BlockButton 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<
The newest version!
/**
*
*/
package mmb.content.wireworld;
import mmb.Nil;
import mmb.cgui.BlockActivateListener;
import mmb.content.ContentsBlocks;
import mmb.engine.block.BlockEntityDataless;
import mmb.engine.block.BlockType;
import mmb.engine.rotate.Side;
import mmb.engine.worlds.MapProxy;
import mmb.engine.worlds.world.World;
import mmb.menu.world.window.WorldWindow;
/**
* Emits a signal when clicked manually or by a Block Clicking Claw
* @author oskar
*/
public class BlockButton extends BlockEntityDataless implements BlockActivateListener {
private int pressed;
@Override
public BlockType type() {
return ContentsBlocks.BUTTON;
}
@Override
public void onTick(MapProxy map) {
if(pressed > 0) pressed--;
}
@Override
public boolean provideSignal(Side s) {
return pressed != 0;
}
@Override
public void click(int blockX, int blockY, World map, @Nil WorldWindow window, double partX, double partY) {
pressed = 2;
}
}