MCMultiPart icon indicating copy to clipboard operation
MCMultiPart copied to clipboard

Multipart rotation and recoloring hooks

Open asiekierka opened this issue 8 years ago • 5 comments

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.

asiekierka avatar Dec 26 '17 14:12 asiekierka

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

dblsaiko avatar Dec 26 '17 20:12 dblsaiko

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

dblsaiko avatar Dec 27 '17 19:12 dblsaiko

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.

asiekierka avatar Dec 27 '17 23:12 asiekierka

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

dblsaiko avatar Dec 28 '17 13:12 dblsaiko

Not sure how useful it is, though

It assumes the Y axis.

asiekierka avatar Mar 04 '18 11:03 asiekierka