예제 #1
0
 public boolean updateLoadedChunks(World world) {
   this.loadedChunks.clear();
   final LongIterator iter = this.chunks.longIterator();
   while (iter.hasNext()) {
     long chunk = iter.next();
     if (WorldUtil.isLoaded(world, MathUtil.longHashMsw(chunk), MathUtil.longHashLsw(chunk))) {
       this.loadedChunks.add(chunk);
     }
   }
   if (OfflineGroupManager.lastUnloadChunk != null) {
     this.loadedChunks.remove(OfflineGroupManager.lastUnloadChunk);
   }
   return this.testFullyLoaded();
 }
예제 #2
0
 @Override
 public boolean restore() {
   if (this.isLoaded()) {
     return true;
   }
   // Load all the chunks of this group to trigger a restore
   OfflineGroup group = OfflineGroupManager.findGroup(this.trainname);
   if (group == null) {
     TrainProperties.remove(getTrainName());
     return false;
   }
   World world = Bukkit.getWorld(group.worldUUID);
   if (world != null) {
     for (long chunk : group.chunks) {
       world.getChunkAt(MathUtil.longHashMsw(chunk), MathUtil.longHashLsw(chunk));
     }
   }
   return this.hasHolder();
 }