コード例 #1
0
  public void func_72487_a(Packet130UpdateSign p_72487_1_) {
    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()) {
          this.field_72573_d.func_71236_h(
              "Player "
                  + this.field_72574_e.field_71092_bJ
                  + " just tried to change non-editable sign");
          return;
        }
      }

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

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

      if (var3 instanceof TileEntitySign) {
        var5 = p_72487_1_.field_73311_a;
        int var9 = p_72487_1_.field_73309_b;
        var8 = 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(var5, var9, var8);
      }
    }
  }
コード例 #2
0
  public void handleUpdateSign(Packet130UpdateSign var1) {
    if (this.mc.theWorld.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) {
      TileEntity var2 =
          this.mc.theWorld.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition);
      if (var2 instanceof TileEntitySign) {
        TileEntitySign var3 = (TileEntitySign) var2;

        for (int var4 = 0; var4 < 4; ++var4) {
          var3.signText[var4] = var1.signLines[var4];
        }

        var3.onInventoryChanged();

        // Spout start
        var3.recalculateText();
        // Spout end
      }
    }
  }