@@ -69,7 +69,7 @@ public class CraftFox extends CraftAnimals implements Fox {
|
||||
|
||||
@Override
|
||||
public AnimalTamer getFirstTrustedPlayer() {
|
||||
UUID uuid = getHandle().getDataWatcher().get(EntityFox.by).orElse(null);
|
||||
UUID uuid = getHandle().getDataWatcher().get(EntityFox.FIRST_TRUSTED_PLAYER).orElse(null);
|
||||
if (uuid == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -84,16 +84,16 @@ public class CraftFox extends CraftAnimals implements Fox {
|
||||
|
||||
@Override
|
||||
public void setFirstTrustedPlayer(AnimalTamer player) {
|
||||
if (player == null && getHandle().getDataWatcher().get(EntityFox.bz).isPresent()) {
|
||||
if (player == null && getHandle().getDataWatcher().get(EntityFox.SECOND_TRUSTED_PLAYER).isPresent()) {
|
||||
throw new IllegalStateException("Must remove second trusted player first");
|
||||
}
|
||||
|
||||
getHandle().getDataWatcher().set(EntityFox.by, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
|
||||
getHandle().getDataWatcher().set(EntityFox.FIRST_TRUSTED_PLAYER, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimalTamer getSecondTrustedPlayer() {
|
||||
UUID uuid = getHandle().getDataWatcher().get(EntityFox.bz).orElse(null);
|
||||
UUID uuid = getHandle().getDataWatcher().get(EntityFox.SECOND_TRUSTED_PLAYER).orElse(null);
|
||||
if (uuid == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -108,10 +108,10 @@ public class CraftFox extends CraftAnimals implements Fox {
|
||||
|
||||
@Override
|
||||
public void setSecondTrustedPlayer(AnimalTamer player) {
|
||||
if (player != null && !getHandle().getDataWatcher().get(EntityFox.by).isPresent()) {
|
||||
if (player != null && !getHandle().getDataWatcher().get(EntityFox.FIRST_TRUSTED_PLAYER).isPresent()) {
|
||||
throw new IllegalStateException("Must add first trusted player first");
|
||||
}
|
||||
|
||||
getHandle().getDataWatcher().set(EntityFox.bz, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
|
||||
getHandle().getDataWatcher().set(EntityFox.SECOND_TRUSTED_PLAYER, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,11 +52,11 @@ public abstract class CraftRaider extends CraftMonster implements Raider {
|
||||
|
||||
@Override
|
||||
public boolean isCanJoinRaid() {
|
||||
return getHandle().eD();
|
||||
return getHandle().isCanJoinRaid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanJoinRaid(boolean join) {
|
||||
getHandle().u(join);
|
||||
getHandle().setCanJoinRaid(join);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user