SlimeVoid / LittleBlocks-FML

LittleBlocks for FML
http://www.slimevoid.net/LittleBlocks
GNU Lesser General Public License v3.0
18 stars 13 forks source link

LB Access rules with gulliver #72

Closed Tarig0 closed 10 years ago

Tarig0 commented 11 years ago

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

Tarig0 commented 11 years ago

@UncleMion What do you think of doing this instead of handling any LB access rules in Gulliver.

Eurymachus commented 11 years ago

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.

UncleMion commented 11 years ago

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.

Tarig0 commented 11 years ago

It's all server sided I believe. But I think NBTTags are passed around

Tarig0 commented 11 years ago

IF the NBTTag is not set we will set it to 4 by default

Tarig0 commented 11 years ago

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

Eurymachus commented 10 years ago

Do we need this?

Tarig0 commented 10 years ago

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.

Tarig0 commented 10 years ago

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