Easier access to platform actor in CraftScripts
octylFractal opened this issue ยท 0 comments
Is your feature request related to a problem? Please describe.
The player object passed to craftscripts is not of the native platform type, so calling e.g. BukkitAdapter.adapt(player)
results in a ClassCastException
. In order to acquire a reference to the platform's CommandSender
, you must either call Platform.matchPlayer
or directly out to the native platform code (e.g. Server.getPlayer(String)
), which is un-intuitive.
Describe the solution you'd like
Calling the adapter should "work" if possible, by routing through Platform.matchPlayer
, OR the local player should be un-proxied (CraftScripts don't need the proxy benefits I think), OR there should be an easy function for CraftScripts to call to acquire the native player.
Describe alternatives you've considered
See above problem description (Platform.matchPlayer
/Server.getPlayer
).