下面列出了org.bukkit.block.Sign#update ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Opens the Door Open at a given sign. The
* door will stay open for 10 seconds, then
* will close once more.
*
* @param plugin the plugin instance
* @param sign the sign that was interacted with
*/
public void open(Plugin plugin, final Sign sign) {
section.clear();
sign.setLine(2, Utils.color("&4&lRUN!"));
sign.update();
if (nukeroom) {
Messages.NUKEROOM_OPEN_FOR.broadcast();
} else {
Messages.DOOR_OPENED.broadcast();
}
new BukkitRunnable() {
@Override
public void run() {
activated = false;
section.restore();
sign.setLine(1, "Timer: " + seconds + "s");
sign.setLine(2, "CLICK TO");
sign.setLine(3, "ACTIVATE");
sign.update();
}
}.runTaskLater(plugin, 20 * 10);
}
@Override
public LoopReturn loop(int rowIndex, SignRow.WrappedMetadataSign sign) {
Sign bukkitSign = sign.getBukkitSign();
if (!iterator.hasNext()) {
return LoopReturn.RETURN;
}
Entry<String, Statistic> entry = iterator.next();
Set<Variable> variables = Sets.newHashSet();
entry.getValue().supply(variables, null);
variables.add(new Variable("player", entry.getKey()));
variables.add(new Variable("rank", index + 1));
layoutConfig.getLayout().inflate(bukkitSign, variables);
bukkitSign.update();
sign.setMetadata(METADATA_ID, entry);
++index;
return LoopReturn.DEFAULT;
}
public static void updateSignRentable(Claim claim, Sign sign) {
if (!isRentSign(claim, sign)) {
return;
}
final PaymentType paymentType = claim.getEconomyData().getPaymentType();
List<String> colorLines = new ArrayList<>(4);
colorLines.add(ChatColor.translateAlternateColorCodes('&', "&7[&bGD&7-&1rent&7]"));
colorLines.add(ChatColor.translateAlternateColorCodes('&', LegacyComponentSerializer.legacy().serialize(MessageCache.getInstance().ECONOMY_SIGN_RENT_DESCRIPTION)));
colorLines.add(ChatColor.translateAlternateColorCodes('&', "&4$" + claim.getEconomyData().getRentRate()));
for (int i = 0; i < colorLines.size(); i++) {
sign.setLine(i, colorLines.get(i));
}
sign.update();
}
/**
* Changes the owner of this shop to the given player.
*
* @param owner the new owner
*/
@Override
public void setOwner(@NotNull UUID owner) {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(owner);
//Get the sign at first
List<Sign> signs = this.getSigns();
//then setOwner
this.moderator.setOwner(owner);
//then change the sign
for (Sign shopSign : signs) {
shopSign.setLine(0, MsgUtil.getMessageOfflinePlayer("signs.header", offlinePlayer, ownerName(false)));
//Don't forgot update it
shopSign.update(true);
}
//Event
Bukkit.getPluginManager().callEvent(new ShopModeratorChangedEvent(this, this.moderator));
update();
}
public void updateSigns(String fname) {
if (!RedProtect.get().config.configRoot().region_settings.enable_flag_sign) {
return;
}
List<Location> locs = RedProtect.get().config.getSigns(this.getID());
if (locs.size() > 0) {
for (Location loc : locs) {
if (loc.getBlock().getState() instanceof Sign) {
Sign s = (Sign) loc.getBlock().getState();
String[] lines = s.getLines();
if (lines[0].equalsIgnoreCase("[flag]")) {
if (lines[1].equalsIgnoreCase(fname) && this.name.equalsIgnoreCase(ChatColor.stripColor(lines[2]))) {
s.setLine(3, RedProtect.get().lang.get("region.value") + " " + ChatColor.translateAlternateColorCodes('&', RedProtect.get().lang.translBool(getFlagString(fname))));
s.update();
RedProtect.get().config.putSign(this.getID(), loc);
}
} else {
RedProtect.get().config.removeSign(this.getID(), loc);
}
} else {
RedProtect.get().config.removeSign(this.getID(), loc);
}
}
}
}
private void updateAngleSign(Block block) {
Sign sign = (Sign)block.getState();
sign.setLine(0, "YAW");
sign.setLine(1, ""+this.angle);
double a = this.angle;
if (a > 0) {
sign.setLine(2, "-->");
} else if (a < 0){
sign.setLine(2, "<--");
} else {
sign.setLine(2, "");
}
sign.setLine(3, "");
sign.update();
}
@EventHandler
public void handleInteract(@Nonnull PlayerInteractEvent event) {
if (event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null) {
if (event.getClickedBlock().getState() instanceof Sign) {
Sign sign = (Sign) event.getClickedBlock().getState();
if (sign.hasMetadata("UpdateCooldown")) {
long cooldown = sign.getMetadata("UpdateCooldown").get(0).asLong();
if (cooldown > System.currentTimeMillis() - 1 * 1000) {
return;
}
}
sign.update();
sign.setMetadata("UpdateCooldown", new FixedMetadataValue(voxelGamesLib, System.currentTimeMillis()));
}
}
}
@Override
public boolean spawn() {
Location signLocation = this.getActualLocation();
if (signLocation == null) return false;
Block signBlock = signLocation.getBlock();
if (signBlock.getType() != Material.AIR) {
return false;
}
// place sign: // TODO maybe also allow non-wall signs?
// cancel block physics for this placed sign if needed:
ShopkeepersPlugin.getInstance().cancelNextBlockPhysics(signLocation);
signBlock.setType(Material.WALL_SIGN);
// cleanup state if no block physics were triggered:
ShopkeepersPlugin.getInstance().cancelNextBlockPhysics(null);
// in case sign placement has failed for some reason:
if (!Utils.isSign(signBlock.getType())) {
return false;
}
// set sign facing:
if (signFacing != null) {
Sign signState = (Sign) signBlock.getState();
((Attachable) signState.getData()).setFacingDirection(signFacing);
// apply facing:
signState.update();
}
// init sign content:
updateSign = false;
this.updateSign();
return true;
}
/**
* Changes all lines of text on a sign near the shop
*
* @param lines The array of lines to change. Index is line number.
*/
@Override
public void setSignText(@NotNull String[] lines) {
for (Sign sign : this.getSigns()) {
if (Arrays.equals(sign.getLines(), lines)) {
Util.debugLog("Skipped new sign text setup: Same content");
continue;
}
for (int i = 0; i < lines.length; i++) {
sign.setLine(i, lines[i]);
}
sign.update(true);
}
}
@Override
public void run() {
SplaySet<FactionWorth> factions = plugin.getWorthManager().getOrderedFactions();
for (Map.Entry<Integer, Collection<BlockPos>> entry : signs.asMap().entrySet()) {
// Do nothing if rank is higher than factions size.
if (entry.getKey() >= factions.size()) continue;
// Get the faction worth.
FactionWorth worth = factions.byIndex(entry.getKey());
// Do not update signs if previous value is unchanged.
double previousWorth = previous.getOrDefault(entry.getKey(), 0d);
if (previousWorth == worth.getTotalWorth()) {
continue;
}
previous.put(entry.getKey(), worth.getTotalWorth());
// Update all signs.
for (BlockPos pos : entry.getValue()) {
Block block = pos.getBlock(plugin.getServer());
if (block == null || !(block.getState() instanceof Sign)) {
plugin.getServer().getScheduler().runTask(plugin, () -> removeSign(pos));
continue;
}
Sign sign = (Sign) block.getState();
sign.setLine(2, worth.getName());
sign.setLine(3, plugin.getSettings().getCurrencyFormat().format(worth.getTotalWorth()));
sign.update();
}
}
}
public void clear() {
for (Sign s: signs) {
for (int a = 0; a < 4; a++) {
s.setLine(a, "");
}
s.update();
}
}
private void changeFlag(Region r, String flag, Player p, Sign s) {
if (r.setFlag(p, flag, !r.getFlagBool(flag))) {
RedProtect.get().lang.sendMessage(p, RedProtect.get().lang.get("cmdmanager.region.flag.set").replace("{flag}", "'" + flag + "'") + " " + r.getFlagBool(flag));
RedProtect.get().logger.addLog("(World " + r.getWorld() + ") Player " + p.getName() + " SET FLAG " + flag + " of region " + r.getName() + " to " + RedProtect.get().lang.translBool(r.getFlagString(flag)));
s.setLine(3, ChatColor.translateAlternateColorCodes('&', RedProtect.get().lang.get("region.value") + " " + RedProtect.get().lang.translBool(r.getFlagString(flag))));
s.update();
if (!RedProtect.get().config.getSigns(r.getID()).contains(s.getLocation())) {
RedProtect.get().config.putSign(r.getID(), s.getLocation());
}
}
}
public void updateSign() {
Sign sign = (Sign) this.signLocation.getBlock().getState();
String[] signLines = this.getSignLines();
for (int i = 0; i < signLines.length; i++) {
sign.setLine(i, signLines[i]);
}
sign.update(true, true);
}
/**
* Clears signs
*/
public void update() {
int y = -1 * verticalSigns;
while (startSign.getRelative(0, y + 1, 0).getState() instanceof Sign && y != 0) {
Sign subsign = (Sign) startSign.getRelative(0, y + 1, 0).getState();
subsign.setLine(0, "");
subsign.setLine(1, "");
subsign.setLine(2, "");
subsign.setLine(3, "");
subsign.update();
y++;
}
}
@SuppressWarnings("deprecation")
public void update(Map<String, Statistic> statistics, boolean forceBlocks, boolean delete) {
BlockFace2D rightDir = direction.right();
BlockFace2D leftDir = direction.left();
BlockFace rightFace = rightDir.getBlockFace3D();
BlockFace leftFace = leftDir.getBlockFace3D();
Block baseBlock = baseLocation.getBlock();
if (delete) {
baseBlock.setType(Material.AIR);
}
SignLayout layout = layoutConfig.getLayout();
Iterator<Entry<String, Statistic>> iterator = statistics != null ? statistics.entrySet().iterator() : null;
for (int i = 0; i < size.getStatisticAmount(); i++) {
Entry<String, Statistic> entry = iterator != null && iterator.hasNext() ? iterator.next() : null;
Block position = null;
Material type = null;
switch (i) {
case 0:
//Top
position = baseBlock.getRelative(BlockFace.UP);
type = Material.DIAMOND_BLOCK;
break;
case 1:
//First left
position = baseBlock.getRelative(leftFace);
type = Material.GOLD_BLOCK;
break;
case 2:
//First right
position = baseBlock.getRelative(rightFace);
type = Material.IRON_BLOCK;
break;
case 3:
//Second left
position = baseBlock.getRelative(leftFace, 2);
type = Material.DOUBLE_STEP;
break;
case 4:
//Second right
position = baseBlock.getRelative(rightFace, 2);
type = Material.DOUBLE_STEP;
break;
}
if (position == null) {
continue;
}
Block signBlock = position.getRelative(direction.getBlockFace3D());
Block skullBlock = position.getRelative(BlockFace.UP);
if (delete) {
signBlock.setType(Material.AIR);
skullBlock.setType(Material.AIR);
position.setType(Material.AIR);
continue;
}
if (baseBlock.getType() == Material.AIR || forceBlocks) {
baseBlock.setType(Material.DOUBLE_STEP);
}
if (position.getType() == Material.AIR || forceBlocks) {
position.setType(type);
}
if (entry == null) {
continue;
}
/* For legacy reasons and compatibility */
signBlock.setTypeId(Material.WALL_SIGN.getId(), false);
skullBlock.setTypeId(Material.SKULL.getId(), false);
Skull skull = (Skull) skullBlock.getState();
skull.setRotation(direction.getBlockFace3D());
skull.setSkullType(SkullType.PLAYER);
skull.setOwner(entry.getKey());
skull.setRawData(SKULL_ON_FLOOR);
skull.update(true, false);
Sign sign = (Sign) signBlock.getState();
Set<Variable> variables = Sets.newHashSet();
entry.getValue().supply(variables, null);
variables.add(new Variable("player", entry.getKey()));
variables.add(new Variable("rank", i + 1));
layout.inflate(sign, variables);
org.bukkit.material.Sign data = new org.bukkit.material.Sign(Material.WALL_SIGN);
data.setFacingDirection(direction.getBlockFace3D());
sign.setData(data);
sign.update();
}
}
private void updateSignFromChestSync(Location chestLoc, Location signLoc, Challenge challenge, List<ItemStack> requiredItems, boolean challengeLocked) {
Block chestBlock = chestLoc.getBlock();
Block signBlock = signLoc != null ? signLoc.getBlock() : null;
if (chestBlock != null && signBlock != null
&& isChest(chestBlock)
&& signBlock.getType() == SkyBlockMenu.WALL_SIGN_MATERIAL && signBlock.getState() instanceof Sign
) {
Sign sign = (Sign) signBlock.getState();
Chest chest = (Chest) chestBlock.getState();
int missing = -1;
if (!requiredItems.isEmpty() && !challengeLocked) {
missing = 0;
for (ItemStack required : requiredItems) {
if (!chest.getInventory().containsAtLeast(required, required.getAmount())) {
// Max shouldn't be needed, provided containsAtLeast matches getCountOf... but it might not
missing += Math.max(0, required.getAmount() - plugin.getChallengeLogic().getCountOf(chest.getInventory(), required));
}
}
}
String format = "\u00a72\u00a7l";
if (missing > 0) {
format = "\u00a74\u00a7l";
}
List<String> lines = wordWrap(challenge.getDisplayName(), SIGN_LINE_WIDTH, SIGN_LINE_WIDTH);
if (challengeLocked) {
lines.add(tr("\u00a74\u00a7lLocked Challenge"));
} else {
lines.addAll(wordWrap(challenge.getDescription(), SIGN_LINE_WIDTH, SIGN_LINE_WIDTH));
}
for (int i = 0; i < 3; i++) {
if (i < lines.size()) {
sign.setLine(i, lines.get(i));
} else {
sign.setLine(i, "");
}
}
if (missing > 0) {
sign.setLine(3, format + missing);
} else if (missing == 0) {
sign.setLine(3, format + tr("READY"));
} else if (lines.size() > 3) {
sign.setLine(3, lines.get(3));
} else {
sign.setLine(3, "");
}
if (!sign.update()) {
log.info("Unable to update sign at " + LocationUtil.asString(signLoc));
}
}
}
/**
* Paste this block at blockLoc
* @param nms
* @param blockLoc
*/
//@SuppressWarnings("deprecation")
@SuppressWarnings("deprecation")
public void paste(NMSAbstraction nms, Location blockLoc, boolean usePhysics, Biome biome) {
// Only paste air if it is below the sea level and in the overworld
Block block = new Location(blockLoc.getWorld(), x, y, z).add(blockLoc).getBlock();
block.setBiome(biome);
nms.setBlockSuperFast(block, typeId, data, usePhysics);
if (signText != null) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
// Sign
Sign sign = (Sign) block.getState();
int index = 0;
for (String line : signText) {
sign.setLine(index++, line);
}
sign.update(true, false);
} else if (banner != null) {
banner.set(block);
} else if (skull != null){
skull.set(block);
} else if (pot != null){
pot.set(nms, block);
} else if (spawnerBlockType != null) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
CreatureSpawner cs = (CreatureSpawner)block.getState();
cs.setSpawnedType(spawnerBlockType);
//Bukkit.getLogger().info("DEBUG: setting spawner");
cs.update(true, false);
} else if (!chestContents.isEmpty()) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
//Bukkit.getLogger().info("DEBUG: inventory holder "+ block.getType());
// Check if this is a double chest
InventoryHolder chestBlock = (InventoryHolder) block.getState();
//InventoryHolder iH = chestBlock.getInventory().getHolder();
if (chestBlock instanceof DoubleChest) {
//Bukkit.getLogger().info("DEBUG: double chest");
DoubleChest doubleChest = (DoubleChest) chestBlock;
for (ItemStack chestItem: chestContents.values()) {
doubleChest.getInventory().addItem(chestItem);
}
} else {
// Single chest
for (Entry<Byte, ItemStack> en : chestContents.entrySet()) {
//Bukkit.getLogger().info("DEBUG: " + en.getKey() + "," + en.getValue());
chestBlock.getInventory().setItem(en.getKey(), en.getValue());
}
}
}
}
@EventHandler
public void onCustomEvent(RegionTickEvent event) {
if (!event.getRegion().getEffects().containsKey(KEY) || !event.isHasUpkeep()) {
return;
}
Region region = event.getRegion();
Location l = region.getLocation();
String damageString = region.getEffects().get(KEY);
int damage = 1;
if (damageString != null) {
damage = Integer.parseInt(damageString);
}
//Check if valid siege machine position
if (l.getBlock().getY() + 2 < l.getWorld().getHighestBlockAt(l).getY()) {
return;
}
Block b = l.getBlock().getRelative(BlockFace.UP);
BlockState state = b.getState();
if (!(state instanceof Sign)) {
return;
}
//Find target Super-region
Sign sign = (Sign) state;
String townName = sign.getLine(0);
Town town = TownManager.getInstance().getTown(townName);
if (town == null) {
for (Town currentTown : TownManager.getInstance().getTowns()) {
if (currentTown.getName().startsWith(townName)) {
town = currentTown;
break;
}
}
if (town == null) {
sign.setLine(2, "invalid name");
sign.update();
return;
}
}
//Check if too far away
TownType townType = (TownType) ItemManager.getInstance().getItemType(town.getType());
double rawRadius = townType.getBuildRadius();
try {
if (town.getLocation().distance(l) - rawRadius > 150) {
sign.setLine(2, "out of");
sign.setLine(3, "range");
sign.update();
return;
}
} catch (IllegalArgumentException iae) {
sign.setLine(2, "out of");
sign.setLine(3, "range");
sign.update();
return;
}
if (town.getPower() < 1) {
return;
}
Location spawnLoc = l.getBlock().getRelative(BlockFace.UP, 3).getLocation();
Location loc = new Location(spawnLoc.getWorld(), spawnLoc.getX(), spawnLoc.getY() + 15, spawnLoc.getZ());
final Location loc1 = new Location(spawnLoc.getWorld(), spawnLoc.getX(), spawnLoc.getY() + 20, spawnLoc.getZ());
final Location loc2 = new Location(spawnLoc.getWorld(), spawnLoc.getX(), spawnLoc.getY() + 25, spawnLoc.getZ());
final Location loc3 = new Location(spawnLoc.getWorld(), spawnLoc.getX(), spawnLoc.getY() + 30, spawnLoc.getZ());
l.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, loc, 2);
l.getWorld().playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Civs.getInstance(), new Runnable() {
@Override
public void run() {
loc1.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, loc1, 2);
loc1.getWorld().playSound(loc1, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
}
}, 5L);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Civs.getInstance(), new Runnable() {
@Override
public void run() {
loc2.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, loc2, 2);
loc2.getWorld().playSound(loc2, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
}
}, 10L);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Civs.getInstance(), new Runnable() {
@Override
public void run() {
loc3.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, loc3, 2);
loc3.getWorld().playSound(loc3, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
}
}, 15L);
TownManager.getInstance().setTownPower(town, town.getPower() - damage);
}
@Override
public boolean createRegionHandler(Block block, Player player, RegionType regionType) {
if (!regionType.getEffects().containsKey(KEY) &&
!regionType.getEffects().containsKey(CHARGING_KEY)) {
return true;
}
Location l = Region.idToLocation(Region.blockLocationToString(block.getLocation()));
Civilian civilian = CivilianManager.getInstance().getCivilian(player.getUniqueId());
Block b = l.getBlock().getRelative(BlockFace.UP);
BlockState state = b.getState();
if (!(state instanceof Sign)) {
player.sendMessage(Civs.getPrefix() + LocaleManager.getInstance()
.getTranslation(civilian.getLocale(), "raid-sign"));
return false;
}
if (l.getBlock().getY() + 2 < l.getWorld().getHighestBlockAt(l).getY()) {
player.sendMessage(Civs.getPrefix() + LocaleManager.getInstance().getTranslation(civilian.getLocale(),
"no-blocks-above-chest").replace("$1", regionType.getName()));
return false;
}
//Find target Super-region
Sign sign = (Sign) state;
String townName = sign.getLine(0);
Town town = TownManager.getInstance().getTown(townName);
if (town == null) {
for (Town cTown : TownManager.getInstance().getTowns()) {
if (cTown.getName().toLowerCase().startsWith(sign.getLine(0))) {
town = cTown;
break;
}
}
}
if (town == null) {
sign.setLine(0, "invalid target");
sign.update();
player.sendMessage(Civs.getPrefix() + LocaleManager.getInstance()
.getTranslation(civilian.getLocale(), "raid-sign"));
return false;
} else {
sign.setLine(0, town.getName());
sign.update();
}
TownType townType = (TownType) ItemManager.getInstance().getItemType(town.getType());
double rawRadius = townType.getBuildRadius();
if (town.getLocation().distance(l) - rawRadius > 150) {
sign.setLine(2, "out of");
sign.setLine(3, "range");
sign.update();
return false;
}
for (Player p : Bukkit.getOnlinePlayers()) {
Civilian civ = CivilianManager.getInstance().getCivilian(p.getUniqueId());
String siegeMachineLocalName = LocaleManager.getInstance().getTranslation(civ.getLocale(), regionType.getProcessedName() + "-name");
p.sendMessage(Civs.getPrefix() + ChatColor.RED + LocaleManager.getInstance().getTranslation(
civ.getLocale(), "siege-built").replace("$1", player.getDisplayName())
.replace("$2", siegeMachineLocalName).replace("$3", town.getName()));
}
if (Civs.discordSRV != null) {
String siegeLocalName = LocaleManager.getInstance().getTranslation(ConfigManager.getInstance().getDefaultLanguage(),
regionType.getProcessedName() + "-name");
String defaultMessage = Civs.getPrefix() + ChatColor.RED + LocaleManager.getInstance().getTranslation(
ConfigManager.getInstance().getDefaultLanguage(), "siege-built").replace("$1", player.getDisplayName())
.replace("$2", siegeLocalName).replace("$3", town.getName());
defaultMessage += DiscordUtil.atAllTownOwners(town);
DiscordUtil.sendMessageToMainChannel(defaultMessage);
}
return true;
}
private static void restoreBlockFromString(String line) {
String[] split = line.split(":");
int type = Integer.valueOf(split[0]);
byte data = Byte.valueOf(split[1]);
int x = Integer.valueOf(split[2]);
int y = Integer.valueOf(split[3]);
int z = Integer.valueOf(split[4]);
String world = split[5];
Block block = BukkitObjects.getWorld(world).getBlockAt(x,y,z);
ItemManager.setTypeId(block, type);
ItemManager.setData(block, data, false);
// End of basic block info, try to get more now.
Inventory inv = null;
switch (block.getType()) {
case TRAPPED_CHEST:
inv = ((Chest)block.getState()).getBlockInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case CHEST:
inv = ((Chest)block.getState()).getBlockInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case DISPENSER:
inv = ((Dispenser)block.getState()).getInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case BURNING_FURNACE:
case FURNACE:
inv = ((Furnace)block.getState()).getInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case DROPPER:
inv = ((Dropper)block.getState()).getInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case HOPPER:
inv = ((Hopper)block.getState()).getInventory();
InventorySerializer.StringToInventory(inv, split[6]);
break;
case SIGN:
case SIGN_POST:
case WALL_SIGN:
Sign sign = (Sign)block.getState();
String[] messages = split[6].split(",");
for (int i = 0; i < 4; i++) {
if (messages[i] != null) {
sign.setLine(i, messages[i]);
}
}
sign.update();
break;
default:
break;
}
}