diff --git a/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java b/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java index 075928bb4..3f7a8cfec 100644 --- a/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java +++ b/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java @@ -2,12 +2,13 @@ package com.gmail.nossr50.events.fake; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerAnimationEvent; +import org.bukkit.event.player.PlayerAnimationType; /** * Called when handling extra drops to avoid issues with NoCheat. */ public class FakePlayerAnimationEvent extends PlayerAnimationEvent implements FakeEvent { - public FakePlayerAnimationEvent(Player player) { - super(player); + public FakePlayerAnimationEvent(Player player, PlayerAnimationType playerAnimationType) { + super(player, playerAnimationType); } } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 2eb17c405..c28a91ef5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -841,7 +841,7 @@ public class PlayerListener implements Listener { HerbalismManager herbalismManager = mcMMOPlayer.getHerbalismManager(); - FakePlayerAnimationEvent fakeSwing = new FakePlayerAnimationEvent(event.getPlayer()); //PlayerAnimationEvent compat + FakePlayerAnimationEvent fakeSwing = new FakePlayerAnimationEvent(event.getPlayer(), PlayerAnimationType.ARM_SWING); //PlayerAnimationEvent compat if(!event.isCancelled() || event.useInteractedBlock() != Event.Result.DENY) { //TODO: Is this code to set false from bone meal even needed? I'll have to double check later. if (heldItem.getType() == Material.BONE_MEAL) { diff --git a/src/main/java/com/gmail/nossr50/util/EventUtils.java b/src/main/java/com/gmail/nossr50/util/EventUtils.java index 81bec7e50..7ccfa1856 100644 --- a/src/main/java/com/gmail/nossr50/util/EventUtils.java +++ b/src/main/java/com/gmail/nossr50/util/EventUtils.java @@ -44,6 +44,7 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerAnimationType; import org.bukkit.event.player.PlayerFishEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; @@ -225,7 +226,7 @@ public final class EventUtils { } public static FakePlayerAnimationEvent callFakeArmSwingEvent(Player player) { - FakePlayerAnimationEvent event = new FakePlayerAnimationEvent(player); + FakePlayerAnimationEvent event = new FakePlayerAnimationEvent(player, PlayerAnimationType.ARM_SWING); mcMMO.p.getServer().getPluginManager().callEvent(event); return event;