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


Java S33PacketUpdateSign类代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S33PacketUpdateSign的典型用法代码示例。如果您正苦于以下问题:Java S33PacketUpdateSign类的具体用法?Java S33PacketUpdateSign怎么用?Java S33PacketUpdateSign使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


S33PacketUpdateSign类属于net.minecraft.network.play.server包,在下文中一共展示了S33PacketUpdateSign类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendSignChange

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的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: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Updates a specified sign with the specified text lines
 */
public void handleUpdateSign(S33PacketUpdateSign packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	boolean flag = false;

	if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
		TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());

		if (tileentity instanceof TileEntitySign) {
			TileEntitySign tileentitysign = (TileEntitySign) tileentity;

			if (tileentitysign.getIsEditable()) {
				System.arraycopy(packetIn.getLines(), 0, tileentitysign.signText, 0, 4);
				tileentitysign.markDirty();
			}

			flag = true;
		}
	}

	if (!flag && this.gameController.thePlayer != null) {
		this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at "
				+ packetIn.getPos().getX() + ", " + packetIn.getPos().getY() + ", " + packetIn.getPos().getZ()));
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:NetHandlerPlayClient.java

示例3: getDescriptionPacket

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
public Packet getDescriptionPacket()
{
    String[] astring = new String[4];

    // CraftBukkit start - Limit sign text to 15 chars per line
    for (int i = 0; i < 4; ++i)
    {
        astring[i] = this.signText[i];

        if (this.signText[i].length() > 15)
        {
            astring[i] = this.signText[i].substring(0, 15);
        }
    }

    // CraftBukkit end
    return new S33PacketUpdateSign(this.xCoord, this.yCoord, this.zCoord, astring);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:19,代码来源:TileEntitySign.java

示例4: getDescriptionPacket

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    IChatComponent[] aichatcomponent = new IChatComponent[4];
    System.arraycopy(this.signText, 0, aichatcomponent, 0, 4);
    return new S33PacketUpdateSign(this.worldObj, this.pos, aichatcomponent);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:TileEntitySign.java

示例5: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Updates a specified sign with the specified text lines
 */
public void handleUpdateSign(S33PacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    boolean flag = false;

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());

        if (tileentity instanceof TileEntitySign)
        {
            TileEntitySign tileentitysign = (TileEntitySign)tileentity;

            if (tileentitysign.getIsEditable())
            {
                System.arraycopy(packetIn.getLines(), 0, tileentitysign.signText, 0, 4);
                tileentitysign.markDirty();
            }

            flag = true;
        }
    }

    if (!flag && this.gameController.thePlayer != null)
    {
        this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + packetIn.getPos().getX() + ", " + packetIn.getPos().getY() + ", " + packetIn.getPos().getZ()));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:NetHandlerPlayClient.java

示例6: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Updates a specified sign with the specified text lines
 */
public void handleUpdateSign(S33PacketUpdateSign p_147248_1_)
{
    boolean var2 = false;

    if (this.gameController.theWorld.blockExists(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e()))
    {
        TileEntity var3 = this.gameController.theWorld.getTileEntity(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e());

        if (var3 instanceof TileEntitySign)
        {
            TileEntitySign var4 = (TileEntitySign)var3;

            if (var4.func_145914_a())
            {
                for (int var5 = 0; var5 < 4; ++var5)
                {
                    var4.field_145915_a[var5] = p_147248_1_.func_149347_f()[var5];
                }

                var4.onInventoryChanged();
            }

            var2 = true;
        }
    }

    if (!var2 && this.gameController.thePlayer != null)
    {
        this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + p_147248_1_.func_149346_c() + ", " + p_147248_1_.func_149345_d() + ", " + p_147248_1_.func_149344_e()));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:35,代码来源:NetHandlerPlayClient.java

示例7: getDescriptionPacket

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    String[] var1 = new String[4];
    System.arraycopy(this.field_145915_a, 0, var1, 0, 4);
    return new S33PacketUpdateSign(this.field_145851_c, this.field_145848_d, this.field_145849_e, var1);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:TileEntitySign.java

示例8: updateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
@Override
public Packet updateSign(int x, int y, int z, String[] text) {
    final List<ChatComponentText> texts = Lists.newArrayList();

    for (String t : text) {
        texts.add(new ChatComponentText(t));
    }

    return (Packet) new S33PacketUpdateSign(null, new BlockPos(x, y, z), texts.toArray(new ChatComponentText[texts.size()]));
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:11,代码来源:NeptunePacketFactory.java

示例9: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
public void handleUpdateSign(S33PacketUpdateSign p_147248_1_)
{
    boolean flag = false;

    if (this.gameController.theWorld.blockExists(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e());

        if (tileentity instanceof TileEntitySign)
        {
            TileEntitySign tileentitysign = (TileEntitySign)tileentity;

            if (tileentitysign.func_145914_a())
            {
                for (int i = 0; i < 4; ++i)
                {
                    tileentitysign.signText[i] = p_147248_1_.func_149347_f()[i];
                }

                tileentitysign.markDirty();
            }

            flag = true;
        }
    }

    if (!flag && this.gameController.thePlayer != null)
    {
        this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + p_147248_1_.func_149346_c() + ", " + p_147248_1_.func_149345_d() + ", " + p_147248_1_.func_149344_e()));
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:32,代码来源:NetHandlerPlayClient.java

示例10: getDescriptionPacket

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
public Packet getDescriptionPacket()
{
    String[] astring = new String[4];
    System.arraycopy(this.signText, 0, astring, 0, 4);
    return new S33PacketUpdateSign(this.xCoord, this.yCoord, this.zCoord, astring);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:TileEntitySign.java

示例11: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Updates a specified sign with the specified text lines
 */
void handleUpdateSign(S33PacketUpdateSign packetIn);
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:INetHandlerPlayClient.java

示例12: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
 * Updates a specified sign with the specified text lines
 */
void handleUpdateSign(S33PacketUpdateSign var1);
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:INetHandlerPlayClient.java

示例13: handleUpdateSign

import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
void handleUpdateSign(S33PacketUpdateSign p_147248_1_); 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerPlayClient.java


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