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

Multipart rotation and recoloring hooks #117

Open
asiekierka opened this issue Dec 26, 2017 · 5 comments
Open

Multipart rotation and recoloring hooks #117

asiekierka opened this issue Dec 26, 2017 · 5 comments
Assignees

Comments

@asiekierka
Copy link
Contributor

Essentially, IMultipart wrappers for rotateBlock and recolorBlock. (The recolor one could use a built-in way to say "no color", that is remove any color it has; this feels missing in Forge's hook.)

The rotation part is, interestingly, a regression from MCMP1 which allowed for such functionality.

@2xsaiko 2xsaiko self-assigned this Dec 26, 2017
@2xsaiko
Copy link
Collaborator

2xsaiko commented Dec 26, 2017

Interesting. I'll work on this after #116 is merged.

@2xsaiko
Copy link
Collaborator

2xsaiko commented Dec 27, 2017

There's a problem: I've got no idea how to implement both of them, since those methods don't provide the player as a parameter which is needed for raytracing, so I can get the part that I need to rotate/color.

EDIT: Hmm, I could make a custom packet that gets sent when the client clicks on the multipart block for each of those actions, that could work

@asiekierka
Copy link
Contributor Author

Well, in Charset I solved it by writing a wrench which explicitly handled multiparts.

Not forwarding rotateBlock might actually be wise, as doing this could sometimes change the IPartSlot which would probably require a far deeper refactor? Not sure. It's almost 1AM here.

@2xsaiko
Copy link
Collaborator

2xsaiko commented Dec 28, 2017

I don't think it would be that hard to change the IPartSlot. Now what I would need to test it is a mod where that is actually the case. Otherwise I guess I'll have to make a small mod myself that adds such blocks

EDIT: Actually, I forgot that rotateBlock rotates the block without checking anything (for example collision), so you're right that it will require a lot of changes. I'll see what I can come up with

EDIT: There is actually already a way to rotate parts, I think: TileMultipartContainer.java#438
Not sure how useful it is, though

@asiekierka
Copy link
Contributor Author

Not sure how useful it is, though

It assumes the Y axis.

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

2 participants