Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public DisplayLinkPeripheral(DisplayLinkBlockEntity blockEntity) {
@LuaFunction
public final void setCursorPos(int x, int y) throws LuaException {
if (x < 1 || y < 1)
throw new LuaException("cursor position must be larger then 0");
throw new LuaException("cursor position must be larger than 0");

cursorX.set(x - 1);
cursorY.set(y - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import net.minecraft.world.Clearable;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.ShulkerBoxBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.world.level.block.state.BlockState;

public class SmartObserverBlockEntity extends SmartBlockEntity implements Clearable {
Expand Down Expand Up @@ -81,9 +83,17 @@ public void tick() {
.getBlock();

if (!filtering.getFilter()
.isEmpty() && block.asItem() != null && filtering.test(new ItemStack(block))) {
activate(3);
return;
.isEmpty() && block.asItem() != null) {
ItemStack stack = new ItemStack(block);
if (block instanceof ShulkerBoxBlock
&& level.getBlockEntity(targetPos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity
&& !shulkerBoxBlockEntity.isEmpty()) {
stack.applyComponents(shulkerBoxBlockEntity.collectComponents());
Copy link
Member

@IThundxr IThundxr Mar 6, 2026

Choose a reason for hiding this comment

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

Would it perhaps make sense to just collect and apply components for all block entities for all shulker box like cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting thought.

Even outside other mods adding new attributes types where it'd be useful to not have to mixin into Create to have their BE also pass the component map to the filtered stack, that opens up new interactions where ItemNameAttribute can compare with the name of placed BE's (even say, a cogwheel that only has that name due to getting placed by an item with that name), or the list filter with similar effect on the entire component map it had.

I don't hate it but to players that might feel very arbitrary to which blocks you can detect what stack it was placed with. (Admittedly, this PR does also just add have the behaviour I describe for shulkers specifically actually not quite it won't be able to detect the name of empty shulkers). lmk what you'd think is best

}
if (filtering.test(stack)) {
activate(3);
return;
}
}

// Detect items on belt
Expand Down