-
Posts
106 -
Joined
-
Last visited
Everything posted by KidKoderMod033109
-
[1.15] Get world folder as java.io.File
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
How would I get a ServerWorld from a World? -
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
-
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Ok, I don't know how to create the LazyOptional that should be returned -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
So, there is an issue with Forge? Sorry, I'm confused -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
I don't follow... -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
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 -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
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(); -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Oh... StringTextComponent allergiesListGold = new StringTextComponent("You are allergic to gold: " + playerAllergies.hasAllergen(Allergen.GOLD)); ya. Here -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Opps not everything was pasted Here is the PasteBin: https://pastebin.com/TustzfFp -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Here is the log: -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
I got a java.lang.NullPointerException for this class: -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
I used this line, but for CapabilityAllergies::new IntelliJ said that IAllergies was a functional interface. -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Great would this code work? Thank you Kid Koder -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
??. I'm using IntelliJ IDEA, where could I find this. -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
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. -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
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? -
[1.15] Get capibily from player as interface
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
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 -
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
-
[1.15] Events not registering/exucuting
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Ok great! -
[1.15] Events not registering/exucuting
KidKoderMod033109 replied to KidKoderMod033109's topic in Modder Support
Great worked! But how to I check what event bus a event needs? -
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
-
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