Update forge to 44.1.23
This commit is contained in:
parent
00eaff7c0b
commit
d7b3eb15df
|
@ -35,7 +35,8 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||||
public abstract class BucketItemMixin {
|
public abstract class BucketItemMixin {
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
@Shadow public abstract boolean emptyContents(@javax.annotation.Nullable Player player, Level worldIn, BlockPos posIn, @javax.annotation.Nullable BlockHitResult rayTrace);
|
@Shadow public abstract boolean emptyContents(@Nullable Player player, Level worldIn, BlockPos posIn, @javax.annotation.Nullable BlockHitResult rayTrace);
|
||||||
|
@Shadow(remap = false) public abstract boolean emptyContents(@Nullable Player p_150716_, Level p_150717_, BlockPos p_150718_, @Nullable BlockHitResult p_150719_, @Nullable ItemStack container);
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
@Inject(method = "use", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/BucketPickup;pickupBlock(Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)Lnet/minecraft/world/item/ItemStack;"))
|
@Inject(method = "use", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/BucketPickup;pickupBlock(Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)Lnet/minecraft/world/item/ItemStack;"))
|
||||||
|
@ -54,11 +55,10 @@ public abstract class BucketItemMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "use", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/BucketItem;emptyContents(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/phys/BlockHitResult;)Z"))
|
@Inject(method = "use", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/world/item/BucketItem;emptyContents(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/phys/BlockHitResult;Lnet/minecraft/world/item/ItemStack;)Z"))
|
||||||
private void arclight$capture(Level worldIn, Player playerIn, InteractionHand handIn, CallbackInfoReturnable<InteractionResultHolder<ItemStack>> cir, ItemStack stack, BlockHitResult result) {
|
private void arclight$capture(Level worldIn, Player playerIn, InteractionHand handIn, CallbackInfoReturnable<InteractionResultHolder<ItemStack>> cir, ItemStack stack, BlockHitResult result) {
|
||||||
arclight$direction = result.getDirection();
|
arclight$direction = result.getDirection();
|
||||||
arclight$click = result.getBlockPos();
|
arclight$click = result.getBlockPos();
|
||||||
arclight$stack = stack;
|
|
||||||
arclight$hand = handIn;
|
arclight$hand = handIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,6 @@ public abstract class BucketItemMixin {
|
||||||
arclight$captureItem = null;
|
arclight$captureItem = null;
|
||||||
arclight$direction = null;
|
arclight$direction = null;
|
||||||
arclight$click = null;
|
arclight$click = null;
|
||||||
arclight$stack = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private transient org.bukkit.inventory.@Nullable ItemStack arclight$captureItem;
|
private transient org.bukkit.inventory.@Nullable ItemStack arclight$captureItem;
|
||||||
|
@ -80,27 +79,24 @@ public abstract class BucketItemMixin {
|
||||||
public boolean emptyContents(Player entity, Level world, BlockPos pos, @Nullable BlockHitResult result, Direction direction, BlockPos clicked, ItemStack itemstack, InteractionHand hand) {
|
public boolean emptyContents(Player entity, Level world, BlockPos pos, @Nullable BlockHitResult result, Direction direction, BlockPos clicked, ItemStack itemstack, InteractionHand hand) {
|
||||||
arclight$direction = direction;
|
arclight$direction = direction;
|
||||||
arclight$click = clicked;
|
arclight$click = clicked;
|
||||||
arclight$stack = itemstack;
|
|
||||||
arclight$hand = hand;
|
arclight$hand = hand;
|
||||||
try {
|
try {
|
||||||
return this.emptyContents(entity, world, pos, result);
|
return this.emptyContents(entity, world, pos, result, itemstack);
|
||||||
} finally {
|
} finally {
|
||||||
arclight$direction = null;
|
arclight$direction = null;
|
||||||
arclight$click = null;
|
arclight$click = null;
|
||||||
arclight$stack = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private transient Direction arclight$direction;
|
private transient Direction arclight$direction;
|
||||||
private transient BlockPos arclight$click;
|
private transient BlockPos arclight$click;
|
||||||
private transient ItemStack arclight$stack;
|
|
||||||
private transient InteractionHand arclight$hand;
|
private transient InteractionHand arclight$hand;
|
||||||
|
|
||||||
@Inject(method = "emptyContents", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/dimension/DimensionType;ultraWarm()Z"))
|
@Inject(method = "emptyContents(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/phys/BlockHitResult;Lnet/minecraft/world/item/ItemStack;)Z", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/dimension/DimensionType;ultraWarm()Z"))
|
||||||
private void arclight$bucketEmpty(Player player, Level worldIn, BlockPos posIn, BlockHitResult rayTrace, CallbackInfoReturnable<Boolean> cir) {
|
private void arclight$bucketEmpty(Player player, Level worldIn, BlockPos posIn, BlockHitResult rayTrace, ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (!DistValidate.isValid(worldIn)) return;
|
if (!DistValidate.isValid(worldIn)) return;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((ServerLevel) worldIn, player, posIn, arclight$click, arclight$direction, arclight$stack, arclight$hand == null ? InteractionHand.MAIN_HAND : arclight$hand);
|
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((ServerLevel) worldIn, player, posIn, arclight$click, arclight$direction, stack, arclight$hand == null ? InteractionHand.MAIN_HAND : arclight$hand);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
((ServerPlayer) player).connection.send(new ClientboundBlockUpdatePacket(worldIn, posIn));
|
((ServerPlayer) player).connection.send(new ClientboundBlockUpdatePacket(worldIn, posIn));
|
||||||
((ServerPlayerEntityBridge) player).bridge$getBukkitEntity().updateInventory();
|
((ServerPlayerEntityBridge) player).bridge$getBukkitEntity().updateInventory();
|
||||||
|
|
|
@ -14,7 +14,7 @@ allprojects {
|
||||||
ext {
|
ext {
|
||||||
agpVersion = '1.23'
|
agpVersion = '1.23'
|
||||||
minecraftVersion = '1.19.3'
|
minecraftVersion = '1.19.3'
|
||||||
forgeVersion = '44.1.8'
|
forgeVersion = '44.1.23'
|
||||||
apiVersion = '1.5.1'
|
apiVersion = '1.5.1'
|
||||||
toolsVersion = '1.3.0'
|
toolsVersion = '1.3.0'
|
||||||
mixinVersion = '0.8.5'
|
mixinVersion = '0.8.5'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user