From af744fa088a7fc074851112e231b652039ac9cf8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 4 Apr 2019 18:55:25 -0700 Subject: [PATCH] Villagers give XP now --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/util/Misc.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index ba128ce29..5bbdcfde1 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ Key: Version 2.1.36 Updated German locale (Thanks OverCrave) + Fixed a bug preventing Villagers from giving combat XP The /mcnotify command will now squelch almost all chat messages or action bar notifications sent to the player from mcMMO mcMMO will now remind players on an hourly basis that they are are not receiving notifications from mcMMO if they have run the mcnotify command and toggled squelch mode Added a new setting to advanced.yml "Feedback.PlayerTips", when set to true this will allow mcMMO to send periodic helpful messages to players, currently this only affects mcnotify reminders. diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index fc9fb9e68..e2e680e2e 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -8,10 +8,7 @@ import com.google.common.collect.ImmutableSet; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockState; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Item; -import org.bukkit.entity.NPC; -import org.bukkit.entity.Player; +import org.bukkit.entity.*; import org.bukkit.inventory.ItemStack; import java.util.Collection; @@ -43,7 +40,10 @@ public final class Misc { private Misc() {}; public static boolean isNPCEntity(Entity entity) { - return (entity == null || entity.hasMetadata("NPC") || entity instanceof NPC || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); + return (entity == null + || (entity.hasMetadata("NPC") && !(entity instanceof Villager)) + || (entity instanceof NPC && !(entity instanceof Villager)) + || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); } /**