forked from KrisCris/AllStackable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMixinBucketItem.java
More file actions
27 lines (23 loc) · 1.11 KB
/
MixinBucketItem.java
File metadata and controls
27 lines (23 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package online.connlost.allstackable.mixin;
import net.minecraft.screen.slot.SlotActionType;
import online.connlost.allstackable.util.ItemsHelper;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BucketItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(BucketItem.class)
public class MixinBucketItem {
// @Inject(method = "getEmptiedStack", at = @At(value = "HEAD"), cancellable = true)
// private static void stackableBucket(ItemStack stack, PlayerEntity player, CallbackInfoReturnable<ItemStack> cir){
// if (ItemsHelper.isModified(stack) && stack.getCount() > 1 && !player.getAbilities().creativeMode){
// ItemsHelper.insertNewItem(player, new ItemStack(Items.BUCKET));
// stack.decrement(1);
// cir.setReturnValue(stack);
// }
// }
}