Advertisement
Guest User

Chunk Rescan

a guest
Jun 17th, 2016
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1.     @SubscribeEvent
  2.     public void worldTickEnd(TickEvent.WorldTickEvent event) {
  3.         if(event.phase == TickEvent.Phase.END) {
  4.             if(event.world.getWorldTime() % 2 == 0) {
  5.                 OreDataHooks.doRescan(event.world);
  6.             }
  7.         }
  8.     }
  9.  
  10.     public static void doRescan(World world) {
  11.         ChunkCoordTriplet key = toRescan.peek();
  12.         if(key != null && key.dimID == world.provider.dimensionId) {
  13.             key = toRescan.poll();
  14.             OresBase.logger.log(Level.INFO, "Chunk " + key + " is missing ore data, it will be rescanned.  Chunks way out on the edge of the world may not save and cause this message to repeat next launch; do not be alarmed.");
  15.             OresBase.logger.log(Level.INFO, toRescan.size() + " chunks remain.");
  16.             OresBase.oreCounter.generate(null, key.posX, key.posZ, world);
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement