Inter Plug-In Communication

  • 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:


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

    OR

    Code
    Integer value1 = (Integer)player.getAttribute("PlayerTestMoney");
    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

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!