22
33import com .github .quiltservertools .ledger .callbacks .BlockBreakCallback ;
44import com .github .quiltservertools .ledger .utility .Sources ;
5- import com .llamalad7 .mixinextras .sugar .Local ;
65import net .minecraft .block .BlockState ;
7- import net .minecraft .block .Blocks ;
6+ import net .minecraft .block .LilyPadBlock ;
87import net .minecraft .entity .Entity ;
8+ import net .minecraft .entity .EntityCollisionHandler ;
99import net .minecraft .entity .player .PlayerEntity ;
1010import net .minecraft .util .math .BlockPos ;
1111import net .minecraft .world .World ;
1212import org .spongepowered .asm .mixin .Mixin ;
1313import org .spongepowered .asm .mixin .injection .At ;
1414import org .spongepowered .asm .mixin .injection .Inject ;
15- import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
15+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
1616
17- @ Mixin (World .class )
18- public abstract class LilyPadBreakageMixin {
19- @ Inject (method = "breakBlock" , at = @ At (value = "RETURN" , ordinal = 1 ))
20- private void ledgerModifyLilyPadBreakArgs (BlockPos pos , boolean drop , Entity entity , int maxUpdateDepth , CallbackInfoReturnable <Boolean > cir , @ Local BlockState state ) {
21- if (!state .getBlock ().equals (Blocks .LILY_PAD )) return ;
22- World world = (World ) (Object ) this ;
17+ @ Mixin (LilyPadBlock .class )
18+ public abstract class LilyPadBlockMixin {
19+ @ Inject (method = "onEntityCollision" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/world/World;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;)Z" ))
20+ private void ledgerLogLilyPadBreak (BlockState state , World world , BlockPos pos , Entity entity , EntityCollisionHandler handler , boolean bl , CallbackInfo ci ) {
2321 if (entity .getFirstPassenger () instanceof PlayerEntity player ) {
24- BlockBreakCallback .EVENT .invoker ().breakBlock (world , pos , state , null , Sources .VEHICLE , player );
22+ BlockBreakCallback .EVENT .invoker ().breakBlock (world , new BlockPos ( pos ) , state , null , Sources .VEHICLE , player );
2523 } else {
26- BlockBreakCallback .EVENT .invoker ().breakBlock (world , pos , state , null , Sources .VEHICLE );
24+ BlockBreakCallback .EVENT .invoker ().breakBlock (world , new BlockPos ( pos ) , state , null , Sources .VEHICLE );
2725 }
2826 }
2927}
0 commit comments