
mmb.content.wireworld.WWWire Maven / Gradle / Ivy
/**
*
*/
package mmb.content.wireworld;
import mmb.content.ContentsBlocks;
import mmb.engine.block.BlockEntityDataless;
import mmb.engine.block.BlockType;
import mmb.engine.worlds.MapProxy;
import mmb.engine.worlds.world.WorldUtils;
/**
* Turns into a head when receiving 1 or 2 true signals
* @author oskar
*/
public class WWWire extends BlockEntityDataless {
@Override
public BlockType type() {
return ContentsBlocks.ww_wire;
}
@Override
public void onTick(MapProxy map) {
int count = WorldUtils.allIncomingSignals(posX(), posY(), owner());
if(count == 1 || count == 2) {
map.place(ContentsBlocks.ww_head, posX(), posY());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy