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

Place block refactor #1686

Merged
merged 6 commits into from Dec 24, 2014
Merged

Place block refactor #1686

merged 6 commits into from Dec 24, 2014

Conversation

madmaxoft
Copy link
Member

This changes the player-caused block placing to go through the hooks for each block placed, even for multi-block changes (bed, door, golems, ...)

@madmaxoft madmaxoft mentioned this pull request Dec 24, 2014
@sphinxc0re
Copy link
Contributor

Does this fix #1567 ?

@madmaxoft
Copy link
Member Author

I haven't checked, it may indeed fix that issue as well.

@madmaxoft
Copy link
Member Author

Yes, this also fixes #1567

@NiLSPACE
Copy link
Member

Did you update the documentation? Otherwise I'd say merge :)

@madmaxoft
Copy link
Member Author

You're right, I didn't. I'll do that.

@worktycho worktycho self-assigned this Dec 24, 2014
@worktycho
Copy link
Member

I think the problem with std::hash was that operator() needs to be const. I'm fixing that now.

@madmaxoft
Copy link
Member Author

@worktycho check the gcc and clang failures. gcc requires the std::hash specialization to be a struct, while clang requires it to be a class and MSVC doesn't care. Rather than have a mess of preprocessor macros, I think I prefer the explicit hash type.

@worktycho
Copy link
Member

Okay. That's weird as they should both be using the same include files. Merge this if you want but I'm going to take a closer look at this because something in the build is not doing what its supposed to.

@worktycho
Copy link
Member

Found it. If you're going to specialise std::hash, make sure you include the original definition. For some reason clang is getting confused by the friend definition in vector.

@madmaxoft
Copy link
Member Author

Still nope :P

@worktycho
Copy link
Member

I though I had the same libstdc++ as travis. However, it looks like the ubuntu 14.04 release has backported the change that fixed the Immediate issue with struct/class. The commit that fixed it says its just a warning issue so I'm currently investigating the c++ standard to see whether there is a bug in clang or libstdc++.

@madmaxoft
Copy link
Member Author

Well, bug or no bug, we want this change to get in. I'll revert your changes, if you don't mind, and we can later investigate this further. Deal?

@worktycho
Copy link
Member

I've already reverted. Its a bug in libstdc++. The problem is not that the definition differs but that std::hash is declared as a struct and a class within libstdc++ prior to 4.9. gcc ignores the difference but clang doesn't. I'm writing this up because we may hit it again if we include the functional and vector headers in the same translation unit we have the same problem.

madmaxoft added a commit that referenced this pull request Dec 24, 2014
@madmaxoft madmaxoft merged commit 1d59313 into master Dec 24, 2014
@Howaner
Copy link
Contributor

Howaner commented Dec 24, 2014

You destroyed skulls :(

@madmaxoft
Copy link
Member Author

Hm, I thought I checked them

@Howaner
Copy link
Contributor

Howaner commented Dec 24, 2014

Oh, also you destroyed doors and 2 block high plants.
Have you tested your changes? o.O

@madmaxoft
Copy link
Member Author

Yes, I have tested doors and plants, they both worked.

What client are you using?

@madmaxoft
Copy link
Member Author

Ech, those were some client-side phantasmagoria again. Fixing now.

@madmaxoft
Copy link
Member Author

Fixed in master

@bearbin
Copy link
Member

bearbin commented Dec 25, 2014

Great!

@madmaxoft
Copy link
Member Author

Mob heads are still broken. Working on that...

@madmaxoft madmaxoft deleted the PlaceBlockRefactor branch December 25, 2014 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants