Fix AttackBlockCallback being fired for incorrect player actions (#520)

This commit is contained in:
modmuss50 2020-03-11 11:53:39 +00:00
parent 6d7c2994e1
commit 04b9979457
2 changed files with 2 additions and 1 deletions

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-events-interaction-v0"
version = getSubprojectVersion(project, "0.2.10")
version = getSubprojectVersion(project, "0.3.0")
dependencies {
compile project(path: ':fabric-api-base', configuration: 'dev')

View file

@ -51,6 +51,7 @@ public class MixinServerPlayerInteractionManager {
@Inject(at = @At("HEAD"), method = "processBlockBreakingAction", cancellable = true)
public void startBlockBreak(BlockPos pos, PlayerActionC2SPacket.Action playerAction, Direction direction, int i, CallbackInfo info) {
if (playerAction != PlayerActionC2SPacket.Action.START_DESTROY_BLOCK) return;
ActionResult result = AttackBlockCallback.EVENT.invoker().interact(player, world, Hand.MAIN_HAND, pos, direction);
if (result != ActionResult.PASS) {