
GarlicBread
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by GarlicBread
-
Alright, I followed what you said and changed my code to the following: @Override public INBT serializeNBT() { return CapabilityRestraintsInventory.INVENTORY.getStorage().writeNBT(CapabilityRestraintsInventory.INVENTORY, lazyInitialisionSupplier.orElseThrow(() -> new IllegalArgumentException("LazyOptional is empty!")), null); } @Override public void deserializeNBT(INBT nbt) { CapabilityRestraintsInventory.INVENTORY.getStorage().readNBT(CapabilityRestraintsInventory.INVENTORY, lazyInitialisionSupplier.orElseThrow(() -> new IllegalArgumentException("LazyOptional is empty!")), null, nbt); } It still seems to act like a trash can, and it says it will produce an NPE on running .getStorage() on my capability, but I dont seem to get an NPE when going into the game. Does that have anything to do with the cap variable never being equal to my capability?
-
Hmm.. I added code in my ICapabilityProvider, and I think I'm not very sure what data I'm supposed to store. I took some code from ItemFlowerBag in MBE and I'm assuming this would work, but I still have the same issue. I have a feeling it's from this: but im not exactly sure how to fix this. I've looked at MBE examples and I think I'm following them correctly, but the capability is never equal to the capability that I've made. How do I get about to fixing it? @Override public INBT serializeNBT() { return CapabilityRestraintsInventory.INVENTORY.writeNBT(getCachedInventory(), null); } @Override public void deserializeNBT(INBT nbt) { CapabilityRestraintsInventory.INVENTORY.readNBT(getCachedInventory(), null, nbt); }
-
I tried doing that, but im a bit confused on whether or not I need to make a readNBT and writeNBT for it. Do you need NBT data for an inventory not attached to an item? My code is here (Check the MCap fork) if you want to take a look. Right now it produces a nullpointerexception because of the readNBT function, and I can't figure out how to fix it.
-
Hey, I'm adding obfuscate for animating my player model, but I gelatest.logt an error on loading up the game with it added as a mod in my run file. I've posted my logs, and it seems to be an error with the fields. Do I downgrade my mappings, or can I update the code somehow? Obfuscate doesnt seem to be open source unfortunately so what can I do?
-
How do People Get so Good at Modding?
GarlicBread replied to digdugninja's topic in General Discussion
There's a lot of resources that help you get familiar with forge methods, like the forge documentation, and plenty of tutorials to get started with modding. As for source code, check Cadiboo's Example Mod, which is a very handy bit of code that helped me understand how to code my mods quite a bit better. And since you have trouble understanding source code, it has comments saying what does what so you can understand what exactly is going on in the code. Also, make sure you take a look at vanilla classes, which you can find in your IDE since it comes with the forge mdk. Vanilla classes are a modder's best friend. Happy modding! -
[1.15.2] Help with animating player model
GarlicBread replied to GarlicBread's topic in Modder Support
Ah, rotating the models seem to be fit for what I'm doing. Thanks for the guidance! -
[1.15.2] Help with animating player model
GarlicBread replied to GarlicBread's topic in Modder Support
Yes, but it won't have the same model as say, riding a pig. Is it possible to edit limb rotation using forge methods, or do I have to make a new model? If I have to make a new model, how would you recommend going about doing so? -
Hey, I want to make a rideable block, like a chair, but with a custom player model. I've tried looking at the elytra code but my mappings seem to make it difficult. It would be nice if someone could help point me in the right direction, since I don't see any api such as obfuscate or animated player for 1.15.2. Edit: changed wording to be more understandable.
-
[1.15.2] Custom Model not rendering in game
GarlicBread replied to GarlicBread's topic in Modder Support
Thanks, I wasn't aware of that. Refactoring solved the issue. -
[1.15.2] Custom Model not rendering in game
GarlicBread replied to GarlicBread's topic in Modder Support
I see I've uploaded the project on github here. moneera_mod:block/biral khao is the custom texture I'm using for the block. It worked fine in 1.12.2, but after switching to 1.15.2 it seems like something's gone wrong... -
[1.15.2] Custom Model not rendering in game
GarlicBread replied to GarlicBread's topic in Modder Support
My bad, I thought you were referring to crash logs. Here's latest.log, I tried fiddling with it seeing the error came from the texture not being valid, but im not quite sure why it's showing up as invalid as the texture exists and is in the path. Is the formatting wrong? latest.log -
[1.15.2] Custom Model not rendering in game
GarlicBread replied to GarlicBread's topic in Modder Support
-
I've been moving my mod from 1.12.2 to 1.15.2, and I've recently come across an issue with rendering models in game, the model would not show up and would show a pink and blank box instead. I've been following a tutorial online for implementing 3d models, but I can't figure out where I went wrong. As far as I know, a 3d model's blockstate and .json should be the blocks registry name. Help would be appreciated! horse_block.json horse_block.json RegistryEvents.java