mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
@@ -30,10 +30,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||||||
|
|
||||||
@Mixin(BlockItem.class)
|
@Mixin(BlockItem.class)
|
||||||
public abstract class MixinBlockItem {
|
public abstract class MixinBlockItem {
|
||||||
@Inject(method = "place",
|
@Inject(method = "place", at = @At("HEAD"), cancellable = true)
|
||||||
at = @At(value = "INVOKE",
|
|
||||||
target = "Lnet/minecraft/world/item/context/BlockPlaceContext;getClickedPos()Lnet/minecraft/core/BlockPos;"),
|
|
||||||
cancellable = true)
|
|
||||||
private void place(BlockPlaceContext context, CallbackInfoReturnable<InteractionResult> cir) {
|
private void place(BlockPlaceContext context, CallbackInfoReturnable<InteractionResult> cir) {
|
||||||
var result = BlockEvent.PLACE.invoker().placeBlock(context.getLevel(), context.getClickedPos(), context.getLevel().getBlockState(context.getClickedPos()), context.getPlayer());
|
var result = BlockEvent.PLACE.invoker().placeBlock(context.getLevel(), context.getClickedPos(), context.getLevel().getBlockState(context.getClickedPos()), context.getPlayer());
|
||||||
if (result.isPresent()) {
|
if (result.isPresent()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user