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

Minor feature additions #157

Merged
merged 2 commits into from
Apr 26, 2024
Merged

Minor feature additions #157

merged 2 commits into from
Apr 26, 2024

Conversation

MrTJP
Copy link
Member

@MrTJP MrTJP commented Mar 3, 2024

  • Add 1.20.1 decorative blocks to micro block list
  • Clean up PartialOcclusionTest caching
    • Stored non-statically on tile
    • Takes into account parts that change their partial occlusion shape on the fly (they must now explicitly call TileMultipart#markShapeChange()

@@ -24,6 +27,10 @@ public ItemMultipart(Properties properties) {
@Nullable
public abstract MultiPart newPart(MultipartPlaceContext context);

protected List<MultiPart> newParts(MultipartPlaceContext context) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use Collection here instead of list? Do we need to enforce an order?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Will also change TileMultipart.canPlaceParts to intake Iterable<MultiPart> instead of list to match everything else.

public boolean canAddPart(MultiPart part) {
if (part instanceof SlottedPart) {
int mask = ((SlottedPart) part).getSlotMask();
public boolean canAddParts(Iterable<MultiPart> parts) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to validate that the slotted parts in this list don't overlap. I.e Someone tries to add 2 parts in the same slot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Now, we first build combined mask of all new parts, ensuring no overlap. Then we check that against the existing part list.

@covers1624 covers1624 merged commit ca84070 into master Apr 26, 2024
2 checks passed
@covers1624 covers1624 deleted the patch-0303 branch April 26, 2024 07:44
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.

2 participants