Skip to content

Commit

Permalink
Fix (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Nov 12, 2024
1 parent b317141 commit d28c612
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.crystalnest.harvest_with_ease.api.event;

import it.crystalnest.cobweb.api.block.BlockUtils;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
Expand Down Expand Up @@ -185,6 +186,12 @@ default boolean didDropsChange() {
@ApiStatus.Internal
default List<ItemStack> initDefaultDrops(ServerLevel level, BlockState crop, BlockPos pos, InteractionHand hand) {
List<ItemStack> drops = Block.getDrops(crop, level, pos, crop.hasBlockEntity() ? level.getBlockEntity(pos) : null, getEntity(), getEntity().getItemInHand(hand));
// Pam's HarvestCraft mods are kinda weird with seeds, so it needs special treatment.
if (BlockUtils.getStringKey(crop.getBlock()).contains("pamhc2")) {
seedsIncluded();
return drops;
}
// Iterate over the drops and remove the seed if present.
for (ItemStack stack : drops) {
if (stack.is(crop.getBlock().getCloneItemStack(level, pos, crop).getItem())) {
seedsIncluded();
Expand Down

0 comments on commit d28c612

Please sign in to comment.