Jump to content

GarlicBread

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by GarlicBread

  1. Alright, I fixed that problem, now the issue im having is I can't add more than one slot to my container without the game crashing. It says that the array only has 0 and 1 when it crashes. Is there any way to change this? Edit: Solved this, marking thread as solved
  2. Is there anything else that I'm missing, or is there something I'm doing wrong because my custom inventory still seems to act like a trash can
  3. ah,alright then. I got a bit confused cuz in MBE the capabilities dont seem to be null. Thanks for letting me know!
  4. 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?
  5. 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); }
  6. Alright I fixed that issue, now I've basically made a trash can since the items I put in the slot disappear. Is there anything else I need to add to my code, or am I doing something wrong with the capabilities?
  7. 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.
  8. I'm making a custom inventory (similar to curios or cosmetic armor) but I want to avoid using IInventory since its deprecated. What steps do i take to make one attached to a player that would open on a hit of a keybind?
  9. 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?
  10. 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!
  11. Ah, rotating the models seem to be fit for what I'm doing. Thanks for the guidance!
  12. 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?
  13. 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.
  14. Thanks, I wasn't aware of that. Refactoring solved the issue.
  15. 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...
  16. 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
  17. There are no logs since it isnt throwing an error, instead the game renders the model like this:
  18. 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
×
×
  • Create New...

Important Information

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