Fixed bug with Chunklets not being reloaded on /reload

This commit is contained in:
NuclearW 2012-06-16 21:43:04 -04:00
parent 09721518b0
commit 4407ed0a6f
5 changed files with 26 additions and 0 deletions

View File

@ -29,6 +29,7 @@ Version 1.3.09
= Fixed bug with Tree Feller changing durability before checking for axe splintering = Fixed bug with Tree Feller changing durability before checking for axe splintering
= Fixed bug with Repair Mastery permission due to typo = Fixed bug with Repair Mastery permission due to typo
= Fixed bug with repairing items that use metadata = Fixed bug with repairing items that use metadata
= Fixed bug with Chunklets not being reloaded on /reload
! API methods can now only be used in a static way ! API methods can now only be used in a static way
! Arrows shot from a bow having the Infitity enchantment can no longer be retrieved ! Arrows shot from a bow having the Infitity enchantment can no longer be retrieved
! Changed Spout settings to be in their own config file (spout.yml) ! Changed Spout settings to be in their own config file (spout.yml)

View File

@ -9,6 +9,7 @@ import java.util.List;
import net.shatteredlands.shatt.backup.ZipLibrary; import net.shatteredlands.shatt.backup.ZipLibrary;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
@ -223,6 +224,10 @@ public class mcMMO extends JavaPlugin {
// Get our ChunkletManager // Get our ChunkletManager
placeStore = ChunkletManagerFactory.getChunkletManager(); placeStore = ChunkletManagerFactory.getChunkletManager();
for (World world : getServer().getWorlds()) {
placeStore.loadWorld(world);
}
} }
/** /**

View File

@ -36,6 +36,13 @@ public interface ChunkletManager {
*/ */
public void unloadWorld(World world); public void unloadWorld(World world);
/**
* Load all ChunkletStores from all loaded chunks from this world into memory
*
* @param world World to load
*/
public void loadWorld(World world);
/** /**
* Save all ChunkletStores * Save all ChunkletStores
*/ */

View File

@ -11,6 +11,7 @@ import java.io.StreamCorruptedException;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -92,6 +93,13 @@ public class HashChunkletManager implements ChunkletManager {
} }
} }
@Override
public void loadWorld(World world) {
for(Chunk chunk : world.getLoadedChunks()) {
this.chunkLoaded(chunk.getX(), chunk.getZ(), world);
}
}
@Override @Override
public void saveAll() { public void saveAll() {
for(World world : Bukkit.getWorlds()) { for(World world : Bukkit.getWorlds()) {

View File

@ -29,6 +29,11 @@ public class NullChunkletManager implements ChunkletManager {
return; return;
} }
@Override
public void loadWorld(World world) {
return;
}
@Override @Override
public void saveAll() { public void saveAll() {
return; return;