Jump to content

KidKoderMod033109

Members
  • Posts

    106
  • Joined

  • Last visited

Everything posted by KidKoderMod033109

  1. How would I get a ServerWorld from a World?
  2. HI, I'm looking to get the saves directory of a World(ex. ".minecraft/saves/My World") as a java.io.File.I have looked throught all the methods in World, and found nothing. Is this even possible? Thanks in advance, Kid Koder
  3. Ok, I don't know how to create the LazyOptional that should be returned
  4. So, there is an issue with Forge? Sorry, I'm confused
  5. I did. It is located here: https://github.com/KidKoder09923/Allergies-Mod Also, back the orginial question, how would I convert the LazyOptional to an IAllergies. I still geting a java.lang.NullPointerExeption
  6. Ok, ya true, so how can I fix that? Also, that line I sent a minute ago was line 48, this is line 47: PlayerAllergies playerAllergies = player.getCapability(AllergiesProvider.ALLERGIES_CAP).orElse(new CapabilityAllergies()).getAllergens();
  7. Oh... StringTextComponent allergiesListGold = new StringTextComponent("You are allergic to gold: " + playerAllergies.hasAllergen(Allergen.GOLD)); ya. Here
  8. Opps not everything was pasted Here is the PasteBin: https://pastebin.com/TustzfFp
  9. I got a java.lang.NullPointerException for this class:
  10. I used this line, but for CapabilityAllergies::new IntelliJ said that IAllergies was a functional interface.
  11. Great would this code work? Thank you Kid Koder
  12. ??. I'm using IntelliJ IDEA, where could I find this.
  13. Is an is an example possible, as I don't really get that. Also, for my previous question I meant the gray backround and monospace font look.
  14. Great! But the methods need a NonNullSupplier, so how do I get an instance? Unrealated, but how do you get the code look for the methods?
  15. Ok, great! But I saw on the file that I could use Capability.orEmpty(Capability, LazyOptional) to cast it. Or am understading it wrong? Also, LazyOptional#getValue does not seem to exist? I need help finding the method. Also, would this be what you meant? Thanks once again, Kid Koder
  16. Hi again, I was working on my capibily and found a casting error, it read: Caused by: java.lang.ClassCastException: net.minecraftforge.common.util.LazyOptional cannot be cast to net.kidkoder.allergies.capability.allergies.IAllergies so, I found the line and it reads: IAllergies allergies = (IAllergies) player.getCapability(AllergiesProvider.ALLERGIES_CAP); and I don't know how to properly cast to the coreect type. The IAllergies is the inferfaced used in my capabily. If threre is a way to cast it how? Thanks in advance, Kid Koder
  17. Great worked! But how to I check what event bus a event needs?
  18. Hi, I was working on my mod's events and found the the evnevs where not running in-game. I do not know what is going on. Hre is my code: Thanks in advance, Kid Koder
  19. Oh ya! About that a boolean flag won't really work. I need to store to whole objects into the player.
  20. Great! I'm doing cappibilys, but the totrial I'm using says I need to use the NBTBase class. It apperes to be renamed/removed, what is the new name/replacement? Thanks, Kid Koder PS. The tutorial is at https://www.planetminecraft.com/blog/forge-tutorial-capability-system/
  21. Hi, I'm using the WorldSavedData class in my mod and don't really understand it. I read the docs and they did not help, if there are any doc/YouTube tutorials ou there I would love to know! Thanks in advance, Kid Koder
×
×
  • Create New...

Important Information

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