mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-17 23:48:00 +01:00
Use the bucket tag for filling jars instead of just the vanilla bucket
This commit is contained in:
parent
0b583e7276
commit
73cab14bbb
1 changed files with 2 additions and 2 deletions
|
@ -5,11 +5,11 @@ import com.minelittlepony.unicopia.block.ItemJarBlock.JarContents;
|
||||||
import com.minelittlepony.unicopia.block.ItemJarBlock.TileData;
|
import com.minelittlepony.unicopia.block.ItemJarBlock.TileData;
|
||||||
import com.minelittlepony.unicopia.util.FluidHelper;
|
import com.minelittlepony.unicopia.util.FluidHelper;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags;
|
||||||
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants;
|
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants;
|
||||||
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
|
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.nbt.NbtCompound;
|
import net.minecraft.nbt.NbtCompound;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.TypedActionResult;
|
import net.minecraft.util.TypedActionResult;
|
||||||
|
@ -27,7 +27,7 @@ public record FluidOnlyJarContents (
|
||||||
@Override
|
@Override
|
||||||
public TypedActionResult<JarContents> interact(PlayerEntity player, Hand hand) {
|
public TypedActionResult<JarContents> interact(PlayerEntity player, Hand hand) {
|
||||||
ItemStack stack = player.getStackInHand(hand);
|
ItemStack stack = player.getStackInHand(hand);
|
||||||
if (stack.isOf(Items.BUCKET)) {
|
if (stack.isIn(ConventionalItemTags.EMPTY_BUCKETS)) {
|
||||||
long remainder = FluidHelper.deposit(stack, player, hand, fluid, amount);
|
long remainder = FluidHelper.deposit(stack, player, hand, fluid, amount);
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
fluid.getFluid().getBucketFillSound().ifPresent(sound -> player.playSound(sound, 1, 1));
|
fluid.getFluid().getBucketFillSound().ifPresent(sound -> player.playSound(sound, 1, 1));
|
||||||
|
|
Loading…
Reference in a new issue