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": [ |
|
|
||
| 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.
| public enum ShapeType { | ||
| SHAPE, | ||
| VISUAL_SHAPE, |
There was a problem hiding this comment.
This should explain what the difference is, and what a ShapeType is generally -- i.e., all members and the class should be documented.
|
Also alongside octy's review, this currently does not compile, if you'd be able to please fix that too |
1cc4e70 to
2dbb87d
Compare