Skip to content

Commit

Permalink
re-add potion effect curing
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Dec 21, 2023
1 parent fcf3e9b commit d7d80c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public ItemStack finishUsingItem(@Nonnull ItemStack itemStack, @Nonnull Level le
serverPlayer.awardStat(Stats.ITEM_USED.get(Items.MILK_BUCKET));
}
if (!level.isClientSide) {
//TODO player.curePotionEffects(new ItemStack(Items.MILK_BUCKET));
Services.FLUID.curePotionEffects(player, new ItemStack(Items.MILK_BUCKET));
}
if (BucketLibUtil.notCreative(player)) {
return BucketLibUtil.removeMilk(itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.util.Tuple;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -36,4 +37,6 @@ public interface IFluidHelper {

Tuple<Boolean, ItemStack> tryPlaceFluid(ItemStack stack, Player player, Level level, InteractionHand interactionHand, BlockPos pos);

void curePotionEffects(LivingEntity entity, ItemStack curativeItem);

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package de.cech12.bucketlib.platform;

import de.cech12.bucketlib.platform.services.IFluidHelper;
import de.cech12.bucketlib.util.BucketLibUtil;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.dispenser.BlockSource;
import net.minecraft.network.chat.Component;
import net.minecraft.util.Tuple;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ItemUtils;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.common.ForgeMod;
Expand Down Expand Up @@ -91,5 +89,9 @@ public Tuple<Boolean, ItemStack> tryPlaceFluid(ItemStack stack, Player player, L
return new Tuple<>(fluidActionResult.isSuccess(), fluidActionResult.getResult());
}

@Override
public void curePotionEffects(LivingEntity entity, ItemStack curativeItem) {
entity.curePotionEffects(curativeItem);
}

}

0 comments on commit d7d80c1

Please sign in to comment.