private TShortObjectMap<TIntList> createBatchBlockEventMappings(Chunk chunk) {
    TShortObjectMap<TIntList> batchBlockMap = new TShortObjectHashMap<>();
    for (Block block : blockManager.listRegisteredBlocks()) {
      if (block.isLifecycleEventsRequired()) {
        batchBlockMap.put(block.getId(), new TIntArrayList());
      }
    }

    ChunkBlockIterator i = chunk.getBlockIterator();
    while (i.next()) {
      if (i.getBlock().isLifecycleEventsRequired()) {
        TIntList positionList = batchBlockMap.get(i.getBlock().getId());
        positionList.add(i.getBlockPos().x);
        positionList.add(i.getBlockPos().y);
        positionList.add(i.getBlockPos().z);
      }
    }
    return batchBlockMap;
  }
Esempio n. 2
0
 /**
  * Register new sub-type, may replace existing sub-types. Should be used only if you know what are
  * you doing, it will not create fully usable material.
  *
  * @param element sub-type to register
  */
 public static void register(final BowlMat element) {
   byID.put(element.getType(), element);
   byName.put(element.getTypeName(), element);
 }
Esempio n. 3
0
 /**
  * Register new sub-type, may replace existing sub-types. Should be used only if you know what are
  * you doing, it will not create fully usable material.
  *
  * @param element sub-type to register
  */
 public static void register(final DiamondLeggingsMat element) {
   byID.put(element.getType(), element);
   byName.put(element.getTypeName(), element);
 }
Esempio n. 4
0
 /**
  * Register new sub-type, may replace existing sub-types. Should be used only if you know what are
  * you doing, it will not create fully usable material.
  *
  * @param element sub-type to register
  */
 public static void register(final IronChestplateMat element) {
   byID.put(element.getType(), element);
   byName.put(element.getTypeName(), element);
 }