Add camel to horse types

This commit is contained in:
fullwall 2022-12-10 15:56:55 +08:00
parent b4b54dabdc
commit 5254f65945
2 changed files with 3 additions and 5 deletions

View File

@ -2,7 +2,7 @@ package net.citizensnpcs.trait;
import java.lang.invoke.MethodHandle;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ChestedHorse;
import org.bukkit.entity.Horse;
import org.bukkit.entity.Horse.Color;
import org.bukkit.entity.Horse.Style;
@ -113,9 +113,7 @@ public class HorseModifiers extends Trait {
}
if (CARRYING_CHEST_METHOD == null)
return;
EntityType type = npc.getEntity().getType();
if (type.name().equals("LLAMA") || type.name().equals("TRADER_LLAMA") || type.name().equals("DONKEY")
|| type.name().equals("MULE")) {
if (npc.getEntity() instanceof ChestedHorse) {
try {
CARRYING_CHEST_METHOD.invoke(npc.getEntity(), carryingChest);
} catch (Throwable e) {

View File

@ -240,7 +240,7 @@ public class Util {
public static boolean isHorse(EntityType type) {
String name = type.name();
return type == EntityType.HORSE || name.contains("_HORSE") || name.equals("DONKEY") || name.equals("MULE")
|| name.equals("LLAMA") || name.equals("TRADER_LLAMA");
|| name.equals("LLAMA") || name.equals("TRADER_LLAMA") || name.equals("CAMEL");
}
public static boolean isLoaded(Location location) {