mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-17 21:02:20 +01:00
parent
bc39e82dd2
commit
afa21d25ed
@ -228,6 +228,7 @@ public class Clipboard {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
block.setType(m, false);
|
block.setType(m, false);
|
||||||
|
|
||||||
BlockState bs = block.getState();
|
BlockState bs = block.getState();
|
||||||
@ -235,7 +236,6 @@ public class Clipboard {
|
|||||||
byte data = (byte)s.getInt("data");
|
byte data = (byte)s.getInt("data");
|
||||||
block.setData(data);
|
block.setData(data);
|
||||||
|
|
||||||
|
|
||||||
// Material Data
|
// Material Data
|
||||||
MaterialData md = bs.getData();
|
MaterialData md = bs.getData();
|
||||||
if (md instanceof Openable) {
|
if (md instanceof Openable) {
|
||||||
@ -249,9 +249,9 @@ public class Clipboard {
|
|||||||
//facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING)).getOppositeFace());
|
//facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING)).getOppositeFace());
|
||||||
Stairs stairs = (Stairs)md;
|
Stairs stairs = (Stairs)md;
|
||||||
stairs.setInverted(s.getBoolean("inverted"));
|
stairs.setInverted(s.getBoolean("inverted"));
|
||||||
stairs.setFacingDirection(BlockFace.valueOf(s.getString(FACING)));
|
stairs.setFacingDirection(BlockFace.valueOf(s.getString(FACING, "NORTH")));
|
||||||
} else {
|
} else {
|
||||||
facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING)));
|
facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING, "NORTH")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,8 +265,6 @@ public class Clipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Block data
|
// Block data
|
||||||
|
|
||||||
|
|
||||||
if (bs instanceof Sign) {
|
if (bs instanceof Sign) {
|
||||||
Sign sign = (Sign)bs;
|
Sign sign = (Sign)bs;
|
||||||
List<String> lines = s.getStringList("lines");
|
List<String> lines = s.getStringList("lines");
|
||||||
@ -277,17 +275,18 @@ public class Clipboard {
|
|||||||
}
|
}
|
||||||
if (bs instanceof Banner) {
|
if (bs instanceof Banner) {
|
||||||
Banner banner = (Banner)bs;
|
Banner banner = (Banner)bs;
|
||||||
DyeColor baseColor = DyeColor.valueOf(s.getString("baseColor"));
|
DyeColor baseColor = DyeColor.valueOf(s.getString("baseColor", "RED"));
|
||||||
banner.setBaseColor(baseColor);
|
banner.setBaseColor(baseColor);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
ConfigurationSection pat = s.getConfigurationSection("pattern");
|
ConfigurationSection pat = s.getConfigurationSection("pattern");
|
||||||
if (pat != null) {
|
if (pat != null) {
|
||||||
for (String pattern : pat.getKeys(false)) {
|
for (String pattern : pat.getKeys(false)) {
|
||||||
banner.setPattern(i, new Pattern(DyeColor.valueOf(pat.getString(pattern))
|
banner.setPattern(i, new Pattern(DyeColor.valueOf(pat.getString(pattern, "GREEN"))
|
||||||
, PatternType.valueOf(pattern)));
|
, PatternType.valueOf(pattern)));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bs.update(true, false);
|
||||||
}
|
}
|
||||||
if (bs instanceof CreatureSpawner) {
|
if (bs instanceof CreatureSpawner) {
|
||||||
CreatureSpawner spawner = ((CreatureSpawner) bs);
|
CreatureSpawner spawner = ((CreatureSpawner) bs);
|
||||||
@ -299,13 +298,14 @@ public class Clipboard {
|
|||||||
spawner.setDelay(s.getInt("delay", -1));
|
spawner.setDelay(s.getInt("delay", -1));
|
||||||
spawner.setRequiredPlayerRange(s.getInt("requiredPlayerRange", 16));
|
spawner.setRequiredPlayerRange(s.getInt("requiredPlayerRange", 16));
|
||||||
spawner.setSpawnRange(s.getInt("spawnRange", 4));
|
spawner.setSpawnRange(s.getInt("spawnRange", 4));
|
||||||
|
bs.update(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bs.update(true, false);
|
|
||||||
|
|
||||||
if (bs instanceof InventoryHolder) {
|
if (bs instanceof InventoryHolder) {
|
||||||
|
bs.update(true, false);
|
||||||
Inventory ih = ((InventoryHolder)bs).getInventory();
|
Inventory ih = ((InventoryHolder)bs).getInventory();
|
||||||
ConfigurationSection inv = s.getConfigurationSection("inventory");
|
ConfigurationSection inv = s.getConfigurationSection("inventory");
|
||||||
inv.getKeys(false).forEach(i -> ih.setItem(Integer.valueOf(i), (ItemStack)inv.get(i)));
|
inv.getKeys(false).forEach(i -> ih.setItem(Integer.valueOf(i), (ItemStack)inv.get(i)));
|
||||||
@ -316,7 +316,7 @@ public class Clipboard {
|
|||||||
ConfigurationSection e = s.getConfigurationSection("entity");
|
ConfigurationSection e = s.getConfigurationSection("entity");
|
||||||
e.getKeys(false).forEach(k -> {
|
e.getKeys(false).forEach(k -> {
|
||||||
Location center = block.getLocation().add(new Vector(0.5, 0.0, 0.5));
|
Location center = block.getLocation().add(new Vector(0.5, 0.0, 0.5));
|
||||||
LivingEntity ent = (LivingEntity)block.getWorld().spawnEntity(center, EntityType.valueOf(e.getString(k + ".type")));
|
LivingEntity ent = (LivingEntity)block.getWorld().spawnEntity(center, EntityType.valueOf(e.getString(k + ".type", "PIG")));
|
||||||
ent.setCustomName(e.getString(k + ".name"));
|
ent.setCustomName(e.getString(k + ".name"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -368,7 +368,7 @@ public class Clipboard {
|
|||||||
//facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING)).getOppositeFace());
|
//facing.setFacingDirection(BlockFace.valueOf(s.getString(FACING)).getOppositeFace());
|
||||||
Stairs stairs = (Stairs)md;
|
Stairs stairs = (Stairs)md;
|
||||||
s.set("inverted", stairs.isInverted());
|
s.set("inverted", stairs.isInverted());
|
||||||
s.set(FACING, stairs.getAscendingDirection());
|
s.set(FACING, stairs.getAscendingDirection().name());
|
||||||
} else {
|
} else {
|
||||||
Directional facing = (Directional)md;
|
Directional facing = (Directional)md;
|
||||||
s.set(FACING, facing.getFacing().name());
|
s.set(FACING, facing.getFacing().name());
|
||||||
|
Loading…
Reference in New Issue
Block a user