From e0f63592a3e15f78370f25d053bb84fb09324486 Mon Sep 17 00:00:00 2001 From: FactaviCk Date: Sun, 10 May 2026 08:08:43 -0400 Subject: [PATCH 1/4] edible filters! but only when spawned in with food components... :) --- .../content/logistics/filter/FilterItem.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java index 27bf243f48..042b22210a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java @@ -3,6 +3,8 @@ import java.util.List; import java.util.Objects; +import net.minecraft.world.food.FoodProperties; + import org.jetbrains.annotations.NotNull; import com.simibubi.create.AllDataComponents; @@ -82,7 +84,19 @@ public InteractionResultHolder use(Level world, Player player, Intera }); return InteractionResultHolder.success(heldItem); } - return InteractionResultHolder.pass(heldItem); + else { + FoodProperties foodproperties = heldItem.getFoodProperties(player); + if (foodproperties != null) { + if (player.canEat(foodproperties.canAlwaysEat())) { + player.startUsingItem(hand); + return InteractionResultHolder.consume(heldItem); + } else { + return InteractionResultHolder.fail(heldItem); + } + } else { + return InteractionResultHolder.pass(player.getItemInHand(hand)); + } + } } @Override From 6b33c6b9485d61e80441bc158b62161e6759c13e Mon Sep 17 00:00:00 2001 From: FactaviCk Date: Sun, 10 May 2026 17:30:12 -0400 Subject: [PATCH 2/4] cleanup with call to super.use --- .../create/content/logistics/filter/FilterItem.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java index 042b22210a..fe4985068a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java @@ -85,17 +85,7 @@ public InteractionResultHolder use(Level world, Player player, Intera return InteractionResultHolder.success(heldItem); } else { - FoodProperties foodproperties = heldItem.getFoodProperties(player); - if (foodproperties != null) { - if (player.canEat(foodproperties.canAlwaysEat())) { - player.startUsingItem(hand); - return InteractionResultHolder.consume(heldItem); - } else { - return InteractionResultHolder.fail(heldItem); - } - } else { - return InteractionResultHolder.pass(player.getItemInHand(hand)); - } + return super.use(world, player, hand); } } From 708c3dbce3573ed60b2cd94a09c19a4daf0248e4 Mon Sep 17 00:00:00 2001 From: FactaviCk Date: Sun, 10 May 2026 18:20:55 -0400 Subject: [PATCH 3/4] remove unused import --- .../simibubi/create/content/logistics/filter/FilterItem.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java index fe4985068a..4d43a00135 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItem.java @@ -3,8 +3,6 @@ import java.util.List; import java.util.Objects; -import net.minecraft.world.food.FoodProperties; - import org.jetbrains.annotations.NotNull; import com.simibubi.create.AllDataComponents; From 3b968e7d21249239fdb17407b8f6b68fdffc193b Mon Sep 17 00:00:00 2001 From: FactaviCk Date: Mon, 18 May 2026 15:50:23 -0400 Subject: [PATCH 4/4] prevent abuse of using_converts_to food component with schematics --- .../create/content/logistics/filter/FilterItemStack.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java index 5769987fc8..66900980b2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java @@ -43,6 +43,7 @@ public static FilterItemStack empty() { private static void trimFilterComponents(ItemStack filter) { filter.remove(DataComponents.ENCHANTMENTS); filter.remove(DataComponents.ATTRIBUTE_MODIFIERS); + filter.remove(DataComponents.FOOD); // Prevent schematics from abusing the food using_converts_to component } public boolean isEmpty() {