Setting and getting WE selection from Sponge - am I doing it right?

Discussion in 'Programming Help' started by VcSaJen, Mar 21, 2016.

  1. VcSaJen

    VcSaJen New Member

    My current code is working, but it converts between Sponge and WE types by using String names of players and worlds, I'm not sure it's a good thing. Also, it sends a command from user's name: a dirty hack for non-updating WE CUI selection; I'm not sure how to do it without it and not depending on one particular WE implementation.
  2. wizjany

    wizjany Administrator Developer

    yea you are basically stuck with strings unless you want to work on a specific worldedit implementation. at the moment the sponge implementation is still WIP so that would mean tossing around forge EntityPlayerMP objects, which isn't ideal.
    when the sponge implementation is ready, you will probably want to switch to using sponge objects directly.

    as for the cui, you should ideally be using the describeCUI method in localsession, although that requires an actor object which probably isn't easy to get without some trickery.