33 lines
1.1 KiB
Java
33 lines
1.1 KiB
Java
package net.shadowfacts.doubledoors.mixin;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
import net.minecraft.block.DoorBlock;
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
import net.minecraft.util.Hand;
|
|
import net.minecraft.util.hit.BlockHitResult;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
import net.shadowfacts.doubledoors.DoubleDoors;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
@Mixin(DoorBlock.class)
|
|
public class MixinDoorBlock {
|
|
|
|
@Inject(
|
|
method = "activate",
|
|
at = @At(
|
|
value = "INVOKE",
|
|
target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"
|
|
)
|
|
)
|
|
public void activate(BlockState newDoorState, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult result, CallbackInfoReturnable<Boolean> cb) {
|
|
DoubleDoors.onDoorActivated(newDoorState, world, pos, player, hand, result);
|
|
}
|
|
}
|