Attempting to register sprites using SpriteEvent causes NPEs
LemmaEOF opened this issue ยท 3 comments
I'm trying to register sprites using the SpriteEvent, but it causes an NPE crash. Still occurs when putting a break point on SpriteAtlasTexture.reload
and on SpriteAtlasTexture.build
. Interesting to note: the traceback references at net.minecraft.client.texture.SpriteAtlasTexture.handler$reload$zbn000(SpriteAtlasTexture.java:589)
, but SpriteAtlasTexture.java
only has 268 lines.
Minecraft: 18w50a
Mappings: yarn 18w50a.27
Loader: fabric-loader 0.2.0.64
API: fabric 0.1.1.55
Code being used:
public class InfraRedstoneClient implements ClientModInitializer {
private SpriteProvider provider;
@Override
public void onInitializeClient() {
SpriteEvent.PROVIDE.register(provider);
BlockEntityRendererRegistry.INSTANCE.register(DiodeBlockEntity.class, new DiodeRender());
}
}
class SpriteProvider implements SpriteEvent.Provider {
@Override
public void registerSprites(SpriteRegistry registry) {
registry.register(new Identifier("infraredstone:block/diode_glow"));
}
}