Skip to content

Commit

Permalink
Fix Maven build failure (#4779)
Browse files Browse the repository at this point in the history
  • Loading branch information
abridgedcarp committed Jun 9, 2022
1 parent c40af91 commit d543843
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Expand Up @@ -2,12 +2,13 @@

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);
}
}
Expand Up @@ -841,7 +841,7 @@ public void onPlayerInteractMonitor(PlayerInteractEvent event) {

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) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/gmail/nossr50/util/EventUtils.java
Expand Up @@ -44,6 +44,7 @@
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;
Expand Down Expand Up @@ -225,7 +226,7 @@ public static SubSkillEvent callSubSkillEvent(Player player, AbstractSubSkill ab
}

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;
Expand Down

0 comments on commit d543843

Please sign in to comment.