mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Changed WorldEdit to not set block data for blocks that don't require it.
This commit is contained in:
parent
780ccd37ec
commit
6945ddd258
@ -70,6 +70,10 @@ public class EditSession {
|
|||||||
* Random number generator.
|
* Random number generator.
|
||||||
*/
|
*/
|
||||||
private static Random prng = new Random();
|
private static Random prng = new Random();
|
||||||
|
/**
|
||||||
|
* Total number of blocks set over time.
|
||||||
|
*/
|
||||||
|
private int blockIndex = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the object with a maximum number of blocks.
|
* Construct the object with a maximum number of blocks.
|
||||||
@ -99,9 +103,13 @@ public class EditSession {
|
|||||||
ServerInterface.clearChest(pt);
|
ServerInterface.clearChest(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean result = ServerInterface.setBlockType(pt, block.getID());
|
int id = block.getID();
|
||||||
if (block.getID() != 0) {
|
|
||||||
|
boolean result = ServerInterface.setBlockType(pt, id);
|
||||||
|
if (id != 0) {
|
||||||
|
if (BlockType.usesData(id)) {
|
||||||
ServerInterface.setBlockData(pt, block.getData());
|
ServerInterface.setBlockData(pt, block.getData());
|
||||||
|
}
|
||||||
|
|
||||||
// Signs
|
// Signs
|
||||||
if (block instanceof SignBlock) {
|
if (block instanceof SignBlock) {
|
||||||
|
@ -268,4 +268,37 @@ public enum BlockType {
|
|||||||
|| id == 83 // Reed
|
|| id == 83 // Reed
|
||||||
|| id == 90; // Portal
|
|| id == 90; // Portal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the block uses its data value.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean usesData(int id) {
|
||||||
|
return id == 6 // Saplings
|
||||||
|
|| id == 8 // Water
|
||||||
|
|| id == 9 // Water
|
||||||
|
|| id == 10 // Lava
|
||||||
|
|| id == 11 // Lava
|
||||||
|
|| id == 50 // Torch
|
||||||
|
|| id == 53 // Wooden stairs
|
||||||
|
|| id == 55 // Redstone wire
|
||||||
|
|| id == 59 // Crops
|
||||||
|
|| id == 60 // Soil
|
||||||
|
|| id == 63 // Sign post
|
||||||
|
|| id == 64 // Wooden door
|
||||||
|
|| id == 65 // Ladder
|
||||||
|
|| id == 66 // Minecart track
|
||||||
|
|| id == 67 // Cobblestone stairs
|
||||||
|
|| id == 68 // Wall sign
|
||||||
|
|| id == 69 // Lever
|
||||||
|
|| id == 70 // Stone pressure plate
|
||||||
|
|| id == 71 // Iron door
|
||||||
|
|| id == 72 // Wooden pressure plate
|
||||||
|
|| id == 75 // Redstone torch (off)
|
||||||
|
|| id == 76 // Redstone torch (on)
|
||||||
|
|| id == 77 // Stone button
|
||||||
|
|| id == 81; // Cactus
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user