satoshinm / WebSandboxMC

Bukkit plugin providing a web-based interface with an interactive WebGL 3D preview or glimpse of your server 🕷⏳📦 ⛺
https://www.spigotmc.org/resources/websandboxmc.39415/
MIT License
19 stars 5 forks source link

Remove all usage of deprecated Bukkit API - signs #66

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago

BlockBridge translating blocks uses deprecated byte getData() methods, and it cumbersomely does not translate block sub-types easily despite this. The entire system may benefit from rethinking. Maybe a switch on Material (ok to hardcode since is intimately tied with the web client), then inside each case, get BlockState and cast and check subtypes.

Needed to support long grass subtypes: fern, and saplings besides oak: spruce, birch, and more types of leaves/wood, and other types of stone bricks besides smooth: mossy, cracked. Basically a lot of blocks need this, not only wool, so a better solution ought to be developed.

satoshinm commented 7 years ago

One concern is backwards-compatibility, to allow new materials added in newer versions to not break compatibility on older servers. Referencing undefined enum values will throw exceptions, but I tested against a 1.7.10 server switching on a Material with SEA_LANTERN as one of the case values (added in 1.8), and it didn't throw. So I think this should be feasible.

satoshinm commented 7 years ago
satoshinm commented 7 years ago

Signs in Glowstone were last changed in https://github.com/GlowstoneMC/Glowstone/commit/ce7da29b07a17483e79218b9d1f9190627dbd12a in talking with Glowstone developers on discord, the getFacing NPE may be a Bukkit API issue