Skip to content

Commit 93c2acc

Browse files
committed
Add loottable for fluid tank
and fix to blacklist buckets having mob in them
1 parent 2bec76f commit 93c2acc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/main/java/net/roboxgamer/modernutils/block/custom/ExampleFluidTankBlock.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import net.minecraft.world.InteractionHand;
66
import net.minecraft.world.ItemInteractionResult;
77
import net.minecraft.world.entity.player.Player;
8-
import net.minecraft.world.item.BucketItem;
9-
import net.minecraft.world.item.Item;
10-
import net.minecraft.world.item.ItemStack;
11-
import net.minecraft.world.item.Items;
8+
import net.minecraft.world.item.*;
129
import net.minecraft.world.level.Level;
1310
import net.minecraft.world.level.block.Block;
1411
import net.minecraft.world.level.block.EntityBlock;
@@ -44,7 +41,7 @@ public ExampleFluidTankBlock(BlockBehaviour.Properties properties) {
4441
Item item = stack.getItem();
4542

4643
// Case 1: Player is holding a filled bucket
47-
if (item instanceof BucketItem bucketItem) {
44+
if (item instanceof BucketItem bucketItem && !(item instanceof MobBucketItem)) {
4845
Fluid fluidInBucket = bucketItem.content;
4946

5047
// If the bucket is filled with a fluid, try to insert it into the tank

src/main/java/net/roboxgamer/modernutils/datagen/ModBlockLootTableProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected void generate() {
3232
dropSelf(ModBlocks.EXAMPLE_INVENTORY_BLOCK.get());
3333
dropSelf(ModBlocks.MINI_CHEST_BLOCK.get());
3434
dropSelf(ModBlocks.BATTERY_BLOCK.get());
35+
dropSelf(ModBlocks.EXAMPLE_FLUID_TANK_BLOCK.get());
3536
}
3637

3738
protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) {

0 commit comments

Comments
 (0)