|
1 | 1 | package de.mari_023.ae2wtlib.mixin; |
2 | 2 |
|
3 | | -import de.mari_023.ae2wtlib.AE2wtlibEvents; |
| 3 | +import org.spongepowered.asm.mixin.Mixin; |
| 4 | +import org.spongepowered.asm.mixin.injection.At; |
| 5 | +import org.spongepowered.asm.mixin.injection.Inject; |
| 6 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
| 7 | + |
4 | 8 | import net.minecraft.server.level.ServerPlayer; |
5 | 9 | import net.minecraft.server.level.ServerPlayerGameMode; |
6 | 10 | import net.minecraft.world.InteractionHand; |
7 | 11 | import net.minecraft.world.InteractionResult; |
8 | 12 | import net.minecraft.world.item.ItemStack; |
9 | 13 | import net.minecraft.world.level.Level; |
10 | 14 | import net.minecraft.world.phys.BlockHitResult; |
11 | | -import org.spongepowered.asm.mixin.Mixin; |
12 | | -import org.spongepowered.asm.mixin.injection.At; |
13 | | -import org.spongepowered.asm.mixin.injection.Inject; |
14 | | -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
| 15 | + |
| 16 | +import de.mari_023.ae2wtlib.AE2wtlibEvents; |
15 | 17 |
|
16 | 18 | @Mixin(ServerPlayerGameMode.class) |
17 | 19 | public class ServerPlayerGameModeMixin { |
18 | | - |
19 | 20 | @Inject(method = "useItemOn", at = @At(value = "RETURN")) |
20 | | - private static void handle(ServerPlayer player, Level level, ItemStack original, InteractionHand hand, BlockHitResult hitResult, CallbackInfoReturnable<InteractionResult> cir) { |
| 21 | + private static void handle(ServerPlayer player, Level level, ItemStack original, InteractionHand hand, |
| 22 | + BlockHitResult hitResult, CallbackInfoReturnable<InteractionResult> cir) { |
21 | 23 | AE2wtlibEvents.restock(player, original.copy(), player.getItemInHand(hand).getCount(), |
22 | 24 | (stack -> player.setItemInHand(hand, stack))); |
23 | 25 | } |
|
0 commit comments