Java 类net.minecraft.network.packet.Packet130UpdateSign 实例源码

项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72487_a(Packet130UpdateSign p_72487_1_) {
   boolean var2 = false;
   if(this.field_72563_h.field_71441_e.func_72899_e(p_72487_1_.field_73311_a, p_72487_1_.field_73309_b, p_72487_1_.field_73310_c)) {
      TileEntity var3 = this.field_72563_h.field_71441_e.func_72796_p(p_72487_1_.field_73311_a, p_72487_1_.field_73309_b, p_72487_1_.field_73310_c);
      if(var3 instanceof TileEntitySign) {
         TileEntitySign var4 = (TileEntitySign)var3;
         if(var4.func_70409_a()) {
            for(int var5 = 0; var5 < 4; ++var5) {
               var4.field_70412_a[var5] = p_72487_1_.field_73308_d[var5];
            }

            var4.func_70296_d();
         }

         var2 = true;
      }
   }

   if(!var2 && this.field_72563_h.field_71439_g != null) {
      this.field_72563_h.field_71439_g.func_70006_a(ChatMessageComponent.func_111066_d("Unable to locate sign at " + p_72487_1_.field_73311_a + ", " + p_72487_1_.field_73309_b + ", " + p_72487_1_.field_73310_c));
   }

}
项目:RuneCraftery    文件:GuiEditSign.java   
public void func_73874_b() {
   Keyboard.enableRepeatEvents(false);
   NetClientHandler var1 = this.field_73882_e.func_71391_r();
   if(var1 != null) {
      var1.func_72552_c(new Packet130UpdateSign(this.field_73982_c.field_70329_l, this.field_73982_c.field_70330_m, this.field_73982_c.field_70327_n, this.field_73982_c.field_70412_a));
   }

   this.field_73982_c.func_70408_a(true);
}
项目:RuneCraftery    文件:NetClientHandler.java   
/**
 * Updates Client side signs
 */
public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
{
    boolean flag = false;

    if (this.mc.theWorld.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition))
    {
        TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition);

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

            if (tileentitysign.isEditable())
            {
                for (int i = 0; i < 4; ++i)
                {
                    tileentitysign.signText[i] = par1Packet130UpdateSign.signLines[i];
                }

                tileentitysign.onInventoryChanged();
            }

            flag = true;
        }
    }

    if (!flag && this.mc.thePlayer != null)
    {
        this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + par1Packet130UpdateSign.xPosition + ", " + par1Packet130UpdateSign.yPosition + ", " + par1Packet130UpdateSign.zPosition));
    }
}
项目:RuneCraftery    文件:GuiEditSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetClientHandler netclienthandler = this.mc.getNetHandler();

    if (netclienthandler != null)
    {
        netclienthandler.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText));
    }

    this.entitySign.setEditable(true);
}
项目:RuneCraftery    文件:TileEntitySign.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    String[] astring = new String[4];
    System.arraycopy(this.signText, 0, astring, 0, 4);
    return new Packet130UpdateSign(this.xCoord, this.yCoord, this.zCoord, astring);
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
/**
 * Updates Client side signs
 */
