本文整理汇总了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));
}
示例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()));
}
}
示例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);
}
示例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);
}
示例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()));
}
}
示例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()));
}
}
示例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);
}
示例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()]));
}
示例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()));
}
}
示例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);
}
示例11: handleUpdateSign
import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
* Updates a specified sign with the specified text lines
*/
void handleUpdateSign(S33PacketUpdateSign packetIn);
示例12: handleUpdateSign
import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
/**
* Updates a specified sign with the specified text lines
*/
void handleUpdateSign(S33PacketUpdateSign var1);
示例13: handleUpdateSign
import net.minecraft.network.play.server.S33PacketUpdateSign; //导入依赖的package包/类
void handleUpdateSign(S33PacketUpdateSign p_147248_1_);