Lib Block Attributes

Lib Block Attributes

853k Downloads

BlockView support for mods depending on this library

harleylizard opened this issue ยท 8 comments

commented

Hello, just wondering if you're able to change Attribute#getAll to use the BlockView interface instead of the World class, would allow to use child instances of BlockView in methods that don't provide a world instance. (World class implements BlockView, and you're using the methods that BlockView provides, so wouldn't have to change anything else)

commented

That's not really possible, since the World object is passed down through a lot more code than just Attribute.getAll, plus it ends up outside LBA code in the mods that actually provide attributes.

(The main problem is that I'd have to break LBA's APIs in order to make this work).

commented

(Woops, sorry for the miss-click closing).

What are you trying to do? LBA is a fairly general-purpose library, so there's no guarantee that attribute instances support just a BlockView. However there might be an alternative depending on what you need...

commented

For the first reply, understandable, not much i can add onto that. For the second/third reply, yes i do need to grab attributes in a method that only provides a WorldView instance. Trying to set an attribute on the server, and then retrieve in a client, but that client method only provide the WorldView instance.

commented

Trying to set an attribute on the server, and then retrieve in a client

Sadly LBA doesn't provide that functionality - LBA can only retrieve objects on the same side as where they are provided.

commented

What kind of object are you setting/retrieving?

commented

What kind of object are you setting/retrieving?

A custom attribute class, also do you have discord? (mines chaottic#3842) to chat on that instead of in this lol

commented
commented

(Closing after discussion has long since finished).