move stuff into API
parent
6d7e3b8f39
commit
f610b58d40
@ -1,12 +0,0 @@
|
||||
package net.brokenmoon.redcontrol.api;
|
||||
|
||||
import net.brokenmoon.redcontrol.RedControl;
|
||||
|
||||
import java.util.function.IntConsumer;
|
||||
|
||||
public class LogConsumer implements IntConsumer {
|
||||
@Override
|
||||
public void accept(int value) {
|
||||
RedControl.LOGGER.info("Cpu MMU Logger: " + value);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package net.brokenmoon.redcontrol.api;
|
||||
|
||||
import com.simon816.j65el02.device.RedBus;
|
||||
import net.brokenmoon.redcontrol.util.FloodFill;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface NetworkHolder {
|
||||
RCWorldBus getBus(World world, BlockPos pos);
|
||||
void setBus(World world, BlockPos pos, RCWorldBus bus);
|
||||
default void generateBus(ServerWorld world, BlockPos pos){
|
||||
Block worldBlock = world.getBlockState(pos).getBlock();
|
||||
if(world.getBlockEntity(pos) instanceof Peripheral entityBlock){
|
||||
RCWorldBus bus = new RCWorldBus(new RedBus(), world, pos);
|
||||
entityBlock.setBus(bus);
|
||||
entityBlock.getBus().setValid(true);
|
||||
this.setBus(world,pos,entityBlock.getBus());
|
||||
FloodFill.INSTANCE.blockFloodFiller(world, pos);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue