Allow higher BaseBlock ids

This commit is contained in:
Jesse Boyd 2017-03-27 08:44:51 +11:00
parent 6cd724668e
commit f23d63b7d9
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 7 additions and 4 deletions

View File

@ -66,7 +66,7 @@ public class BaseBlock extends Block implements TileEntityBlock, Pattern {
* reasons), which coincides with the number of possible IDs that official
* Minecraft supports as of version 1.7.
*/
public static final int MAX_ID = 4095;
public static final int MAX_ID = 65535;
/**
* Indicates the maximum data value (inclusive) that can be used. A future
@ -149,10 +149,8 @@ public class BaseBlock extends Block implements TileEntityBlock, Pattern {
*/
protected final void internalSetId(int id) {
if (id > MAX_ID) {
throw new IllegalArgumentException("Can't have a block ID above "
+ MAX_ID + " (" + id + " given)");
throw new IllegalArgumentException("Can't have a block ID above " + MAX_ID + " (" + id + " given)");
}
if (id < 0) {
throw new IllegalArgumentException("Can't have a block ID below 0");
}

View File

@ -358,6 +358,11 @@ public enum ClipboardFormat {
}
public ClipboardHolder[] loadAllFromDirectory(File dir, WorldData worldData) {
if (worldData == null) {
try {
worldData = WorldEdit.getInstance().getServer().getWorlds().get(0).getWorldData();
} catch (Throwable ignore) {}
}
File[] files = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {