Jump to content

Siqhter

Members
  • Posts

    149
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Siqhter

  1. I think I was just phrasing this badly. Yes, by instantiating I did mean creating the new block using the "new" keyword. And then I register it in the correct register event in my registryhandler class.
  2. Ok, I will definitely try that. But it is acceptable to use an array list, create the blocks in a BlockInit class and add them to an array, and then instantiate in RegistryEvent#register? (As long as it is not a static instantiation?)
  3. Sorry if I'm misunderstanding, because I probably am, but isn't it just less code to use an array? With the example you provided wouldn't it be a new line per block?
  4. I register them using
  5. Ok, that's what I thought. I'm looking at other examples, but I'm having trouble finding where I should add the block to the arraylist, because it's normally done in blockbase.
  6. Huh, I see. I was just scanning through MrCrayfishsFurnitureMod on GitHub out of curiousity, and I was wondering if you could tell me if this is close to how it should be done. https://github.com/MrCrayfish/MrCrayfishFurnitureMod/blob/master/src/main/java/com/mrcrayfish/furniture/init/FurnitureItems.java
  7. Should I also remove the BlockBase class, or is that not necessary?
  8. Ok, thanks everyone for help with this. Going back to Animefan8888's original answer and working from there I have gotten registration to work. This is definitely different than how a lot of the poorly structured youtube tutorials teach it.
  9. Does anything have to be registered in Main.java? It's currently not registering.
  10. So I could register ItemInit.init() and BlockInit.init() in preInit, but it would be prefered to do it in: @SubscribeEvent public static void onBlockRegister(RegistryEvent.Register<Block> event) { BlockInit.init(); }
  11. You mentioned registering them once I added them to an array, and I just wanted to see if this is acceptable.
  12. Awesome, thanks.
  13. Ah, thanks. Is there an example of how it should be done? Everyone seems to do it in the format of the above line I posted.
  14. Ok, that makes sense. I've also found that the majority of YouTube tutorials do this as well: But many people have said not to.
  15. Wow, that probably removed 40 lines of code. Why did people do that in the first place? Also, I assume I still want to used an Array to store blocks and items?
  16. Recently, after reading one of my posts, someone said that I should not use IHasModel. I have also heard this in numerous other Forge discussions, and I was wondering how about exactly do I replace it? I register my blocks like this: My BlockBase class implements IHasModel. So how would I remove IHasModel? Thanks.
  17. Ok, thanks. I could just copy over the RayTraceResult method, but that's extra code.
  18. Ok, I might have been misunderstanding, but since RayTraceResult is protected, I can access it with the this keyword if my class extends Item.
  19. Thanks! I got it working. Just a quick question while I'm on this topic, does my class have to extend Item to use RayTraceResult?
  20. So in this method, specifically at itemStack.isEmpty(), when I am in creative mode and right click on water with a bottle, the bottle quickly fills with water then instantly gets removed from the inventory. itemStack#isEmpty is called when there is only 1 bottle left in the stack. In survival this does not happen and it fills up as it should. Everything else is working fine. Also if I change it to PlayerInteractEvent.RightClickBlock, this problem does not occur. This is everything in the class.
  21. Sorry, I actually got it. I was just wondering however if my class has to extend Item to use RayTraceResult. Specifically #rayTrace, where the arguments are.
  22. Ok thanks. So mimicking the code in ItemGlassBottle (or similar to it, at least) should be good, without adding too much I don't need?
  23. Ok, that's what I thought. Is there a downfall to that?
  24. I have looked through the ItemGlassBottle and ItemBucket classes in answer to this question, but is there a way to detect if the player right clicks on a block of water with an item using PlayerInteractEvent?
  25. I just got it. EntityCow cow = (EntityCow) event.getTarget();
×
×
  • Create New...

Important Information

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