-
Notifications
You must be signed in to change notification settings - Fork 27
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
Conversation
@@ -24,6 +27,10 @@ public ItemMultipart(Properties properties) { | |||
@Nullable | |||
public abstract MultiPart newPart(MultipartPlaceContext context); | |||
|
|||
protected List<MultiPart> newParts(MultipartPlaceContext context) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
TileMultipart#markShapeChange()