@Override public void sendSignChange(Location loc, String[] lines) { if (getHandle().playerNetServerHandler == null) { return; } if (lines == null) { lines = new String[4]; } Validate.notNull(loc, "Location can not be null"); if (lines.length < 4) { throw new IllegalArgumentException("Must have at least 4 lines"); } // Limit to 15 chars per line and set null lines to blank String[] astring = CraftSign.sanitizeLines(lines); getHandle().playerNetServerHandler.sendPacket(new S33PacketUpdateSign(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), astring)); }
@Override public void sendSignChange(Location loc, String[] lines) { if (getHandle().playerConnection == null) { return; } if (lines == null) { lines = new String[4]; } Validate.notNull(loc, "Location can not be null"); if (lines.length < 4) { throw new IllegalArgumentException("Must have at least 4 lines"); } // Limit to 15 chars per line and set null lines to blank String[] astring = CraftSign.sanitizeLines(lines); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateSign(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), astring)); }
@Override public void sendSignChange(Location loc, String[] lines) { if (getHandle().playerConnection == null) { return; } if (lines == null) { lines = new String[4]; } Validate.notNull(loc, "Location can not be null"); if (lines.length < 4) { throw new IllegalArgumentException("Must have at least 4 lines"); } IChatBaseComponent[] components = CraftSign.sanitizeLines(lines); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateSign(getHandle().world, new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), components)); }
@Override public void sendSignChange(Location loc, String[] lines) { if (getHandle().playerConnection == null) { return; } if (lines == null) { lines = new String[4]; } Validate.notNull(loc, "Location can not be null"); if (lines.length < 4) { throw new IllegalArgumentException("Must have at least 4 lines"); } IChatBaseComponent[] components = CraftSign.sanitizeLines(lines); TileEntitySign sign = new TileEntitySign(); sign.a(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); // PAIL: rename System.arraycopy(components, 0, sign.lines, 0, sign.lines.length); getHandle().playerConnection.sendPacket(sign.getUpdatePacket()); }