Jump to content

imacatlolol

Forge Modder
  • Posts

    274
  • Joined

  • Days Won

    5

Everything posted by imacatlolol

  1. I think you can do the same for the Nether's dimension type; override it in the registry. Not sure if it's great for cross-mod compatibility, but it should be a little cleaner.
  2. Just register two separate instances of the same class and use different registry names. Vanilla does this a lot, check the Blocks class.
  3. This is probably a stupid and basic question, but I haven't been able to find an answer on my own. In my own non-forge projects my shutdown hooks (via Runtime#addShutdownHook) are skipped when hitting the stop button in my IDE (IntelliJ IDEA). I have to hit the exit button instead, which is comparatively out of the way. But, when working with Forge, the shutdown hooks (particularly for the dedicated server) will still run when hitting the stop button. I'm not sure if it's Forge's doing or vanilla, but I'm assuming it's Forge. What kind of configuration or thread-based magic is at work here? I'm stupid, it's dependent on running it in debug mode vs normally... I should test things before posting, sorry.
  4. I'm afraid you'll need to give us code to even begin to diagnose the problem.
  5. If you want to add/change HUD elements, subscribe to RenderGameOverlayEvent and render things there. If you want to change an existing GUI, one of the events in GuiScreenEvent should be enough.
  6. What version are you using?
  7. GuiMainMenu is not a thing in modern Minecraft, and the version you're using is no longer supported. You need to update to 1.14/1.15.
  8. It wants an array of ResourceLocations, so just give it that. If you don't know what a ResourceLocation is, read the docs.
  9. See how the bed does it. Create a shape for every direction and check the facing in getShape.
  10. @Cadiboo has been making amazing progress on re-implementing default config GUIs, but they're currently not available. Also, they're being targeted for a 1.15.x release and it may take time to be backported to 1.14.4. However! You are able to create your own GUI if you're willing to put in the work. You can see an example of this here.
  11. Ah, so that's what that's for, not sure how I missed that. Thanks once again!
  12. Breakpoints work by freezing the program and allowing you to step through your code one line at a time to see where things fail. This will let you check if your conditions are passing or not. You should learn how debugging works before going further, it will make things much easier for you. Simply google how to debug with your IDE to find a good tutorial.
  13. That's what the containerItem thing I mentioned is for. It leaves an item in the crafting table after being crafted, which is what they seem to want. It's also used for other things, like potion bottles and water buckets.
  14. Use the containerItem method in your item's properties.
  15. I created a set of custom potions and they automatically worked with vanilla items (potion bottles and tipped arrows) as intended. However, the items' translation keys that involve my custom potion effects do not use the namespace of my mod. It makes sense as it's still a vanilla item, but it opens the door to potential conflicts. One solution would be to simply use my mod id in my registry names, but that feel pretty sloppy. Any good workarounds, or should I just ignore it for now?
  16. Have you actually checked with your debugger to see if it's really failing the check, or even getting that far in the first place? At this point you might just need to clean up your code, I'm having trouble reading it. You should be doing instanceof checks instead of class equals checks, the == true parts are unnecessary, and your last if statement is redundant.
  17. You're using super.onBlockDestroyed incorrectly, that's not how you break blocks. See how PlayerInteractionManager#tryHarvestBlock does it to make sure you do all of the necessary checks when breaking blocks, and how to actually break the blocks properly. (And no, don't actually called tryHarvestBlock, just use it as a reference.)
  18. Oh, didn't even know that existed, thanks for the correction!
  19. It's using Java 13 instead of the Java 8 installation you want it to. I don't use Eclipse, but this should tell you what to do to change it to Java 8.
  20. Decocraft won't work on 1.15.2, it currently only supports up to 1.12.2. You'll have to wait for it to update, or find an alternative mod that is updated for the version you want to play on.
  21. Yes, but you need to filter first in order to guarantee that you find what you need.
  22. I'm not a Java expert myself so I'm sure someone else could give a better answer, but there's a few resources I know of. W3Schools' tutorials are pretty good, and they have good examples. Their section on Classes and Object Oriented Programming in general may be particularly useful. Oracle's official documentations have a pretty bare-bones tutorial, if that works for you. If you're a visual learner, there are also many YouTube tutorials that may help explain some confusing aspects of java using examples, too many to list here. And of course, when in doubt, Google can be your best friend when something is confusing. It's no secret that even veteran programmers regularly use Google to make sure they're doing something correctly. I personally learned Java by just looking up random resources to find what worked for me, then I just trial-and-errored my way here. I've gotten pretty good, but it's very easy to fall into bad habits. It's always a good idea to look at other people's code to see how to improve.
  23. Instantiate it during registration just like you do with the normal Item class. Basically call new ItemEffect() instead of new Item() when registering your items. Side note: I would encourage you to learn Java outside of Minecraft modding, as learning Java in this sort of environment can be difficult.
×
×
  • Create New...

Important Information

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