public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
{
    boolean flag = false;

    if (this.mc.theWorld.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition))
    {
        TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition);

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

            if (tileentitysign.isEditable())
            {
                for (int i = 0; i < 4; ++i)
                {
                    tileentitysign.signText[i] = par1Packet130UpdateSign.signLines[i];
                }

                tileentitysign.onInventoryChanged();
            }

            flag = true;
        }
    }

    if (!flag && this.mc.thePlayer != null)
    {
        this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + par1Packet130UpdateSign.xPosition + ", " + par1Packet130UpdateSign.yPosition + ", " + par1Packet130UpdateSign.zPosition));
    }
}
项目:BetterNutritionMod    文件:GuiEditSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetClientHandler netclienthandler = this.mc.getNetHandler();

    if (netclienthandler != null)
    {
        netclienthandler.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText));
    }

    this.entitySign.setEditable(true);
}
项目:BetterNutritionMod    文件:TileEntitySign.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    String[] astring = new String[4];
    System.arraycopy(this.signText, 0, astring, 0, 4);
    return new Packet130UpdateSign(this.xCoord, this.yCoord, this.zCoord, astring);
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
{
    nch.handleUpdateSign(par1Packet130UpdateSign);      
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72487_a(Packet130UpdateSign p_72487_1_) {
   this.func_72509_a(p_72487_1_);
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72487_a(Packet130UpdateSign p_72487_1_) {
   this.field_72574_e.func_143004_u();
   WorldServer var2 = this.field_72573_d.func_71218_a(this.field_72574_e.field_71093_bK);
   if(var2.func_72899_e(p_72487_1_.field_73311_a, p_72487_1_.field_73309_b, p_72487_1_.field_73310_c)) {
      TileEntity var3 = var2.func_72796_p(p_72487_1_.field_73311_a, p_72487_1_.field_73309_b, p_72487_1_.field_73310_c);
      if(var3 instanceof TileEntitySign) {
         TileEntitySign var4 = (TileEntitySign)var3;
         if(!var4.func_70409_a() || var4.func_142009_b() != this.field_72574_e) {
            this.field_72573_d.func_71236_h("Player " + this.field_72574_e.func_70005_c_() + " just tried to change non-editable sign");
            return;
         }
      }

      int var6;
      int var8;
      for(var8 = 0; var8 < 4; ++var8) {
         boolean var5 = true;
         if(p_72487_1_.field_73308_d[var8].length() > 15) {
            var5 = false;
         } else {
            for(var6 = 0; var6 < p_72487_1_.field_73308_d[var8].length(); ++var6) {
               if(ChatAllowedCharacters.field_71568_a.indexOf(p_72487_1_.field_73308_d[var8].charAt(var6)) < 0) {
                  var5 = false;
               }
            }
         }

         if(!var5) {
            p_72487_1_.field_73308_d[var8] = "!?";
         }
      }

      if(var3 instanceof TileEntitySign) {
         var8 = p_72487_1_.field_73311_a;
         int var9 = p_72487_1_.field_73309_b;
         var6 = p_72487_1_.field_73310_c;
         TileEntitySign var7 = (TileEntitySign)var3;
         System.arraycopy(p_72487_1_.field_73308_d, 0, var7.field_70412_a, 0, 4);
         var7.func_70296_d();
         var2.func_72845_h(var8, var9, var6);
      }
   }

}
项目:RuneCraftery    文件:TileEntitySign.java   
public Packet func_70319_e() {
   String[] var1 = new String[4];
   System.arraycopy(this.field_70412_a, 0, var1, 0, 4);
   return new Packet130UpdateSign(this.field_70329_l, this.field_70330_m, this.field_70327_n, var1);
}
项目:RuneCraftery    文件:NetServerHandler.java   
/**
 * Updates Client side signs
 */
public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
{
    this.playerEntity.func_143004_u();
    WorldServer worldserver = this.mcServer.worldServerForDimension(this.playerEntity.dimension);

    if (worldserver.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition))
    {
        TileEntity tileentity = worldserver.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition);

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

            if (!tileentitysign.isEditable() || tileentitysign.func_142009_b() != this.playerEntity)
            {
                this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
                return;
            }
        }

        int i;
        int j;

        for (j = 0; j < 4; ++j)
        {
            boolean flag = true;

            if (par1Packet130UpdateSign.signLines[j].length() > 15)
            {
                flag = false;
            }
            else
            {
                for (i = 0; i < par1Packet130UpdateSign.signLines[j].length(); ++i)
                {
                    if (ChatAllowedCharacters.allowedCharacters.indexOf(par1Packet130UpdateSign.signLines[j].charAt(i)) < 0)
                    {
                        flag = false;
                    }
                }
            }

            if (!flag)
            {
                par1Packet130UpdateSign.signLines[j] = "!?";
            }
        }

        if (tileentity instanceof TileEntitySign)
        {
            j = par1Packet130UpdateSign.xPosition;
            int k = par1Packet130UpdateSign.yPosition;
            i = par1Packet130UpdateSign.zPosition;
            TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
            System.arraycopy(par1Packet130UpdateSign.signLines, 0, tileentitysign1.signText, 0, 4);
            tileentitysign1.onInventoryChanged();
            worldserver.markBlockForUpdate(j, k, i);
        }
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
/**
 * Updates Client side signs
 */
public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
{
    this.playerEntity.func_143004_u();
    WorldServer worldserver = this.mcServer.worldServerForDimension(this.playerEntity.dimension);

    if (worldserver.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition))
    {
        TileEntity tileentity = worldserver.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition);

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

            if (!tileentitysign.isEditable() || tileentitysign.func_142009_b() != this.playerEntity)
            {
                this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
                return;
            }
        }

        int i;
        int j;

        for (j = 0; j < 4; ++j)
        {
            boolean flag = true;

            if (par1Packet130UpdateSign.signLines[j].length() > 15)
            {
                flag = false;
            }
            else
            {
                for (i = 0; i < par1Packet130UpdateSign.signLines[j].length(); ++i)
                {
                    if (ChatAllowedCharacters.allowedCharacters.indexOf(par1Packet130UpdateSign.signLines[j].charAt(i)) < 0)
                    {
                        flag = false;
                    }
                }
            }

            if (!flag)
            {
                par1Packet130UpdateSign.signLines[j] = "!?";
            }
        }

        if (tileentity instanceof TileEntitySign)
        {
            j = par1Packet130UpdateSign.xPosition;
            int k = par1Packet130UpdateSign.yPosition;
            i = par1Packet130UpdateSign.zPosition;
            TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
            System.arraycopy(par1Packet130UpdateSign.signLines, 0, tileentitysign1.signText, 0, 4);
            tileentitysign1.onInventoryChanged();
            worldserver.markBlockForUpdate(j, k, i);
        }
    }
}