本文整理汇总了Java中org.bukkit.craftbukkit.block.CraftSign类的典型用法代码示例。如果您正苦于以下问题:Java CraftSign类的具体用法?Java CraftSign怎么用?Java CraftSign使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CraftSign类属于org.bukkit.craftbukkit.block包,在下文中一共展示了CraftSign类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendSignChange
import org.bukkit.craftbukkit.block.CraftSign; //导入依赖的package包/类
@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));
}
示例2: sendSignChange
import org.bukkit.craftbukkit.block.CraftSign; //导入依赖的package包/类
@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));
}
示例3: sendSignChange
import org.bukkit.craftbukkit.block.CraftSign; //导入依赖的package包/类
@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));
}
示例4: sendSignChange
import org.bukkit.craftbukkit.block.CraftSign; //导入依赖的package包/类
@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());
}