EngineHub / EngineHub/WorldEdit

Easier access to platform actor in CraftScripts

Open
#1,311 0 comments 0 reactions 0 assignees View on GitHub
status:accepted type:feature-request
Dominant language
Java
Stars
3.5k
Forks
960
Avg merge
6h 57m
Merged PRs (30d)
1

Description

**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`).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.