mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 12:35:27 +02:00
Second Smelt makes use of its own section in Bonus Drops in config.yml
Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import java.io.*;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class HashChunkletManager implements ChunkletManager {
|
||||
public HashMap<String, ChunkletStore> store = new HashMap<String, ChunkletStore>();
|
||||
public HashMap<String, ChunkletStore> store = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void loadChunklet(int cx, int cy, int cz, World world) {
|
||||
|
@@ -11,57 +11,46 @@ import org.bukkit.block.Block;
|
||||
public class NullChunkletManager implements ChunkletManager {
|
||||
@Override
|
||||
public void loadChunklet(int cx, int cy, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadChunklet(int cx, int cy, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadChunk(int cx, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadChunk(int cx, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chunkLoaded(int cx, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chunkUnloaded(int cx, int cz, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWorld(World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadWorld(World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadWorld(World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAll() {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadAll() {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,26 +65,21 @@ public class NullChunkletManager implements ChunkletManager {
|
||||
|
||||
@Override
|
||||
public void setTrue(int x, int y, int z, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrue(Block block) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFalse(int x, int y, int z, World world) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFalse(Block block) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanUp() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -11,10 +11,10 @@ import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class HashChunkManager implements ChunkManager {
|
||||
private final HashMap<UUID, HashMap<Long, McMMOSimpleRegionFile>> regionFiles = new HashMap<UUID, HashMap<Long, McMMOSimpleRegionFile>>();
|
||||
public HashMap<String, ChunkStore> store = new HashMap<String, ChunkStore>();
|
||||
public ArrayList<BlockStoreConversionZDirectory> converters = new ArrayList<BlockStoreConversionZDirectory>();
|
||||
private final HashMap<UUID, Boolean> oldData = new HashMap<UUID, Boolean>();
|
||||
private final HashMap<UUID, HashMap<Long, McMMOSimpleRegionFile>> regionFiles = new HashMap<>();
|
||||
public HashMap<String, ChunkStore> store = new HashMap<>();
|
||||
public ArrayList<BlockStoreConversionZDirectory> converters = new ArrayList<>();
|
||||
private final HashMap<UUID, Boolean> oldData = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public synchronized void closeAll() {
|
||||
@@ -38,31 +38,19 @@ public class HashChunkManager implements ChunkManager {
|
||||
if (in == null) {
|
||||
return null;
|
||||
}
|
||||
ObjectInputStream objectStream = new ObjectInputStream(in);
|
||||
try {
|
||||
try (ObjectInputStream objectStream = new ObjectInputStream(in)) {
|
||||
Object o = objectStream.readObject();
|
||||
if (o instanceof ChunkStore) {
|
||||
return (ChunkStore) o;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Wrong class type read for chunk meta data for " + x + ", " + z);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
// Assume the format changed
|
||||
return null;
|
||||
//throw new RuntimeException("Unable to process chunk meta data for " + x + ", " + z, e);
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
// Assume the format changed
|
||||
//System.out.println("[SpoutPlugin] is Unable to find serialized class for " + x + ", " + z + ", " + e.getMessage());
|
||||
return null;
|
||||
//throw new RuntimeException("Unable to find serialized class for " + x + ", " + z, e);
|
||||
}
|
||||
finally {
|
||||
objectStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,7 +86,7 @@ public class HashChunkManager implements ChunkManager {
|
||||
|
||||
UUID key = world.getUID();
|
||||
|
||||
HashMap<Long, McMMOSimpleRegionFile> worldRegions = regionFiles.computeIfAbsent(key, k -> new HashMap<Long, McMMOSimpleRegionFile>());
|
||||
HashMap<Long, McMMOSimpleRegionFile> worldRegions = regionFiles.computeIfAbsent(key, k -> new HashMap<>());
|
||||
|
||||
int rx = x >> 5;
|
||||
int rz = z >> 5;
|
||||
@@ -217,7 +205,7 @@ public class HashChunkManager implements ChunkManager {
|
||||
closeAll();
|
||||
String worldName = world.getName();
|
||||
|
||||
List<String> keys = new ArrayList<String>(store.keySet());
|
||||
List<String> keys = new ArrayList<>(store.keySet());
|
||||
for (String key : keys) {
|
||||
String[] info = key.split(",");
|
||||
if (worldName.equals(info[0])) {
|
||||
@@ -239,7 +227,7 @@ public class HashChunkManager implements ChunkManager {
|
||||
|
||||
String worldName = world.getName();
|
||||
|
||||
List<String> keys = new ArrayList<String>(store.keySet());
|
||||
List<String> keys = new ArrayList<>(store.keySet());
|
||||
for (String key : keys) {
|
||||
String[] info = key.split(",");
|
||||
if (worldName.equals(info[0])) {
|
||||
|
@@ -29,7 +29,7 @@ public class McMMOSimpleRegionFile {
|
||||
private final int[] dataStart = new int[1024];
|
||||
private final int[] dataActualLength = new int[1024];
|
||||
private final int[] dataLength = new int[1024];
|
||||
private final ArrayList<Boolean> inuse = new ArrayList<Boolean>();
|
||||
private final ArrayList<Boolean> inuse = new ArrayList<>();
|
||||
private int segmentSize;
|
||||
private int segmentMask;
|
||||
private final int rx;
|
||||
|
@@ -28,7 +28,6 @@ public class BlockStoreConversionMain implements Runnable {
|
||||
}
|
||||
|
||||
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,6 +86,5 @@ public class BlockStoreConversionMain implements Runnable {
|
||||
this.world = null;
|
||||
this.scheduler = null;
|
||||
this.converters = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ public class BlockStoreConversionXDirectory implements Runnable {
|
||||
}
|
||||
|
||||
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -42,7 +42,6 @@ public class BlockStoreConversionZDirectory implements Runnable {
|
||||
}
|
||||
|
||||
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user