I Am Trying To Register A Class That Extends IExtendedEntityProperties But I Can't Register It Since entity.registerExtendedProperties Seems To Be Removed In 1.9 Or Something
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The first parameter of CapabilityManager.register is the Class object of the interface to register a capability for (obtained from the .class keyword).
Side note: Please use proper capitalisation and punctuation in your posts. It's Annoying Reading A Post When Every Word Starts With A Capital.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You haven't asked a question or stated your problem.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Capability.IStorage implementation is responsible for reading/writing NBT for the default implementation of the handler interface. It doesn't have to support alternative implementations.
If your ICapabilityProvider implementation also implements INBTSerializable (or implements ICapabilitySerializable, a combination of the two interfaces), it will be used to read from/write to NBT. If it provides a compatible implementation of the handler interface, it can use the IStorage to do this. If it provides an implementation not supported by the IStorage, it needs to do this itself.
The IStorage is never used by Forge itself, it's up to the ICapabilityProvider to determine whether or not to use it.
If your handler doesn't need to be saved, don't implement INBTSerializable on your ICapabilityProvider implementation.
If you want help with the crashes, upload your code and crash reports to Gist and link them here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
ICapabilityProvider is used for Item capabilities (since Items are singletons and you can't create your own ItemStack classes containing custom logic) and attaching capabilities to external objects (from vanilla or other mods) using AttachCapabilitiesEvent.
You don't need an ICapabilityProvider to attach capabilities to your own Entity or TileEntity class; just create the handler instances, store them in fields and read them from/write them to NBT like the rest of your Entity/TileEntity's data.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Your capability's handler interface shouldn't have any reference to NBT reading/writing. Individual subclasses can implement INBTSerializable if needed.
Only register your capability once during preInit. Do not try to register it from multiple places.
Put breakpoints in your preInit method and your event handler. Are they both called?
If it crashes, post the crash report.
To help you further I'll need to see your full code, not just snippets of it.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I Am Trying To Register A Class That Extends IExtendedEntityProperties But I Can't Register It Since entity.registerExtendedProperties Seems To Be Removed In 1.9 Or Something
My mods
#StopModReposts
They've been replaced with Capabilities.
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things
Also see this thread, in which I link to some examples of the Capability system and explain some parts of it.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So Whats The First Parameter?
My mods
#StopModReposts
Be more specific. The first parameter of what?
The first parameter of CapabilityManager.register is the Class object of the interface to register a capability for (obtained from the .class keyword).
Side note: Please use proper capitalisation and punctuation in your posts. It's Annoying Reading A Post When Every Word Starts With A Capital.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok I got used to that because of naming class and methods
My mods
#StopModReposts
I finally managed to make it stop crashing. Not sure if the NBT works.
My mods
#StopModReposts
Hello?
My mods
#StopModReposts
You haven't asked a question or stated your problem.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
How do I get the nbt from that class or do I have to make my interface and its sub-class to do everything involving those nbt tag?
(Sorry, I don't really get the system yet it's really complicated and there aren't much documentation of it)
EDIT: Seems like registering the capability in the common proxy and calling it in the preInit method doesn't work and
putting it in the AttachCapabilitiesEvent.Entity event crashes the game.
My mods
#StopModReposts
The Capability.IStorage implementation is responsible for reading/writing NBT for the default implementation of the handler interface. It doesn't have to support alternative implementations.
If your ICapabilityProvider implementation also implements INBTSerializable (or implements ICapabilitySerializable, a combination of the two interfaces), it will be used to read from/write to NBT. If it provides a compatible implementation of the handler interface, it can use the IStorage to do this. If it provides an implementation not supported by the IStorage, it needs to do this itself.
The IStorage is never used by Forge itself, it's up to the ICapabilityProvider to determine whether or not to use it.
If your handler doesn't need to be saved, don't implement INBTSerializable on your ICapabilityProvider implementation.
If you want help with the crashes, upload your code and crash reports to Gist and link them here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
What happens is forge calls the event multiple times causing it to be registered multiple times
My mods
#StopModReposts
It's registers after you open a world, should it happen? I used @SubscribeEvent or should I use something else?
Crash Log
My mods
#StopModReposts
The capability should be registered once in preInit. Do not register it from events that are fired multiple times like AttachCapabilitiesEvent.
Your event handler for AttachCapabilitiesEvent should only create the ICapabilityProvider instance and the handler implementation provided by it.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Like this?
My mods
#StopModReposts
That should work, yes.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Question: Where does the provider gets called? There isn't any references of it in the register.
My mods
#StopModReposts
ICapabilityProvider is used for Item capabilities (since Items are singletons and you can't create your own ItemStack classes containing custom logic) and attaching capabilities to external objects (from vanilla or other mods) using AttachCapabilitiesEvent.
You don't need an ICapabilityProvider to attach capabilities to your own Entity or TileEntity class; just create the handler instances, store them in fields and read them from/write them to NBT like the rest of your Entity/TileEntity's data.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
It doesn't seem to be called here is the code.
I didn't include the provider which only had the capability instance in it.
My mods
#StopModReposts
Your capability's handler interface shouldn't have any reference to NBT reading/writing. Individual subclasses can implement INBTSerializable if needed.
Only register your capability once during preInit. Do not try to register it from multiple places.
Put breakpoints in your preInit method and your event handler. Are they both called?
If it crashes, post the crash report.
To help you further I'll need to see your full code, not just snippets of it.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.