Inter Plug-In Communication

  • English

We've posted an important announcement regarding the current situation and the future of the game: Announcement

  • Hmmm... in line 6 of plug-in A, the attribute value is set to an Integer and in line 1 of plug-in B the retrieved Integer value is cast to a String.

    In fact, I have not clear if such a cast makes sense. Maybe, it is supposed to work, but to be surer, I would retrieve the value as an Integer and either use Integer.toString() in line 3 of plug-in B to convert it to a String or, if you feel lazy, rely in the implicit conversion:

    Source Code

    1. Integer value1 = (Integer)player.getAttribute("PlayerTestMoney");
    2. player.sendTextMessage("Show the Value:" + value1.toString());
    OR

    Source Code

    1. Integer value1 = (Integer)player.getAttribute("PlayerTestMoney");
    2. player.sendTextMessage("Show the Value:" + value1);
    I would prefer to first; also, chances are that sooner or later I'll need a more elaborate String.format() in the message to the player.

    EDIT: Oh well, cross-posting...! 8o
    __________
    My plug-ins: Planks 'n Beams, GPS, UPS, Weather control, Plugin Central, RWGui (GUI back-end), Bank (Money back end)