Fix Maven build failure (#4779)

This commit is contained in:
abridgedcarp 2022-06-09 21:26:50 +00:00 committed by GitHub
parent c40af913f4
commit d543843235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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;