Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBlockState parameters: state or block? #149

Closed
copygirl opened this issue Oct 28, 2016 · 6 comments
Closed

IBlockState parameters: state or block? #149

copygirl opened this issue Oct 28, 2016 · 6 comments

Comments

@copygirl
Copy link
Contributor

copygirl commented Oct 28, 2016

In many places, IBlockStates are used in places where Block would have been in the past. I almost want to call parameters of that type block since it makes more sense to me. What do you think?

Additionally, this opens up the question of whether IBlockState should simply be renamed to IBlock, and Block to BlockType, or something? Though maybe that's a bit too early - should wait for what Mojang is going to do to Blocks, at the very least..?

@shadowfacts
Copy link
Contributor

state.

And IBlockState should stay as it is, IMO.

@copygirl
Copy link
Contributor Author

Similar with ItemStack. I think of it as an instance of an item more than a stack which only comes into play for stackable items anyway. I do think of IBlockState as an instance of a block in the world too, when it is passed into methods like this.

@mezz
Copy link
Contributor

mezz commented Oct 28, 2016

Why not unambiguous parameters like itemStack, blockState?

@copygirl
Copy link
Contributor Author

copygirl commented Oct 29, 2016

@mezz Because they're long and don't really add anything. Ideally a parameter shouldn't be named after the type but its use in the code. And in use, I often think of said parameter as "the 'item' the method is operating on".

It might be confusing because we have the Item class but say we renamed that to ItemType, which makes more sense to me since an instance of Item is not an item instance but describes a type of an item, it would remove this confusion.

@Prospector
Copy link
Contributor

From what has been discussed in irc various times, it sounds like are going with state unless there is multiple kinda of states such as more than 1 BlockState or a BlockState and FluidState in the context.

@asiekierka
Copy link
Contributor

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants