mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
New factories means more jobs for a better economy
This commit is contained in:
parent
bcee6abb65
commit
3032572f18
@ -15,7 +15,7 @@ import com.gmail.nossr50.util.Leaderboard;
|
||||
import com.gmail.nossr50.util.Metrics;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
import com.gmail.nossr50.util.blockmeta.ChunkletManager;
|
||||
import com.gmail.nossr50.util.blockmeta.HashChunkletManager;
|
||||
import com.gmail.nossr50.util.blockmeta.ChunkletManagerFactory;
|
||||
import com.gmail.nossr50.listeners.BlockListener;
|
||||
import com.gmail.nossr50.listeners.EntityListener;
|
||||
import com.gmail.nossr50.listeners.HardcoreListener;
|
||||
@ -54,7 +54,7 @@ public class mcMMO extends JavaPlugin {
|
||||
public static Database database;
|
||||
public static mcMMO p;
|
||||
|
||||
public static ChunkletManager placeStore = new HashChunkletManager();
|
||||
public static ChunkletManager placeStore;
|
||||
|
||||
/* Jar Stuff */
|
||||
public File mcmmo;
|
||||
@ -132,6 +132,9 @@ public class mcMMO extends JavaPlugin {
|
||||
System.out.println("Failed to submit stats.");
|
||||
}
|
||||
}
|
||||
|
||||
// Get our ChunkletManager
|
||||
placeStore = ChunkletManagerFactory.getChunkletManager();
|
||||
}
|
||||
|
||||
public void setupFilePaths() {
|
||||
|
@ -0,0 +1,8 @@
|
||||
package com.gmail.nossr50.util.blockmeta;
|
||||
|
||||
public class ChunkletManagerFactory {
|
||||
public static ChunkletManager getChunkletManager() {
|
||||
// TODO: Add in loading from config what type of manager we want.
|
||||
return new HashChunkletManager();
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.gmail.nossr50.util.blockmeta;
|
||||
|
||||
public class ChunkletStoreFactory {
|
||||
protected static ChunkletStore getChunkletStore() {
|
||||
// TODO: Add in loading from config what type of store we want.
|
||||
return new PrimitiveChunkletStore();
|
||||
}
|
||||
}
|
@ -132,7 +132,7 @@ public class HashChunkletManager implements ChunkletManager {
|
||||
|
||||
ChunkletStore cStore;
|
||||
if(!store.containsKey(world.getName() + "," + cx + "," + cz + "," + cy)) {
|
||||
cStore = new PrimitiveChunkletStore();
|
||||
cStore = ChunkletStoreFactory.getChunkletStore();
|
||||
store.put(world.getName() + "," + cx + "," + cz + "," + cy, cStore);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user