diff --git a/common/src/main/java/net/darkhax/botanypots/block/BlockBotanyPot.java b/common/src/main/java/net/darkhax/botanypots/block/BlockBotanyPot.java index c6f96d98..45609c8e 100644 --- a/common/src/main/java/net/darkhax/botanypots/block/BlockBotanyPot.java +++ b/common/src/main/java/net/darkhax/botanypots/block/BlockBotanyPot.java @@ -164,6 +164,23 @@ else if (!player.isCrouching() && !potEntity.isHopper() && potEntity.doneGrowing return InteractionResult.CONSUME; } + // Attempt to fill the pot with soil or seed + else if (!player.isCrouching() && (potEntity.isValidSeed(heldStack) || potEntity.isValidSoil(heldStack))) { + + if (potEntity.isValidSeed(heldStack) && potEntity.getCrop() == null) { + + potEntity.getInventory().setItem(1, new ItemStack(heldStack.getItem(), 1)); + + player.getItemInHand(hand).setCount(heldStack.getCount() - 1); + + } else if (potEntity.isValidSoil(heldStack) && potEntity.getSoil() == null) { + + potEntity.getInventory().setItem(0, new ItemStack(heldStack.getItem(), 1)); + + player.getItemInHand(hand).setCount(heldStack.getCount() - 1); + } + } + // Open the pot GUI else if (player instanceof ServerPlayer serverPlayer) {