Jump to content

uSkizzik

Members
  • Posts

    222
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by uSkizzik

  1. Glad to help (first time lol)
  2. Bump + Just to add, there is no hit box when I spawn the skull (in all cases). I can provide a github repository, if needed.
  3. If I'm not mistaken, you have Java 16 and that's not supported in 1.16.5. Downgrade to Java 8 and upgrade back to Java 16 once 1.17 comes out.
  4. I doubt anyone can help you without the log file. It's called "latest.txt" and it's in the logs folder.
  5. I'm not really sure if I'm right but can I know how much ram you assigned to the server? Edit: Oh, also, this is 1.16.5, not 1.17.
  6. I just can't seem to figure this out... Basically, I want to create Wither-like skull projectiles for my custom boss. I copied over the vanilla code, modified it to suit my needs and tested it. The results: Chat says that the entity was summoned and there's no trace of any errors in the console but it doesn't appear at all. (Vanilla Wither Skulls appear at their spawn location and don't do anything after that) I tried basically everything I could think of. I checked if it's all registered properly, copy-pasted vanilla code and ran it without modifying (except for like name-related things) and I even tried extending the vanilla Wither Skull class. None of this worked. I actually tried extending the vanilla arrow too (Since Wither Skull and Arrows use different logic) and while my skull still didn't appear, I heard an arrow landing noise. I tried this multiple times, same result every time. This leads me to believe that it's an issue with the renderer. I have previously tried to delete it, modify it, copy-paste Dragon Fireball rendering code and again, none of these worked.
  7. Wow, thank you so so so much! It finally works! I already had most of the stuff but my issue was that I was using a custom renderer instead of modifying the vanilla one.
  8. So, long story short, I've been trying to add custom heads to the game and I've been having troubles for the past week. I figured out the tile entity and then the item but now I'm having issues with wearing the custom head. Minecraft seems to be hard-coded to render heads from the vanilla skull renderer. This means that I need a way to change the vanilla player renderer to render my heads from my custom skull renderer... But how?! I've read old forum topics and I found out that I need to use the RenderPlayerEvent.Pre event and that's all I know, nothing more. Any ideas?
  9. So, after tons of rage quitting and a short 2-day break, I figured out what was wrong. I had the exact same issue and here's the solution for anyone who needs it in the future: Edit: Yeah, no. My old method isn't correct at all (Thanks to diesieben07 for the help). Just add the code below and it should be fine. You can also change "new GenericHeadModel(0, 0, 32, 32)" to a custom model or you can change the last 2 values to modify the texture size. @SubscribeEvent public static void registerCustomSkullRenderers(final FMLClientSetupEvent event) { Field ModelField; Field SkinField; try { ModelField = SkullTileEntityRenderer.class.getDeclaredField("MODEL_BY_TYPE"); ModelField.setAccessible(true); Map<SkullBlock.ISkullType, GenericHeadModel> Model = (Map<SkullBlock.ISkullType, GenericHeadModel>) ModelField.get(SkullTileEntityRenderer.class); Model.put(<Insert Custom Skull Type>, new GenericHeadModel(0, 0, 32, 32)); SkinField = SkullTileEntityRenderer.class.getDeclaredField("SKIN_BY_TYPE"); SkinField.setAccessible(true); Map<SkullBlock.ISkullType, ResourceLocation> Skin = (Map<SkullBlock.ISkullType, ResourceLocation>) SkinField.get(SkullTileEntityRenderer.class); Skin.put(<Insert Custom Skull Type>, new ResourceLocation("<Mod ID>:<Texture Location>")); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } Basically, you have to register a custom item renderer. Let's say the block and the tile entities were done properly (Too lazy to check) and the item (more exactly the texture) was the issue. All you need to do is add the following two methods to your main project class: public static Item.Properties setupISTER(Item.Properties group) { return group.setISTER(MainClass::getISTER); } @OnlyIn(Dist.CLIENT) public static Callable<ItemStackTileEntityRenderer> getISTER() { return ItemRenderer::new; } and after that you need to add this to your block item: MainClass.setupISTER(new Item.Properties()) Item.Properties() is of course your item properties like tab, rarity and etc. Then finally you're gonna need your Item Renderer class which should be something similar to this: @OnlyIn(Dist.CLIENT) public class ItemRenderer extends ItemStackTileEntityRenderer { public static final ItemStackTileEntityRenderer instance = new PA_ItemRenderer(); @Override public void renderByItem(ItemStack stack, ItemCameraTransforms.TransformType transform, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlay) { Item item = stack.getItem(); if (item instanceof BlockItem) { Block block = ((BlockItem) item).getBlock(); if (block instanceof AbstractSkullBlock) { PA_SkullRenderer.renderSkull(null, 180.0F, ((AbstractSkullBlock) block).getType(), null, 0.0F, matrix, renderer, light); } } } } The renderer is a slightly modified version of the vanilla one and all the code was made on 1.16.5.
×
×
  • Create New...

Important Information

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