Refactor block material - #2997
Conversation
TomyLobo
commented
Aug 2, 2026
- Add BlockState.getMaterial()
- Add ShapeType parameter to BlockMaterial.isFullCube
| ] | ||
| } | ||
| ], | ||
| "Why on earth is this even an issue?": [ |
There was a problem hiding this comment.
If someone was implementing BlockMaterial, this can sometimes cause weird issues that I don't recall exactly. But we should have the actual reasoning here, e.g.
| "Why on earth is this even an issue?": [ | |
| "No one should be implementing BlockMaterial": [ |
There was a problem hiding this comment.
I moved that under "Removal of deprecated API for WorldEdit 8" and deprecated the method.
I think that's what we settled on as a long-term goal anyway when we discussed this a few months back.
|
|
||
| import java.util.EnumSet; | ||
|
|
||
| public abstract class AbstractBlockMaterial<VS> implements BlockMaterial { |
There was a problem hiding this comment.
Instead of having a VS parameter, can we just push getShape into isShapeFullBlock? There doesn't really seem to be an advantage to having it here.
Also, we should probably just call isShapeFullBlock -> isFullCubeUncached?
There was a problem hiding this comment.
What about isFaceFull though?
There was a problem hiding this comment.
It can have the same thing done to it as well? You literally just do isFaceFull(getShape(shapeType), face) and do not store the shape in any way.
There was a problem hiding this comment.
I made getShape a private helper instead of an overridden method and made the other methods take ShapeType directly
thought it'd be more code duplication, for some reason, but that didn't pan out when I actually tried it :)
There was a problem hiding this comment.
I also renamed the method as suggested (and the other one to isFaceFullUncached in the other PR, too)
There was a problem hiding this comment.
It seems like this still has the type parameter on the class?
|
Also alongside octy's review, this currently does not compile, if you'd be able to please fix that too |
23ba7f5 to
d4805b3
Compare
c8b8ac1 to
1b9e3b1
Compare