Upstream merge (we must go deeper) SpigotMC/Spigot@1e7bc383c3
Fixed: Check cast SpigotMC/Spigot@7efa75c63a
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back