Yarn: World 'isRemote' vs. 'isClient' vs. ???

Created on 28 Oct 2016  路  10Comments  路  Source: FabricMC/yarn

I think World.isRemote is awkward, It might make more sense to use the client/server binary instead of local/remote.

discussion

Most helpful comment

Can we get some more thoughts so we can resolve this?

Personally I vote for isClient because that's the language packets use

All 10 comments

fromServer

The field is a bit awkward on its own. Theoretically it's redundant for client<->server checking since one could just test (World instanceof WorldServer) instead.

Considering the common usage in vanilla and mods, having a mismatch between the field and the execution environment is likely to cause major breakage. A name like isClient[World] reinforces this implicit contract, which I'd consider a good thing.

I'm with asie. isRemote is more along the lines of "does someone else own/control this world", which I believe is the intend..?

Yeah, there are cases where isRemote is true that would be confusing for isClient at first glance, like singleplayer worlds. _Yes_, it's speaking of the logical client not the physical client, but most people don't see that distinction. As well, !isRemote does not imply instanceof WorldServer, though it is true in some cases.

There should also be better terminology for physical/logical client/server. It's quite confusing in general.

Client/Server for physical sides, Master/Replica for logical sides?

On that note... isReplica?

It's anecdotal but isRemote was a major source of confusion for me when I started out modding. Remote to what? So many mods wrap it in a helper or something named isClient or clientSide.

I agree with mezz from 2 years ago :P. isRemote still confuses the fuck out of me. Let's please change that.

Can we get some more thoughts so we can resolve this?

Personally I vote for isClient because that's the language packets use

isClient is good to be changed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asiekierka picture asiekierka  路  4Comments

Runemoro picture Runemoro  路  3Comments

enbrain picture enbrain  路  4Comments

ChloeDawn picture ChloeDawn  路  6Comments

Runemoro picture Runemoro  路  4Comments