mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Add data version to BukkitImplAdapter.
Also throttle unknown-block warning when loading MCEdit schematics.
This commit is contained in:
parent
f0587354be
commit
31a8328fb5
@ -67,8 +67,10 @@ public class BukkitServerInterface implements MultiUserPlatform {
|
||||
|
||||
@Override
|
||||
public int getDataVersion() {
|
||||
// TODO - add to adapter - CraftMagicNumbers#getDataVersion
|
||||
return 1631;
|
||||
if (plugin.getBukkitImplAdapter() != null) {
|
||||
return plugin.getBukkitImplAdapter().getDataVersion();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,6 +40,13 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public interface BukkitImplAdapter {
|
||||
|
||||
/**
|
||||
* Get the Minecraft data version for the current world data.
|
||||
*
|
||||
* @return the data version
|
||||
*/
|
||||
int getDataVersion();
|
||||
|
||||
/**
|
||||
* Get the block at the given location.
|
||||
*
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -53,10 +53,11 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
@ -213,6 +214,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
clipboard.setOrigin(origin);
|
||||
|
||||
|
||||
Set<Integer> unknownBlocks = new HashSet<>();
|
||||
for (int x = 0; x < width; ++x) {
|
||||
for (int y = 0; y < height; ++y) {
|
||||
for (int z = 0; z < length; ++z) {
|
||||
@ -230,9 +232,13 @@ public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
} else {
|
||||
clipboard.setBlock(region.getMinimumPoint().add(pt), state);
|
||||
}
|
||||
} else {
|
||||
if (!useOverride) {
|
||||
log.warn("Unknown block when pasting schematic: " + blocks[index] + ":" + blockData[index] + ". Please report this issue.");
|
||||
} else if (!useOverride) {
|
||||
short block = blocks[index];
|
||||
byte data = blockData[index];
|
||||
int combined = block << 8 | data;
|
||||
if (unknownBlocks.add(combined)) {
|
||||
log.warn("Unknown block when pasting schematic: "
|
||||
+ block + ":" + data + ". Please report this issue.");
|
||||
}
|
||||
}
|
||||
} catch (WorldEditException ignored) { // BlockArrayClipboard won't throw this
|
||||
@ -316,7 +322,6 @@ public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
case "PigZombie": return "zombie_pigman";
|
||||
default: return id;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
private String convertBlockEntityId(String id) {
|
||||
|
Loading…
Reference in New Issue
Block a user