Non-API reference in Chisel 3 API
SisterJacq opened this issue ยท 1 comments
Gloriously copypasta'd from a .txt document I gave to Drull:
In team.chisel.api.rendering.TextureType.getVIcon(ISubmap, int, int, int, int) {...}, the code on line 282, "IOffsetData data = ChunkData.getOffsetForChunk(Chisel.proxy.getClientWorld(), x, z);" calls out of the API, which as we all know is a bad thing, but it would work the same (without erroring) with "IOffsetData data = ChunkData.getOffsetForChunk(FMLCommonHandler.instance().getSide() == Side.SERVER ? null : Minecraft.getMinecraft().theWorld, x, z);". Yes it is longer, but it allows the API to not error if Chisel's whole source is not in the dev environment, which is pretty important (especially if you want to make more textures, Derpkus :P).
On a side note, TextureSubmap in your CTMLib seems to not implement any of the required functions from IIcon, because I doubt you forgot to declare the class abstract.
TextureSubmap is not an abstract class, it relies on lombok to fill in the missing methods. Don't use the source, just compile against (and shade) the built jar.
Your suggested code for the ChunkData will not work, that'll crash dedicated servers. But I don't think icon stuff would be used on servers anyways so I'm probably fine just using Minecraft.getMinecraft().