Closed Tarig0 closed 10 years ago
@UncleMion What do you think of doing this instead of handling any LB access rules in Gulliver.
Is this NBTTag already in existence?
Player.getNBTTags().hasKey("LB_ReachDistance") can make sure it's there. Would be better than faffing with an interface.
I've been fleshing out some interfaces for a Gulliver API, actually, so other mods could call getSizeMultiplier(), doubleSize() and such. Haven't added a getMaxReachDistance() yet, but I certainly could. I'd return a float value instead of int, otherwise it doesn't scale as well.
Actually, would an NBT tag be accessible on the client side? I can't remember if that OpenContainer event happens on client or server (or both). The Attributes feature added in MC 1.6 seem to get passed to the client, so maybe using something like that would work.
It's all server sided I believe. But I think NBTTags are passed around
IF the NBTTag is not set we will set it to 4 by default
oo and the Tag should be a child of the PlayerPersisted NBTTag so that it's not lost when the user logs out or dies
Do we need this?
only if @UncleMion wants to change access rules for her giants/ tinies. Even if we change the little container interact to only scan if there is a LB chunk with in reach allow any GUI to stay open, she will still have to tell us how far the giants can reach.
Gulliver will be able to extend the LB container interact event without talking with LB's at all, We should add another check to ensure no other event has set the event.result value to anything other than default
I think we can solve any issues with Gulliver by referencing a player NBTTag that we use to determine the reach distance they should have if interacting with LB.
That way UM can change the NBT tag on Login and on Resize.
Player.getNBTTags().getInt("LB_ReachDistance")
if <=0 skip all checks, else use as the distance checker