当前位置: 首页>>代码示例>>Java>>正文


Java CraftSign类代码示例

本文整理汇总了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));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:21,代码来源:CraftPlayer.java

示例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));
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:21,代码来源:CraftPlayer.java

示例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));
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:20,代码来源:CraftPlayer.java

示例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());
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:23,代码来源:CraftPlayer.java


注:本文中的org.bukkit.craftbukkit.block.CraftSign类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。