Exemplo n.º 1
0
 private ChunkViewCore createWorldView(Region3i region, Vector3i offset) {
   Chunk[] chunks = new Chunk[region.sizeX() * region.sizeY() * region.sizeZ()];
   for (Vector3i chunkPos : region) {
     Chunk chunk = nearCache.get(chunkPos);
     if (chunk == null || !chunk.isReady()) {
       return null;
     }
     chunkPos.sub(region.minX(), region.minY(), region.minZ());
     int index = TeraMath.calculate3DArrayIndex(chunkPos, region.size());
     chunks[index] = chunk;
   }
   return new ChunkViewCoreImpl(
       chunks, region, offset, blockManager.getBlock(BlockManager.AIR_ID));
 }
  @Override
  public void initialise() {
    final BlockManager blockManager = CoreRegistry.get(BlockManager.class);
    lampTurnedOff = blockManager.getBlock("signalling:SignalLampOff");
    lampTurnedOn = blockManager.getBlock("signalling:SignalLampOn");
    signalTransformer = blockManager.getBlock("signalling:SignalTransformer");
    signalPressurePlate = blockManager.getBlock("signalling:SignalPressurePlate");
    signalSwitch = blockManager.getBlock("signalling:SignalSwitch");
    signalLimitedSwitch = blockManager.getBlock("signalling:SignalLimitedSwitch");
    signalButton = blockManager.getBlock("signalling:SignalButton");

    signalOrGate = blockManager.getBlockFamily("signalling:SignalOrGate");
    signalAndGate = blockManager.getBlockFamily("signalling:SignalAndGate");
    signalXorGate = blockManager.getBlockFamily("signalling:SignalXorGate");
    signalNandGate = blockManager.getBlockFamily("signalling:SignalNandGate");

    signalOnDelayGate = blockManager.getBlockFamily("signalling:SignalOnDelayGate");
    signalOffDelayGate = blockManager.getBlockFamily("signalling:SignalOffDelayGate");

    signalSetResetGate = blockManager.getBlockFamily("signalling:SignalSetResetGate");
  }
Exemplo n.º 3
0
 @Override
 public Block getFromString(String representation) {
   return blockManager.getBlock(representation);
 }