Beginnings of BUS
parent
47ae15deb9
commit
9721848c4e
@ -1,4 +0,0 @@
|
||||
package net.brokenmoon.redcontrol.api;
|
||||
|
||||
public interface IRedBusConnectable {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package net.brokenmoon.redcontrol.api;
|
||||
|
||||
import com.simon816.j65el02.Bus;
|
||||
import com.simon816.j65el02.device.RedBus;
|
||||
|
||||
public class RCBus extends Bus {
|
||||
public RCBus(RedBus redBus) {
|
||||
super(redBus);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package net.brokenmoon.redcontrol.blockentities;
|
||||
|
||||
import com.simon816.j65el02.Bus;
|
||||
import com.simon816.j65el02.device.RedBus;
|
||||
import net.brokenmoon.redcontrol.api.RCBus;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public abstract class Peripheral extends BlockEntity {
|
||||
|
||||
private RCBus bus;
|
||||
public Peripheral(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||
super(type, pos, state);
|
||||
}
|
||||
|
||||
public RCBus getBus() {
|
||||
return bus;
|
||||
}
|
||||
|
||||
public void setBus(RCBus bus) {
|
||||
this.bus = bus;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package net.brokenmoon.redcontrol.blocks;
|
||||
|
||||
import net.brokenmoon.redcontrol.api.RCBus;
|
||||
import net.brokenmoon.redcontrol.blockentities.Peripheral;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class NetworkCarrier extends Block implements BlockEntityProvider {
|
||||
public NetworkCarrier(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
public RCBus getBus(World world, BlockPos pos){
|
||||
return ((Peripheral)world.getBlockEntity(pos)).getBus();
|
||||
}
|
||||
|
||||
public void setBus(World world, BlockPos pos, RCBus bus){
|
||||
((Peripheral)world.getBlockEntity(pos)).setBus(bus);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue