Jump to content

uSkizzik

Members
  • Posts

    222
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by uSkizzik

  1. Dear god... New errors! Also the null variable is a SkullModelBase. Either something's wrong or I shouldn't be calling SkullBlockRenderer renderer = new SkullBlockRenderer(context); I couldn't find another way that didn't give me the error I had before. Full code: SkullBlockRenderer renderer = new SkullBlockRenderer(context); ModelField = SkullBlockRenderer.class.getDeclaredField("modelByType"); ModelField.setAccessible(true); Map<SkullBlock.Type, SkullModelBase> Model = createSkullRenderers(context.getModelSet()); ModelField.set(renderer, Model); SkinField = SkullBlockRenderer.class.getDeclaredField("SKIN_BY_TYPE"); SkinField.setAccessible(true); Map<SkullBlock.Type, ResourceLocation> Skin = (Map<SkullBlock.Type, ResourceLocation>) SkinField.get(null); Skin.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new ResourceLocation("skizzik:textures/block/skizzik_head.png"));
  2. Ok, so, new error: Here's what I modified after reading your reply: try { ModelField = SkullBlockRenderer.class.getDeclaredField("modelByType"); ModelField.setAccessible(true); Map<SkullBlock.Type, SkullModelBase> Model = createSkullRenderers(context.getModelSet()); ModelField.set(Model, SkullBlockRenderer.class); SkinField = SkullBlockRenderer.class.getDeclaredField("SKIN_BY_TYPE"); SkinField.setAccessible(true); Map<SkullBlock.Type, ResourceLocation> Skin = (Map<SkullBlock.Type, ResourceLocation>) SkinField.get(null); Skin.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new ResourceLocation("skizzik:textures/block/skizzik_head.png")); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); }
  3. Registering the renderer: @SubscribeEvent @OnlyIn(Dist.CLIENT) public static void registerTileEntityRenders(FMLClientSetupEvent event) { BlockEntityRenderers.register(PA_SIGN.get(), SignRenderer::new); BlockEntityRenderers.register(PA_SKULL.get(), SkizzikHeadRenderer::new); } Renderer: public class SkizzikHeadRenderer extends SkullBlockRenderer implements BlockEntityRenderer<SkullBlockEntity> { public static Map<SkullBlock.Type, SkullModelBase> createSkullRenderers(EntityModelSet set) { ImmutableMap.Builder<SkullBlock.Type, SkullModelBase> builder = ImmutableMap.builder(); builder.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new SkullModel(set.bakeLayer(ModelLayers.SKELETON_SKULL))); builder.put(PA_TileEntities.CustomSkullTypes.SKIZZIK_WITH_GEMS, new SkullModel(set.bakeLayer(ModelLayers.WITHER_SKELETON_SKULL))); return builder.build(); } public SkizzikHeadRenderer(BlockEntityRendererProvider.Context context) { super(context); Field ModelField; Field SkinField; try { ModelField = super.getClass().getDeclaredField("modelByType"); ModelField.setAccessible(true); Map<SkullBlock.Type, SkullModelBase> Model = createSkullRenderers(context.getModelSet()); ModelField.set(super.getClass(), Model); SkinField = super.getClass().getDeclaredField("SKIN_BY_TYPE"); SkinField.setAccessible(true); Map<SkullBlock.Type, ResourceLocation> Skin = (Map<SkullBlock.Type, ResourceLocation>) SkinField.get(SkullBlockRenderer.class); Skin.put(PA_TileEntities.CustomSkullTypes.SKIZZIK, new ResourceLocation("skizzik:textures/block/skizzik_head.png")); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } } As I said, I have no idea what I'm doing at this point. I also kept the try and catch since I had no other idea of how to handle the errors.
  4. So, I'm having the following issue and I have no idea what is causing it. It seems like the texture is null but I don't know. At this point I barely know what I'm doing...
  5. I'm actually talking about both the block and the item
  6. What do you mean by "after you've created your SkullBlockRenderer"? Do I need a custom renderer class? If so, doesn't that mean that equipping the custom skull will crash the game since that will call the vanilla renderer?
  7. Basically, I'm trying to make custom skulls and I need to add them to the skull renderer. Until now I just used reflect to add them to the SKIN_BY_TYPE and MODEL_BY_TYPE maps but now the MODEL_BY_TYPE is using a method instead of being defined directly (like SKIN_BY_TYPE). Any ideas? Here's my current code for the rendering: @SubscribeEvent public static void registerCustomSkullRenderers(FMLClientSetupEvent event) { Field ModelField; Field SkinField; try { ModelField = SkullBlockRenderer.class.getDeclaredField("modelByType"); ModelField.setAccessible(true); Map<SkullBlock.Type, SkullModelBase> Model = (Map<SkullBlock.Type, SkullModelBase>) ModelField.get(SkullBlockRenderer.class); Model.put(CustomSkullTypes.SKIZZIK, new SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModelLayers.SKELETON_SKULL))); Model.put(CustomSkullTypes.SKIZZIK_WITH_GEMS, new SkullModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModelLayers.WITHER_SKELETON_SKULL))); SkinField = SkullBlockRenderer.class.getDeclaredField("SKIN_BY_TYPE"); SkinField.setAccessible(true); Map<SkullBlock.Type, ResourceLocation> Skin = (Map<SkullBlock.Type, ResourceLocation>) SkinField.get(SkullBlockRenderer.class); Skin.put(CustomSkullTypes.SKIZZIK, new ResourceLocation("skizzik:textures/block/skizzik_head.png")); Skin.put(CustomSkullTypes.SKIZZIK_WITH_GEMS, new ResourceLocation("skizzik:textures/entity/skizzik/skizzik.png")); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } }
  8. Did you try installing Java 16 like diesieben said?
  9. I don't think there's a way to do that... Why do you need the mods folder to be outside of the server files anyway?
  10. If you want to play 1.16.5 or any older version, download Java 8. Alternatively, you can play 1.17.1 (the newest MC version) and keep your Java 16.
  11. Ayo that actually worked! Tysm! I just deleted everything in the caches folder, it did take some time for the stuff to rebuild but it worked like a charm!
  12. Yeah, the only way is if you have a separate texture pack. I don't think it's possible to add it to the programmer's art one.
  13. "When I asked in the official Discord server, I got told that Forge can't do anything about it. If that is true, who should I contact and again, why isn't anyone else experiencing this?"
  14. Already tried all of the specified above multiple times. Where can I report this issue? Github?
  15. Let me just give this topic a little bump
  16. So, the day Forge 1.17.1 came out, I tried porting my mod to it. I got some errors which I managed to fix but now I'm stuck with a new one. It's really strange because I haven't seen anyone else having this issue (except one other user on Discord). I've been trying to fix this issue every day since. I even tried using the MDK and I still got the same exact issue. When I asked in the official Discord server, I got told that Forge can't do anything about it. If that is true, who should I contact and again, why isn't anyone else experiencing this? I also don't have this issue on 1.16.5. Error (From Terminal): https://pastebin.com/wHv2cA97 Full Log (debug.log, I don't know why the error doesn't appear here): https://pastebin.com/Jy6UHgNz
  17. Now I have a new error: https://pastebin.com/G4xa9F4v
  18. Basically, whenever I try running my client to test my mod, I get the following error: https://pastebin.com/RQQ1wf0T And here's the debug.log: https://pastebin.com/R73SwU7y
  19. I think the installer is just broken (like it's said in the orange message) but I don't know. Also, 1.12.2 isn't supported anymore (currently only 1.17, 1.16 and 1.15 are). This means that one of the mods will close this thread when they see it.
  20. If you want to deal void damage (it's important because some entities like the wither check for it) and you want a custom death message, then you can just add the two lines below to your language file and customize them however you want. I'm not sure if this is really a good idea but it does work. "death.attack.outOfWorld": "%1$s fell out of the world", "death.attack.outOfWorld.player": "%1$s didn't want to live in the same world as %2$s" As Luis_ST said, %1$s is the player's name and %2$s is the attacker entity's name.
  21. Oh, just download Java 8. 1.17 probably installed Java 16 (since that's what it's using) and is making your server think that it has to run on Java 16. And as you probably don't know, Java 16 isn't supported on 1.16.5.
  22. I managed to figure this out thanks to a user from the Forge Discord server (@ChampionAsh5357#5519) and this old 1.14.3 article
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.