forked from Upstream/mmocore
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
93ad4c8a0b
@ -1115,8 +1115,8 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
*/
|
*/
|
||||||
public void bindPassiveSkill(int slot, @NotNull PassiveSkill skill) {
|
public void bindPassiveSkill(int slot, @NotNull PassiveSkill skill) {
|
||||||
Validate.notNull(skill, "Skill cannot be null");
|
Validate.notNull(skill, "Skill cannot be null");
|
||||||
final int maxBound = getProfess().getMaxBoundActiveSkills();
|
final int maxBound = getProfess().getMaxBoundPassiveSkills();
|
||||||
if (slot > 0 && boundPassiveSkills.size() >= maxBound) {
|
if (slot >= 0 && boundPassiveSkills.size() >= maxBound) {
|
||||||
final @NotNull PassiveSkill current = boundPassiveSkills.set(slot, skill);
|
final @NotNull PassiveSkill current = boundPassiveSkills.set(slot, skill);
|
||||||
if (current != null)
|
if (current != null)
|
||||||
current.unregister(mmoData);
|
current.unregister(mmoData);
|
||||||
@ -1151,7 +1151,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
*/
|
*/
|
||||||
public void bindActiveSkill(int slot, ClassSkill skill) {
|
public void bindActiveSkill(int slot, ClassSkill skill) {
|
||||||
Validate.notNull(skill, "Skill cannot be null");
|
Validate.notNull(skill, "Skill cannot be null");
|
||||||
if (slot > 0 && boundSkills.size() >= getProfess().getMaxBoundActiveSkills())
|
if (slot >= 0 && boundSkills.size() >= getProfess().getMaxBoundActiveSkills())
|
||||||
boundSkills.set(slot, skill);
|
boundSkills.set(slot, skill);
|
||||||
else
|
else
|
||||||
boundSkills.add(skill);
|
boundSkills.add(skill);
|
||||||
|
@ -173,9 +173,6 @@ public class PlayerQuests implements Closable {
|
|||||||
bossbar.removeAll();
|
bossbar.removeAll();
|
||||||
Bukkit.removeBossBar(bossbarNamespacedKey);
|
Bukkit.removeBossBar(bossbarNamespacedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close current objective progress
|
|
||||||
closeCurrentQuest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkCooldownAvailability(Quest quest) {
|
public boolean checkCooldownAvailability(Quest quest) {
|
||||||
|
@ -36,7 +36,7 @@ public class GuildCommand extends RegisteredCommand {
|
|||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) return true;
|
if (event.isCancelled()) return true;
|
||||||
|
|
||||||
if (args.length > 1) {
|
if (args.length >= 1) {
|
||||||
|
|
||||||
final @Nullable GuildInvite invite;
|
final @Nullable GuildInvite invite;
|
||||||
if (args.length > 1)
|
if (args.length > 1)
|
||||||
|
@ -171,7 +171,7 @@ public class PlayerProfessions {
|
|||||||
public void giveExperience(Profession profession, double value, EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
public void giveExperience(Profession profession, double value, EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
||||||
Validate.isTrue(playerData.isOnline(), "Cannot give experience to offline player");
|
Validate.isTrue(playerData.isOnline(), "Cannot give experience to offline player");
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
exp.put(profession.getId(), Math.max(0, exp.get(profession.getId() + value)));
|
exp.put(profession.getId(), Math.max(0, exp.get(profession.getId()) + value));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import net.Indyuce.mmocore.experience.dispenser.ExperienceDispenser;
|
|||||||
import net.Indyuce.mmocore.experience.source.type.SpecificExperienceSource;
|
import net.Indyuce.mmocore.experience.source.type.SpecificExperienceSource;
|
||||||
import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager;
|
import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
@ -68,7 +69,7 @@ public class MoveExperienceSource extends SpecificExperienceSource {
|
|||||||
FLY((p) -> p.isFlying() || p.isGliding()),
|
FLY((p) -> p.isFlying() || p.isGliding()),
|
||||||
SWIM((p) -> p.getLocation().getBlock().isLiquid()),
|
SWIM((p) -> p.getLocation().getBlock().isLiquid()),
|
||||||
SPRINT(Player::isSprinting),
|
SPRINT(Player::isSprinting),
|
||||||
WALK((p) -> !p.isSneaking() && !p.isSprinting() && !p.isFlying() && !p.getLocation().getBlock().isLiquid());
|
WALK((p) -> !p.isSneaking() && !p.isSprinting() &&((Entity)p).isOnGround()&& !p.isFlying() && !p.getLocation().getBlock().isLiquid());
|
||||||
|
|
||||||
private final Function<Player, Boolean> matching;
|
private final Function<Player, Boolean> matching;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user