mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-28 00:55:29 +01:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java # src/main/java/net/Indyuce/mmocore/comp/MMOCoreTargetRestriction.java
This commit is contained in:
commit
8b317db4b8
@ -177,8 +177,9 @@ public class MMOCore extends LuminePlugin {
|
|||||||
for (PlayerData player : PlayerData.getAll())
|
for (PlayerData player : PlayerData.getAll())
|
||||||
if (player.isOnline() && !player.getPlayer().isDead())
|
if (player.isOnline() && !player.getPlayer().isDead())
|
||||||
for (PlayerResource resource : PlayerResource.values()) {
|
for (PlayerResource resource : PlayerResource.values()) {
|
||||||
double d = player.getProfess().getHandler(resource).getRegen(player);
|
double regenAmount = player.getProfess().getHandler(resource).getRegen(player);
|
||||||
if (d != 0) resource.regen(player, d);
|
if (regenAmount != 0)
|
||||||
|
resource.regen(player, regenAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.runTaskTimer(MMOCore.plugin, 100, 20);
|
}.runTaskTimer(MMOCore.plugin, 100, 20);
|
||||||
|
@ -15,7 +15,7 @@ public class VanillaBlockType implements BlockType {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* allows to plant back crops with a custom age so that it does not always
|
* allows to plant back crops with a custom age so that it does not always
|
||||||
* have to full grow again
|
* have to full grow again-
|
||||||
*/
|
*/
|
||||||
private final int age;
|
private final int age;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class CustomBlockMineEvent extends PlayerDataEvent implements Cancellable
|
|||||||
|
|
||||||
private final Block block;
|
private final Block block;
|
||||||
private final BlockInfo info;
|
private final BlockInfo info;
|
||||||
private final List<ItemStack> drops;
|
private List<ItemStack> drops;
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
|
||||||
@ -39,6 +39,10 @@ public class CustomBlockMineEvent extends PlayerDataEvent implements Cancellable
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDrops(List<ItemStack> list) {
|
||||||
|
this.drops = list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
|
@ -10,7 +10,7 @@ import net.Indyuce.mmocore.MMOCore;
|
|||||||
import net.Indyuce.mmocore.api.player.profess.event.EventTrigger;
|
import net.Indyuce.mmocore.api.player.profess.event.EventTrigger;
|
||||||
import net.Indyuce.mmocore.api.player.profess.resource.ManaDisplayOptions;
|
import net.Indyuce.mmocore.api.player.profess.resource.ManaDisplayOptions;
|
||||||
import net.Indyuce.mmocore.api.player.profess.resource.PlayerResource;
|
import net.Indyuce.mmocore.api.player.profess.resource.PlayerResource;
|
||||||
import net.Indyuce.mmocore.api.player.profess.resource.ResourceHandler;
|
import net.Indyuce.mmocore.api.player.profess.resource.ResourceRegeneration;
|
||||||
import net.Indyuce.mmocore.api.player.stats.StatType;
|
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
@ -47,7 +47,7 @@ public class PlayerClass extends PostLoadObject {
|
|||||||
private final Map<String, SkillInfo> skills = new LinkedHashMap<>();
|
private final Map<String, SkillInfo> skills = new LinkedHashMap<>();
|
||||||
private final List<Subclass> subclasses = new ArrayList<>();
|
private final List<Subclass> subclasses = new ArrayList<>();
|
||||||
|
|
||||||
private final Map<PlayerResource, ResourceHandler> resourceHandlers = new HashMap<>();
|
private final Map<PlayerResource, ResourceRegeneration> resourceHandlers = new HashMap<>();
|
||||||
private final Map<String, EventTrigger> eventTriggers = new HashMap<>();
|
private final Map<String, EventTrigger> eventTriggers = new HashMap<>();
|
||||||
|
|
||||||
private final CastingParticle castParticle;
|
private final CastingParticle castParticle;
|
||||||
@ -142,7 +142,7 @@ public class PlayerClass extends PostLoadObject {
|
|||||||
String format = key.toLowerCase().replace("_", "-").replace(" ", "-");
|
String format = key.toLowerCase().replace("_", "-").replace(" ", "-");
|
||||||
eventTriggers.put(format, new EventTrigger(format, config.getStringList("triggers." + key)));
|
eventTriggers.put(format, new EventTrigger(format, config.getStringList("triggers." + key)));
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (IllegalArgumentException exception) {
|
||||||
MMOCore.log(Level.WARNING, "[PlayerClasses:" + id + "] " + exception.getMessage());
|
MMOCore.log(Level.WARNING, "Could not load trigger '" + key + "' from class '" + id + "':" + exception.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,15 +153,15 @@ public class PlayerClass extends PostLoadObject {
|
|||||||
for (PlayerResource resource : PlayerResource.values()) {
|
for (PlayerResource resource : PlayerResource.values()) {
|
||||||
if (config.isConfigurationSection("resource." + resource.name().toLowerCase()))
|
if (config.isConfigurationSection("resource." + resource.name().toLowerCase()))
|
||||||
try {
|
try {
|
||||||
resourceHandlers.put(resource, new ResourceHandler(resource,
|
resourceHandlers.put(resource, new ResourceRegeneration(resource,
|
||||||
config.getConfigurationSection("resource." + resource.name().toLowerCase())));
|
config.getConfigurationSection("resource." + resource.name().toLowerCase())));
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (IllegalArgumentException exception) {
|
||||||
MMOCore.log(Level.WARNING, "[PlayerClasses:" + id + "] Could not load special resource regen for "
|
MMOCore.log(Level.WARNING, "Could not load special " + resource.name().toLowerCase() + " regen from class '"
|
||||||
+ resource.name() + ": " + exception.getMessage());
|
+ id + "': " + exception.getMessage());
|
||||||
resourceHandlers.put(resource, new ResourceHandler(resource));
|
resourceHandlers.put(resource, new ResourceRegeneration(resource));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
resourceHandlers.put(resource, new ResourceHandler(resource));
|
resourceHandlers.put(resource, new ResourceRegeneration(resource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class PlayerClass extends PostLoadObject {
|
|||||||
setOption(ClassOption.DEFAULT, false);
|
setOption(ClassOption.DEFAULT, false);
|
||||||
|
|
||||||
for (PlayerResource resource : PlayerResource.values())
|
for (PlayerResource resource : PlayerResource.values())
|
||||||
resourceHandlers.put(resource, new ResourceHandler(resource));
|
resourceHandlers.put(resource, new ResourceRegeneration(resource));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -215,7 +215,7 @@ public class PlayerClass extends PostLoadObject {
|
|||||||
return manaDisplay;
|
return manaDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceHandler getHandler(PlayerResource resource) {
|
public ResourceRegeneration getHandler(PlayerResource resource) {
|
||||||
return resourceHandlers.get(resource);
|
return resourceHandlers.get(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,39 +12,35 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
public enum PlayerResource {
|
public enum PlayerResource {
|
||||||
|
|
||||||
HEALTH(StatType.HEALTH_REGENERATION, ClassOption.OFF_COMBAT_HEALTH_REGEN,
|
HEALTH(data -> data.getPlayer().getHealth(),
|
||||||
(data) -> data.getPlayer().getHealth(),
|
|
||||||
data -> data.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(),
|
data -> data.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(),
|
||||||
(data, amount) -> data.heal(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
(data, amount) -> data.heal(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
||||||
(data, amount) -> data.heal(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.heal(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.heal(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.heal(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.getPlayer().setHealth(amount)),
|
(data, amount) -> data.getPlayer().setHealth(amount)),
|
||||||
|
|
||||||
MANA(StatType.MANA_REGENERATION, ClassOption.OFF_COMBAT_MANA_REGEN,
|
MANA(PlayerData::getMana,
|
||||||
PlayerData::getMana,
|
|
||||||
data -> data.getStats().getStat(StatType.MAX_MANA),
|
data -> data.getStats().getStat(StatType.MAX_MANA),
|
||||||
(data, amount) -> data.giveMana(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
(data, amount) -> data.giveMana(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
||||||
(data, amount) -> data.giveMana(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveMana(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.giveMana(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveMana(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.setMana(amount)),
|
(data, amount) -> data.setMana(amount)),
|
||||||
|
|
||||||
STAMINA(StatType.STAMINA_REGENERATION, ClassOption.OFF_COMBAT_STAMINA_REGEN,
|
STAMINA(PlayerData::getStamina,
|
||||||
PlayerData::getStamina,
|
|
||||||
data -> data.getStats().getStat(StatType.MAX_STAMINA),
|
data -> data.getStats().getStat(StatType.MAX_STAMINA),
|
||||||
(data, amount) -> data.giveStamina(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
(data, amount) -> data.giveStamina(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
||||||
(data, amount) -> data.giveStamina(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveStamina(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.giveStamina(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveStamina(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.setStamina(amount)),
|
(data, amount) -> data.setStamina(amount)),
|
||||||
|
|
||||||
STELLIUM(StatType.STELLIUM_REGENERATION, ClassOption.OFF_COMBAT_STELLIUM_REGEN,
|
STELLIUM(PlayerData::getStellium,
|
||||||
PlayerData::getStellium,
|
|
||||||
data -> data.getStats().getStat(StatType.MAX_STELLIUM),
|
data -> data.getStats().getStat(StatType.MAX_STELLIUM),
|
||||||
(data, amount) -> data.giveStellium(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
(data, amount) -> data.giveStellium(amount, PlayerResourceUpdateEvent.UpdateReason.REGENERATION),
|
||||||
(data, amount) -> data.giveStellium(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveStellium(amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.giveStellium(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
(data, amount) -> data.giveStellium(-amount, PlayerResourceUpdateEvent.UpdateReason.COMMAND),
|
||||||
(data, amount) -> data.setStellium(amount));
|
(data, amount) -> data.setStellium(amount));
|
||||||
|
|
||||||
private final StatType regenStat;
|
private final StatType regenStat, maxRegenStat;
|
||||||
private final ClassOption offCombatRegen;
|
private final ClassOption offCombatRegen;
|
||||||
private final Function<PlayerData, Double> current, max;
|
private final Function<PlayerData, Double> current, max;
|
||||||
private final BiConsumer<PlayerData, Double> regen;
|
private final BiConsumer<PlayerData, Double> regen;
|
||||||
@ -52,15 +48,15 @@ public enum PlayerResource {
|
|||||||
// Used for MMOCore commands
|
// Used for MMOCore commands
|
||||||
private final BiConsumer<PlayerData, Double> set, give, take;
|
private final BiConsumer<PlayerData, Double> set, give, take;
|
||||||
|
|
||||||
PlayerResource(StatType regenStat, ClassOption offCombatRegen,
|
PlayerResource(Function<PlayerData, Double> current,
|
||||||
Function<PlayerData, Double> current,
|
|
||||||
Function<PlayerData, Double> max,
|
Function<PlayerData, Double> max,
|
||||||
BiConsumer<PlayerData, Double> regen,
|
BiConsumer<PlayerData, Double> regen,
|
||||||
BiConsumer<PlayerData, Double> give,
|
BiConsumer<PlayerData, Double> give,
|
||||||
BiConsumer<PlayerData, Double> take,
|
BiConsumer<PlayerData, Double> take,
|
||||||
BiConsumer<PlayerData, Double> set) {
|
BiConsumer<PlayerData, Double> set) {
|
||||||
this.regenStat = regenStat;
|
this.regenStat = StatType.valueOf(name() + "_REGENERATION");
|
||||||
this.offCombatRegen = offCombatRegen;
|
this.maxRegenStat = StatType.valueOf("MAX_" + name() + "_REGENERATION");
|
||||||
|
this.offCombatRegen = ClassOption.valueOf("OFF_COMBAT_" + name() + "_REGEN");
|
||||||
this.current = current;
|
this.current = current;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
this.regen = regen;
|
this.regen = regen;
|
||||||
@ -70,12 +66,19 @@ public enum PlayerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Stat which corresponds to resource regeneration
|
* @return Stat which corresponds to flat resource regeneration
|
||||||
*/
|
*/
|
||||||
public StatType getRegenStat() {
|
public StatType getRegenStat() {
|
||||||
return regenStat;
|
return regenStat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Stat which corresponds to resource regeneration scaling with the player's max health
|
||||||
|
*/
|
||||||
|
public StatType getMaxRegenStat() {
|
||||||
|
return maxRegenStat;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Class option which determines whether or not resource should be
|
* @return Class option which determines whether or not resource should be
|
||||||
* regenerated off combat only
|
* regenerated off combat only
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.api.player.profess.resource;
|
|
||||||
|
|
||||||
import java.util.function.BiFunction;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
|
||||||
|
|
||||||
public class ResourceHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource should only regenerate when the player is out of combat
|
|
||||||
*/
|
|
||||||
private final boolean offCombatOnly;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Percentage of scaling which the player regenerates every second
|
|
||||||
*/
|
|
||||||
private final LinearValue scalar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the resource regeneration scales on missing or max resource. if
|
|
||||||
* TYPE is null, then there is no special regeneration.
|
|
||||||
*/
|
|
||||||
private final HandlerType type;
|
|
||||||
private final PlayerResource resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used when there is no special resource regeneration
|
|
||||||
*/
|
|
||||||
public ResourceHandler(PlayerResource resource) {
|
|
||||||
this(resource, null, null, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceHandler(PlayerResource resource, ConfigurationSection config) {
|
|
||||||
this.resource = resource;
|
|
||||||
offCombatOnly = config.getBoolean("off-combat");
|
|
||||||
|
|
||||||
Validate.isTrue(config.contains("type"), "Could not find resource regen scaling type");
|
|
||||||
type = HandlerType.valueOf(config.getString("type").toUpperCase());
|
|
||||||
|
|
||||||
Validate.notNull(config.getConfigurationSection("value"), "Could not find resource regen value config section");
|
|
||||||
scalar = new LinearValue(config.getConfigurationSection("value"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceHandler(PlayerResource resource, HandlerType type, LinearValue scalar, boolean offCombatOnly) {
|
|
||||||
this.resource = resource;
|
|
||||||
this.type = type;
|
|
||||||
this.scalar = scalar;
|
|
||||||
this.offCombatOnly = offCombatOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Apply regeneration formulas: first calculates base resource regen due to
|
|
||||||
* the player stats and then apply the special resource regeneration due to
|
|
||||||
* the player class
|
|
||||||
*
|
|
||||||
* @param player
|
|
||||||
* Player regenerating
|
|
||||||
* @return The amount of resource which should be regenerated EVERY SECOND
|
|
||||||
*/
|
|
||||||
public double getRegen(PlayerData player) {
|
|
||||||
double d = 0;
|
|
||||||
|
|
||||||
// base resource regeneration = value of the corresponding regen stat
|
|
||||||
if (!player.isInCombat() || !player.getProfess().hasOption(resource.getOffCombatRegen()))
|
|
||||||
d += player.getStats().getStat(resource.getRegenStat());
|
|
||||||
|
|
||||||
// extra resource regeneration based on CLASS, scales on LEVEL
|
|
||||||
if (type != null && (!player.isInCombat() || !offCombatOnly))
|
|
||||||
d = this.scalar.calculate(player.getLevel()) / 100 * type.getScaling(player, resource);
|
|
||||||
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum HandlerType {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource regeneration scales on max resource
|
|
||||||
*/
|
|
||||||
MAX((player, resource) -> resource.getMax(player)),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource regeneration scales on missing resource
|
|
||||||
*/
|
|
||||||
MISSING((player, resource) -> resource.getMax(player) - resource.getCurrent(player));
|
|
||||||
|
|
||||||
private final BiFunction<PlayerData, PlayerResource, Double> calculation;
|
|
||||||
|
|
||||||
HandlerType(BiFunction<PlayerData, PlayerResource, Double> calculation) {
|
|
||||||
this.calculation = calculation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getScaling(PlayerData player, PlayerResource resource) {
|
|
||||||
return calculation.apply(player, resource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,103 @@
|
|||||||
|
package net.Indyuce.mmocore.api.player.profess.resource;
|
||||||
|
|
||||||
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
public class ResourceRegeneration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource should only regenerate when the player is out of combat
|
||||||
|
*/
|
||||||
|
private final boolean offCombatOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Percentage of scaling which the player regenerates every second
|
||||||
|
*/
|
||||||
|
private final LinearValue scalar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the resource regeneration scales on missing or max resource. if
|
||||||
|
* TYPE is null, then there is no special regeneration.
|
||||||
|
*/
|
||||||
|
private final HandlerType type;
|
||||||
|
private final PlayerResource resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used when there is no special resource regeneration
|
||||||
|
*/
|
||||||
|
public ResourceRegeneration(PlayerResource resource) {
|
||||||
|
this(resource, null, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResourceRegeneration(PlayerResource resource, ConfigurationSection config) {
|
||||||
|
this.resource = resource;
|
||||||
|
offCombatOnly = config.getBoolean("off-combat");
|
||||||
|
|
||||||
|
Validate.isTrue(config.contains("type"), "Could not find resource regen scaling type");
|
||||||
|
type = HandlerType.valueOf(config.getString("type").toUpperCase());
|
||||||
|
|
||||||
|
Validate.notNull(config.getConfigurationSection("value"), "Could not find resource regen value config section");
|
||||||
|
scalar = new LinearValue(config.getConfigurationSection("value"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResourceRegeneration(PlayerResource resource, HandlerType type, LinearValue scalar, boolean offCombatOnly) {
|
||||||
|
this.resource = resource;
|
||||||
|
this.type = type;
|
||||||
|
this.scalar = scalar;
|
||||||
|
this.offCombatOnly = offCombatOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply regeneration formulas: first calculates base resource regen due to
|
||||||
|
* the player stats and then apply the special resource regeneration due to
|
||||||
|
* the player class
|
||||||
|
*
|
||||||
|
* @param player Player regenerating
|
||||||
|
* @return The amount of resource which should be regenerated EVERY SECOND
|
||||||
|
*/
|
||||||
|
public double getRegen(PlayerData player) {
|
||||||
|
double d = 0;
|
||||||
|
|
||||||
|
if (!player.isInCombat() || !player.getProfess().hasOption(resource.getOffCombatRegen())) {
|
||||||
|
|
||||||
|
// Flat resource regeneration
|
||||||
|
d += player.getStats().getStat(resource.getRegenStat());
|
||||||
|
|
||||||
|
// Component which scales with max resource
|
||||||
|
d += player.getStats().getStat(resource.getMaxRegenStat()) / 100 * resource.getMax(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special resource regeneration
|
||||||
|
if (type != null && (!player.isInCombat() || !offCombatOnly))
|
||||||
|
d += this.scalar.calculate(player.getLevel()) / 100 * type.getScaling(player, resource);
|
||||||
|
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum HandlerType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource regeneration scales on max resource
|
||||||
|
*/
|
||||||
|
MAX((player, resource) -> resource.getMax(player)),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource regeneration scales on missing resource
|
||||||
|
*/
|
||||||
|
MISSING((player, resource) -> resource.getMax(player) - resource.getCurrent(player));
|
||||||
|
|
||||||
|
private final BiFunction<PlayerData, PlayerResource, Double> calculation;
|
||||||
|
|
||||||
|
HandlerType(BiFunction<PlayerData, PlayerResource, Double> calculation) {
|
||||||
|
this.calculation = calculation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getScaling(PlayerData player, PlayerResource resource) {
|
||||||
|
return calculation.apply(player, resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package net.Indyuce.mmocore.api.player.stats;
|
package net.Indyuce.mmocore.api.player.stats;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
import io.lumine.mythic.lib.player.EquipmentSlot;
|
||||||
import io.lumine.mythic.lib.api.stat.StatInstance;
|
import io.lumine.mythic.lib.api.stat.StatInstance;
|
||||||
import io.lumine.mythic.lib.api.stat.StatMap;
|
import io.lumine.mythic.lib.api.stat.StatMap;
|
||||||
import io.lumine.mythic.lib.api.stat.modifier.ModifierSource;
|
import io.lumine.mythic.lib.api.stat.modifier.ModifierSource;
|
||||||
|
@ -1,40 +1,55 @@
|
|||||||
package net.Indyuce.mmocore.api.player.stats;
|
package net.Indyuce.mmocore.api.player.stats;
|
||||||
|
|
||||||
|
import io.lumine.mythic.lib.MythicLib;
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
import net.Indyuce.mmocore.api.ConfigFile;
|
import net.Indyuce.mmocore.api.ConfigFile;
|
||||||
import net.Indyuce.mmocore.experience.Profession;
|
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
import io.lumine.mythic.lib.MythicLib;
|
import net.Indyuce.mmocore.experience.Profession;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
public enum StatType {
|
public enum StatType {
|
||||||
|
|
||||||
|
// Vanilla stats
|
||||||
ATTACK_DAMAGE,
|
ATTACK_DAMAGE,
|
||||||
ATTACK_SPEED,
|
ATTACK_SPEED,
|
||||||
MAX_HEALTH,
|
MAX_HEALTH,
|
||||||
HEALTH_REGENERATION,
|
HEALTH_REGENERATION,
|
||||||
|
MAX_HEALTH_REGENERATION,
|
||||||
|
|
||||||
|
// Misc
|
||||||
MOVEMENT_SPEED,
|
MOVEMENT_SPEED,
|
||||||
SPEED_MALUS_REDUCTION,
|
SPEED_MALUS_REDUCTION,
|
||||||
KNOCKBACK_RESISTANCE,
|
KNOCKBACK_RESISTANCE,
|
||||||
|
|
||||||
|
// Mana
|
||||||
MAX_MANA,
|
MAX_MANA,
|
||||||
MAX_STAMINA,
|
|
||||||
MAX_STELLIUM,
|
|
||||||
MANA_REGENERATION,
|
MANA_REGENERATION,
|
||||||
STAMINA_REGENERATION,
|
MAX_MANA_REGENERATION,
|
||||||
STELLIUM_REGENERATION,
|
|
||||||
|
|
||||||
|
// Stamina
|
||||||
|
MAX_STAMINA,
|
||||||
|
STAMINA_REGENERATION,
|
||||||
|
MAX_STAMINA_REGENERATION,
|
||||||
|
|
||||||
|
// Stellium
|
||||||
|
MAX_STELLIUM,
|
||||||
|
STELLIUM_REGENERATION,
|
||||||
|
MAX_STELLIUM_REGENERATION,
|
||||||
|
|
||||||
|
// Vanilla armor stats
|
||||||
ARMOR,
|
ARMOR,
|
||||||
ARMOR_TOUGHNESS,
|
ARMOR_TOUGHNESS,
|
||||||
|
|
||||||
|
// Critical strikes
|
||||||
CRITICAL_STRIKE_CHANCE,
|
CRITICAL_STRIKE_CHANCE,
|
||||||
CRITICAL_STRIKE_POWER,
|
CRITICAL_STRIKE_POWER,
|
||||||
SKILL_CRITICAL_STRIKE_CHANCE,
|
SKILL_CRITICAL_STRIKE_CHANCE,
|
||||||
SKILL_CRITICAL_STRIKE_POWER,
|
SKILL_CRITICAL_STRIKE_POWER,
|
||||||
|
|
||||||
|
// Mitigation
|
||||||
|
DEFENSE,
|
||||||
BLOCK_POWER,
|
BLOCK_POWER,
|
||||||
BLOCK_RATING,
|
BLOCK_RATING,
|
||||||
BLOCK_COOLDOWN_REDUCTION,
|
BLOCK_COOLDOWN_REDUCTION,
|
||||||
@ -43,9 +58,11 @@ public enum StatType {
|
|||||||
PARRY_RATING,
|
PARRY_RATING,
|
||||||
PARRY_COOLDOWN_REDUCTION,
|
PARRY_COOLDOWN_REDUCTION,
|
||||||
|
|
||||||
|
// Utility
|
||||||
ADDITIONAL_EXPERIENCE,
|
ADDITIONAL_EXPERIENCE,
|
||||||
COOLDOWN_REDUCTION,
|
COOLDOWN_REDUCTION,
|
||||||
|
|
||||||
|
// Damage-type based stats
|
||||||
MAGIC_DAMAGE,
|
MAGIC_DAMAGE,
|
||||||
PHYSICAL_DAMAGE,
|
PHYSICAL_DAMAGE,
|
||||||
PROJECTILE_DAMAGE,
|
PROJECTILE_DAMAGE,
|
||||||
@ -53,10 +70,11 @@ public enum StatType {
|
|||||||
SKILL_DAMAGE,
|
SKILL_DAMAGE,
|
||||||
UNDEAD_DAMAGE,
|
UNDEAD_DAMAGE,
|
||||||
|
|
||||||
|
// Misc damage stats
|
||||||
PVP_DAMAGE,
|
PVP_DAMAGE,
|
||||||
PVE_DAMAGE,
|
PVE_DAMAGE,
|
||||||
|
|
||||||
DEFENSE,
|
// Damage reduction stats
|
||||||
DAMAGE_REDUCTION,
|
DAMAGE_REDUCTION,
|
||||||
MAGIC_DAMAGE_REDUCTION,
|
MAGIC_DAMAGE_REDUCTION,
|
||||||
PHYSICAL_DAMAGE_REDUCTION,
|
PHYSICAL_DAMAGE_REDUCTION,
|
||||||
@ -64,22 +82,34 @@ public enum StatType {
|
|||||||
WEAPON_DAMAGE_REDUCTION,
|
WEAPON_DAMAGE_REDUCTION,
|
||||||
SKILL_DAMAGE_REDUCTION,
|
SKILL_DAMAGE_REDUCTION,
|
||||||
|
|
||||||
// reduces amount of tugs needed to fish
|
/**
|
||||||
|
* Reduces amount of tugs needed to fish
|
||||||
|
*/
|
||||||
FISHING_STRENGTH("fishing"),
|
FISHING_STRENGTH("fishing"),
|
||||||
|
|
||||||
// chance of instant success when fishing
|
/**
|
||||||
|
* Chance of instant success when fishing
|
||||||
|
*/
|
||||||
CRITICAL_FISHING_CHANCE("fishing"),
|
CRITICAL_FISHING_CHANCE("fishing"),
|
||||||
|
|
||||||
// chance of crit fishing failure
|
/**
|
||||||
|
* Chance of crit fishing failure
|
||||||
|
*/
|
||||||
CRITICAL_FISHING_FAILURE_CHANCE("fishing"),
|
CRITICAL_FISHING_FAILURE_CHANCE("fishing"),
|
||||||
|
|
||||||
// chance of dropping more minerals when mining.
|
/**
|
||||||
|
* Chance of dropping more minerals when mining.
|
||||||
|
*/
|
||||||
FORTUNE,
|
FORTUNE,
|
||||||
|
|
||||||
// get haste when mining blocks.
|
/**
|
||||||
|
* Get haste when mining blocks.
|
||||||
|
*/
|
||||||
GATHERING_HASTE,
|
GATHERING_HASTE,
|
||||||
|
|
||||||
// chance of getting more crops when farming
|
/**
|
||||||
|
* Chance of getting more crops when farming
|
||||||
|
*/
|
||||||
LUCK_OF_THE_FIELD;
|
LUCK_OF_THE_FIELD;
|
||||||
|
|
||||||
private String profession;
|
private String profession;
|
||||||
@ -88,7 +118,7 @@ public enum StatType {
|
|||||||
private DecimalFormat format;
|
private DecimalFormat format;
|
||||||
|
|
||||||
StatType() {
|
StatType() {
|
||||||
// completely custom stat.
|
// Completely custom stat
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("SameParameterValue")
|
@SuppressWarnings("SameParameterValue")
|
||||||
|
@ -190,7 +190,7 @@ public class MMOCoreUtils {
|
|||||||
* @return If the player can target the entity given the attack type (buff or attack)
|
* @return If the player can target the entity given the attack type (buff or attack)
|
||||||
*/
|
*/
|
||||||
public static boolean canTarget(PlayerData player, Entity target, InteractionType interaction) {
|
public static boolean canTarget(PlayerData player, Entity target, InteractionType interaction) {
|
||||||
return target instanceof LivingEntity && MythicLib.plugin.getEntities().canTarget(player.getPlayer(), (LivingEntity) target, interaction);
|
return target instanceof LivingEntity && MythicLib.plugin.getEntities().canTarget(player.getPlayer(), target, interaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void heal(LivingEntity target, double value) {
|
public static void heal(LivingEntity target, double value) {
|
||||||
|
@ -11,7 +11,7 @@ public class MMOCoreTargetRestriction implements TargetRestriction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canTarget(Player player, LivingEntity target, InteractionType interaction) {
|
public boolean canTarget(Player player, LivingEntity target, InteractionType interaction) {
|
||||||
|
|
||||||
if (interaction.isOffense() && target instanceof Player && PlayerData.has((Player) target)) {
|
if (interaction.isOffense() && target instanceof Player && PlayerData.has(target.getUniqueId())) {
|
||||||
PlayerData targetData = PlayerData.get(target.getUniqueId());
|
PlayerData targetData = PlayerData.get(target.getUniqueId());
|
||||||
|
|
||||||
// Check for the same party
|
// Check for the same party
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill;
|
package net.Indyuce.mmocore.comp.mythicmobs;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.util.EnumUtils;
|
import io.lumine.mythic.lib.api.util.EnumUtils;
|
||||||
|
import io.lumine.mythic.lib.player.cooldown.CooldownInfo;
|
||||||
|
import io.lumine.mythic.lib.skill.metadata.TriggerMetadata;
|
||||||
|
import io.lumine.mythic.lib.skill.trigger.PassiveSkill;
|
||||||
|
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||||
|
import io.lumine.mythic.lib.skill.trigger.TriggeredSkill;
|
||||||
import io.lumine.xikage.mythicmobs.MythicMobs;
|
import io.lumine.xikage.mythicmobs.MythicMobs;
|
||||||
import io.lumine.xikage.mythicmobs.adapters.AbstractEntity;
|
import io.lumine.xikage.mythicmobs.adapters.AbstractEntity;
|
||||||
import io.lumine.xikage.mythicmobs.adapters.AbstractLocation;
|
import io.lumine.xikage.mythicmobs.adapters.AbstractLocation;
|
||||||
@ -9,6 +14,11 @@ import io.lumine.xikage.mythicmobs.mobs.GenericCaster;
|
|||||||
import io.lumine.xikage.mythicmobs.skills.SkillCaster;
|
import io.lumine.xikage.mythicmobs.skills.SkillCaster;
|
||||||
import io.lumine.xikage.mythicmobs.skills.SkillTrigger;
|
import io.lumine.xikage.mythicmobs.skills.SkillTrigger;
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
|
import net.Indyuce.mmocore.api.event.PlayerPostCastSkillEvent;
|
||||||
|
import net.Indyuce.mmocore.api.event.PlayerPreCastSkillEvent;
|
||||||
|
import net.Indyuce.mmocore.api.event.PlayerResourceUpdateEvent;
|
||||||
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
|
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.IntegerLinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.IntegerLinearValue;
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
@ -27,9 +37,10 @@ import java.util.Map;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class MythicSkill extends Skill {
|
public class MythicSkill extends Skill implements TriggeredSkill {
|
||||||
private final io.lumine.xikage.mythicmobs.skills.Skill skill;
|
private final io.lumine.xikage.mythicmobs.skills.Skill skill;
|
||||||
private final Map<CheatType, Integer> antiCheat = new HashMap<>();
|
private final Map<CheatType, Integer> antiCheat = new HashMap<>();
|
||||||
|
private final PassiveSkill mythicLibSkill;
|
||||||
|
|
||||||
public MythicSkill(String id, FileConfiguration config) {
|
public MythicSkill(String id, FileConfiguration config) {
|
||||||
super(id);
|
super(id);
|
||||||
@ -64,11 +75,12 @@ public class MythicSkill extends Skill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.isString("passive-type")) {
|
if (config.isString("passive-type")) {
|
||||||
Optional<PassiveSkillType> passiveType = EnumUtils.getIfPresent(PassiveSkillType.class, config.getString("passive-type").toUpperCase());
|
Optional<TriggerType> passiveType = EnumUtils.getIfPresent(TriggerType.class, config.getString("passive-type").toUpperCase());
|
||||||
Validate.isTrue(passiveType.isPresent(), "Invalid passive skill type");
|
Validate.isTrue(passiveType.isPresent(), "Invalid passive skill type");
|
||||||
setPassive();
|
setPassive();
|
||||||
Bukkit.getPluginManager().registerEvents(passiveType.get().getHandler(this), MMOCore.plugin);
|
mythicLibSkill = new PassiveSkill("MMOCorePassiveSkill", passiveType.get(), this);
|
||||||
}
|
} else
|
||||||
|
mythicLibSkill = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<CheatType, Integer> getAntiCheat() {
|
public Map<CheatType, Integer> getAntiCheat() {
|
||||||
@ -79,10 +91,14 @@ public class MythicSkill extends Skill {
|
|||||||
return skill;
|
return skill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PassiveSkill toMythicLib() {
|
||||||
|
return mythicLibSkill;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SkillMetadata whenCast(CasterMetadata caster, SkillInfo skill) {
|
public SkillMetadata whenCast(CasterMetadata caster, SkillInfo skill) {
|
||||||
SkillMetadata cast = new SkillMetadata(caster, skill);
|
SkillMetadata cast = new SkillMetadata(caster, skill);
|
||||||
if (!cast.isSuccessful() || isPassive())
|
if (isPassive() || !cast.isSuccessful())
|
||||||
return cast;
|
return cast;
|
||||||
|
|
||||||
// Gather MythicMobs skill info
|
// Gather MythicMobs skill info
|
||||||
@ -117,4 +133,68 @@ public class MythicSkill extends Skill {
|
|||||||
private LinearValue readLinearValue(ConfigurationSection section) {
|
private LinearValue readLinearValue(ConfigurationSection section) {
|
||||||
return section.getBoolean("int") ? new IntegerLinearValue(section) : new LinearValue(section);
|
return section.getBoolean("int") ? new IntegerLinearValue(section) : new LinearValue(section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(TriggerMetadata triggerMeta) {
|
||||||
|
PlayerData playerData = PlayerData.get(triggerMeta.getAttack().getPlayer().getUniqueId());
|
||||||
|
if (!playerData.getProfess().hasSkill(this))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Check for Bukkit pre cast event
|
||||||
|
Skill.SkillInfo skill = playerData.getProfess().getSkill(this);
|
||||||
|
PlayerPreCastSkillEvent preEvent = new PlayerPreCastSkillEvent(playerData, skill);
|
||||||
|
Bukkit.getPluginManager().callEvent(preEvent);
|
||||||
|
if (preEvent.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Gather MMOCore skill info
|
||||||
|
CasterMetadata caster = new CasterMetadata(playerData);
|
||||||
|
SkillMetadata cast = new SkillMetadata(caster, skill);
|
||||||
|
if (!cast.isSuccessful())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Gather MythicMobs skill info
|
||||||
|
HashSet<AbstractEntity> targetEntities = new HashSet<>();
|
||||||
|
HashSet<AbstractLocation> targetLocations = new HashSet<>();
|
||||||
|
|
||||||
|
// The only difference
|
||||||
|
if (triggerMeta.getTarget() != null)
|
||||||
|
targetEntities.add(BukkitAdapter.adapt(triggerMeta.getTarget()));
|
||||||
|
|
||||||
|
AbstractEntity trigger = BukkitAdapter.adapt(caster.getPlayer());
|
||||||
|
SkillCaster skillCaster = new GenericCaster(trigger);
|
||||||
|
io.lumine.xikage.mythicmobs.skills.SkillMetadata skillMeta = new io.lumine.xikage.mythicmobs.skills.SkillMetadata(SkillTrigger.API, skillCaster, trigger, BukkitAdapter.adapt(caster.getPlayer().getEyeLocation()), targetEntities, targetLocations, 1);
|
||||||
|
|
||||||
|
// Check if the MythicMobs skill can be cast
|
||||||
|
if (!this.skill.usable(skillMeta, SkillTrigger.CAST)) {
|
||||||
|
cast.abort();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable anticheat
|
||||||
|
if (MMOCore.plugin.hasAntiCheat())
|
||||||
|
MMOCore.plugin.antiCheatSupport.disableAntiCheat(caster.getPlayer(), antiCheat);
|
||||||
|
|
||||||
|
// Place cast skill info in a variable
|
||||||
|
skillMeta.getVariables().putObject("MMOSkill", cast);
|
||||||
|
skillMeta.getVariables().putObject("MMOStatMap", caster.getStats());
|
||||||
|
|
||||||
|
// Apply cooldown, mana and stamina costs
|
||||||
|
if (!playerData.noCooldown) {
|
||||||
|
|
||||||
|
// Cooldown
|
||||||
|
double flatCooldownReduction = Math.max(0, Math.min(1, playerData.getStats().getStat(StatType.COOLDOWN_REDUCTION) / 100));
|
||||||
|
CooldownInfo cooldownHandler = playerData.getCooldownMap().applyCooldown(cast.getSkill(), cast.getCooldown());
|
||||||
|
cooldownHandler.reduceInitialCooldown(flatCooldownReduction);
|
||||||
|
|
||||||
|
// Mana and stamina cost
|
||||||
|
playerData.giveMana(-cast.getManaCost(), PlayerResourceUpdateEvent.UpdateReason.SKILL_COST);
|
||||||
|
playerData.giveStamina(-cast.getStaminaCost(), PlayerResourceUpdateEvent.UpdateReason.SKILL_COST);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute the MythicMobs skill
|
||||||
|
this.skill.execute(skillMeta);
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().callEvent(new PlayerPostCastSkillEvent(playerData, skill, cast));
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,65 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill;
|
|
||||||
|
|
||||||
import io.lumine.xikage.mythicmobs.adapters.AbstractEntity;
|
|
||||||
import io.lumine.xikage.mythicmobs.adapters.AbstractLocation;
|
|
||||||
import io.lumine.xikage.mythicmobs.adapters.bukkit.BukkitAdapter;
|
|
||||||
import io.lumine.xikage.mythicmobs.mobs.GenericCaster;
|
|
||||||
import io.lumine.xikage.mythicmobs.skills.SkillCaster;
|
|
||||||
import io.lumine.xikage.mythicmobs.skills.SkillTrigger;
|
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.skill.CasterMetadata;
|
|
||||||
import net.Indyuce.mmocore.skill.Skill;
|
|
||||||
import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public abstract class PassiveMythicSkillHandler implements Listener {
|
|
||||||
protected final MythicSkill skill;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Core class for all passive types
|
|
||||||
*/
|
|
||||||
protected PassiveMythicSkillHandler(MythicSkill skill) {
|
|
||||||
this.skill = skill;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SkillMetadata castSkill(PlayerData data) {
|
|
||||||
return castSkill(data, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SkillMetadata castSkill(PlayerData playerData, Entity target) {
|
|
||||||
if (!playerData.getProfess().hasSkill(skill))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
Skill.SkillInfo skill = playerData.getProfess().getSkill(this.skill);
|
|
||||||
CasterMetadata caster = new CasterMetadata(playerData);
|
|
||||||
SkillMetadata cast = new SkillMetadata(caster, skill);
|
|
||||||
if (!cast.isSuccessful() || this.skill.isPassive())
|
|
||||||
return cast;
|
|
||||||
|
|
||||||
HashSet<AbstractEntity> targetEntities = new HashSet<>();
|
|
||||||
HashSet<AbstractLocation> targetLocations = new HashSet<>();
|
|
||||||
|
|
||||||
// The only difference
|
|
||||||
if (target != null)
|
|
||||||
targetEntities.add(BukkitAdapter.adapt(target));
|
|
||||||
|
|
||||||
AbstractEntity trigger = BukkitAdapter.adapt(caster.getPlayer());
|
|
||||||
SkillCaster skillCaster = new GenericCaster(trigger);
|
|
||||||
io.lumine.xikage.mythicmobs.skills.SkillMetadata skillMeta = new io.lumine.xikage.mythicmobs.skills.SkillMetadata(SkillTrigger.API, skillCaster, trigger, BukkitAdapter.adapt(caster.getPlayer().getEyeLocation()), targetEntities, targetLocations, 1);
|
|
||||||
|
|
||||||
// Disable anticheat
|
|
||||||
if (MMOCore.plugin.hasAntiCheat())
|
|
||||||
MMOCore.plugin.antiCheatSupport.disableAntiCheat(caster.getPlayer(), this.skill.getAntiCheat());
|
|
||||||
|
|
||||||
if (this.skill.getSkill().usable(skillMeta, SkillTrigger.API))
|
|
||||||
this.skill.getSkill().execute(skillMeta);
|
|
||||||
else
|
|
||||||
cast.abort();
|
|
||||||
|
|
||||||
return cast;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.*;
|
|
||||||
|
|
||||||
public enum PassiveSkillType {
|
|
||||||
PLAYER_ATTACK,
|
|
||||||
PLAYER_DAMAGE,
|
|
||||||
PLAYER_DAMAGE_BY_ENTITY,
|
|
||||||
PLAYER_DEATH,
|
|
||||||
PLAYER_KILL_ENTITY,
|
|
||||||
PLAYER_LOGIN,
|
|
||||||
SHOOT_BOW;
|
|
||||||
|
|
||||||
public PassiveMythicSkillHandler getHandler(MythicSkill skill) {
|
|
||||||
if (this == PLAYER_ATTACK)
|
|
||||||
return new PlayerAttackSkillHandler(skill);
|
|
||||||
if (this == PLAYER_DAMAGE)
|
|
||||||
return new PlayerDamageSkillHandler(skill);
|
|
||||||
if (this == PLAYER_KILL_ENTITY)
|
|
||||||
return new EntityDeathSkillHandler(skill);
|
|
||||||
if (this == PLAYER_DAMAGE_BY_ENTITY)
|
|
||||||
return new PlayerDamageByEntitySkillHandler(skill);
|
|
||||||
if (this == PLAYER_DEATH)
|
|
||||||
return new PlayerDeathSkillHandler(skill);
|
|
||||||
if (this == SHOOT_BOW)
|
|
||||||
return new ShootBowSkillHandler(skill);
|
|
||||||
if (this == PLAYER_LOGIN)
|
|
||||||
return new PlayerLoginSkillHandler(skill);
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.event.EntityKillEntityEvent;
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
|
|
||||||
|
|
||||||
public class EntityDeathSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player kills
|
|
||||||
* another entity
|
|
||||||
*/
|
|
||||||
public EntityDeathSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(EntityKillEntityEvent e) {
|
|
||||||
if (e.getEntity().getType() == EntityType.PLAYER)
|
|
||||||
castSkill(PlayerData.get((Player) e.getEntity()), e.getTarget());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
import io.lumine.mythic.lib.api.event.PlayerAttackEvent;
|
|
||||||
|
|
||||||
public class PlayerAttackSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player attacks another
|
|
||||||
* entity
|
|
||||||
*/
|
|
||||||
public PlayerAttackSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(PlayerAttackEvent e) {
|
|
||||||
castSkill(PlayerData.get(e.getData().getUniqueId()), e.getEntity());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import io.lumine.mythic.lib.comp.target.InteractionType;
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|
||||||
|
|
||||||
public class PlayerDamageByEntitySkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player takes damage
|
|
||||||
* from another entity
|
|
||||||
*/
|
|
||||||
public PlayerDamageByEntitySkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void a(EntityDamageByEntityEvent event) {
|
|
||||||
if (event.getEntity().getType() == EntityType.PLAYER && MMOCoreUtils.canTarget(PlayerData.get(event.getEntity().getUniqueId()), event.getDamager(), InteractionType.OFFENSE_SKILL))
|
|
||||||
castSkill(PlayerData.get((Player) event.getEntity()), event.getDamager());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
|
|
||||||
public class PlayerDamageSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player takes damage
|
|
||||||
*/
|
|
||||||
public PlayerDamageSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(EntityDamageEvent event) {
|
|
||||||
if (event.getEntityType() == EntityType.PLAYER && !event.getEntity().hasMetadata("NPC"))
|
|
||||||
castSkill(PlayerData.get((Player) event.getEntity()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
|
|
||||||
public class PlayerDeathSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player dies
|
|
||||||
*/
|
|
||||||
public PlayerDeathSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(EntityDeathEvent e) {
|
|
||||||
if (e.getEntityType() == EntityType.PLAYER)
|
|
||||||
castSkill(PlayerData.get((Player) e.getEntity()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
|
||||||
|
|
||||||
import io.lumine.mythic.utils.Schedulers;
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
|
|
||||||
public class PlayerLoginSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used when a player logins
|
|
||||||
*
|
|
||||||
* @param skill
|
|
||||||
*/
|
|
||||||
public PlayerLoginSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(PlayerLoginEvent e){
|
|
||||||
Schedulers.sync().runLater(() -> {
|
|
||||||
castSkill(PlayerData.get( e.getPlayer()));
|
|
||||||
}, 50);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
|
||||||
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicSkillHandler;
|
|
||||||
|
|
||||||
public class ShootBowSkillHandler extends PassiveMythicSkillHandler {
|
|
||||||
/**
|
|
||||||
* Used to handle passive skills which trigger when a player shoots a bow
|
|
||||||
*/
|
|
||||||
public ShootBowSkillHandler(MythicSkill skill) {
|
|
||||||
super(skill);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void event(EntityShootBowEvent e) {
|
|
||||||
if(e.getEntity().getType() == EntityType.PLAYER)
|
|
||||||
castSkill(PlayerData.get((Player) e.getEntity()), e.getProjectile());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
package net.Indyuce.mmocore.experience.source;
|
package net.Indyuce.mmocore.experience.source;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.MMOLineConfig;
|
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||||
import io.lumine.mythic.lib.api.event.EntityKillEntityEvent;
|
import io.lumine.mythic.lib.api.event.PlayerKillEntityEvent;
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
import net.Indyuce.mmocore.experience.provider.ExperienceDispenser;
|
import net.Indyuce.mmocore.experience.provider.ExperienceDispenser;
|
||||||
import net.Indyuce.mmocore.experience.source.type.SpecificExperienceSource;
|
import net.Indyuce.mmocore.experience.source.type.SpecificExperienceSource;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager;
|
import net.Indyuce.mmocore.manager.profession.ExperienceSourceManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
|
||||||
@ -28,11 +27,10 @@ public class KillMobExperienceSource extends SpecificExperienceSource<Entity> {
|
|||||||
public ExperienceSourceManager<KillMobExperienceSource> newManager() {
|
public ExperienceSourceManager<KillMobExperienceSource> newManager() {
|
||||||
return new ExperienceSourceManager<KillMobExperienceSource>() {
|
return new ExperienceSourceManager<KillMobExperienceSource>() {
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void a(EntityKillEntityEvent event) {
|
public void a(PlayerKillEntityEvent event) {
|
||||||
Bukkit.getScheduler().runTaskLater(MMOCore.plugin, () -> {
|
Bukkit.getScheduler().runTaskLater(MMOCore.plugin, () -> {
|
||||||
if (event.getTarget().isDead() && event.getEntity() instanceof Player && !event.getEntity().hasMetadata("NPC")
|
if (event.getTarget().isDead() && !event.getTarget().hasMetadata("spawner_spawned")) {
|
||||||
&& !event.getTarget().hasMetadata("spawner_spawned")) {
|
PlayerData data = PlayerData.get(event.getPlayer());
|
||||||
PlayerData data = PlayerData.get((Player) event.getEntity());
|
|
||||||
|
|
||||||
for (KillMobExperienceSource source : getSources())
|
for (KillMobExperienceSource source : getSources())
|
||||||
if (source.matches(data, event.getTarget()))
|
if (source.matches(data, event.getTarget()))
|
||||||
|
@ -33,7 +33,7 @@ public class MineBlockExperienceSource extends SpecificExperienceSource<Material
|
|||||||
@Override
|
@Override
|
||||||
public ExperienceSourceManager<MineBlockExperienceSource> newManager() {
|
public ExperienceSourceManager<MineBlockExperienceSource> newManager() {
|
||||||
return new ExperienceSourceManager<MineBlockExperienceSource>() {
|
return new ExperienceSourceManager<MineBlockExperienceSource>() {
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void a(BlockBreakEvent event) {
|
public void a(BlockBreakEvent event) {
|
||||||
if (event.getPlayer().getGameMode() != GameMode.SURVIVAL)
|
if (event.getPlayer().getGameMode() != GameMode.SURVIVAL)
|
||||||
return;
|
return;
|
||||||
|
@ -102,6 +102,8 @@ public class BlockListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drops = called.getDrops();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove vanilla drops if needed and
|
* Remove vanilla drops if needed and
|
||||||
* decreases the durability of the item
|
* decreases the durability of the item
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
package net.Indyuce.mmocore.listener.option;
|
package net.Indyuce.mmocore.listener.option;
|
||||||
|
|
||||||
|
import io.lumine.mythic.lib.MythicLib;
|
||||||
|
import io.lumine.mythic.lib.comp.target.InteractionType;
|
||||||
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
|
import net.Indyuce.mmocore.manager.InventoryManager;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
||||||
public class PlayerProfileCheck implements Listener {
|
public class PlayerProfileCheck implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void a(PlayerInteractEntityEvent event) {
|
public void a(PlayerInteractEntityEvent event) {
|
||||||
/**
|
if (event.getRightClicked().getType() != EntityType.PLAYER || !event.getPlayer().isSneaking() || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION))
|
||||||
if (event.getRightClicked().getType() != EntityType.PLAYER || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -19,10 +24,7 @@ public class PlayerProfileCheck implements Listener {
|
|||||||
* Opening inventories like that to other players does NOT
|
* Opening inventories like that to other players does NOT
|
||||||
* necessarily works for any other custom inventory.
|
* necessarily works for any other custom inventory.
|
||||||
* */
|
* */
|
||||||
/**
|
|
||||||
Inventory inv = InventoryManager.PLAYER_STATS.newInventory(PlayerData.get(event.getRightClicked().getUniqueId())).getInventory();
|
Inventory inv = InventoryManager.PLAYER_STATS.newInventory(PlayerData.get(event.getRightClicked().getUniqueId())).getInventory();
|
||||||
event.getPlayer().openInventory(inv);
|
event.getPlayer().openInventory(inv);
|
||||||
**/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import net.Indyuce.mmocore.MMOCore;
|
|||||||
import net.Indyuce.mmocore.api.ConfigFile;
|
import net.Indyuce.mmocore.api.ConfigFile;
|
||||||
import net.Indyuce.mmocore.skill.Skill;
|
import net.Indyuce.mmocore.skill.Skill;
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicSkill;
|
import net.Indyuce.mmocore.comp.mythicmobs.MythicSkill;
|
||||||
|
|
||||||
public class SkillManager {
|
public class SkillManager {
|
||||||
private final Map<String, Skill> skills = new LinkedHashMap<>();
|
private final Map<String, Skill> skills = new LinkedHashMap<>();
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package net.Indyuce.mmocore.manager.data;
|
package net.Indyuce.mmocore.manager.data;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.player.MMOPlayerData;
|
import io.lumine.mythic.lib.player.MMOPlayerData;
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
import net.Indyuce.mmocore.api.event.AsyncPlayerDataLoadEvent;
|
import net.Indyuce.mmocore.api.event.AsyncPlayerDataLoadEvent;
|
||||||
import net.Indyuce.mmocore.api.event.PlayerDataLoadEvent;
|
import net.Indyuce.mmocore.api.event.PlayerDataLoadEvent;
|
||||||
import net.Indyuce.mmocore.api.player.OfflinePlayerData;
|
import net.Indyuce.mmocore.api.player.OfflinePlayerData;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.Indyuce.mmocore.skill;
|
package net.Indyuce.mmocore.skill;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.MythicLib;
|
import io.lumine.mythic.lib.MythicLib;
|
||||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
import io.lumine.mythic.lib.player.EquipmentSlot;
|
||||||
import io.lumine.mythic.lib.api.stat.StatMap;
|
import io.lumine.mythic.lib.api.stat.StatMap;
|
||||||
import io.lumine.mythic.lib.damage.AttackMetadata;
|
import io.lumine.mythic.lib.damage.AttackMetadata;
|
||||||
import io.lumine.mythic.lib.damage.DamageMetadata;
|
import io.lumine.mythic.lib.damage.DamageMetadata;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package net.Indyuce.mmocore.skill;
|
package net.Indyuce.mmocore.skill;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.player.CooldownObject;
|
import io.lumine.mythic.lib.player.cooldown.CooldownObject;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.IntegerLinearValue;
|
import net.Indyuce.mmocore.api.util.math.formula.IntegerLinearValue;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.Indyuce.mmocore.skill.list;
|
package net.Indyuce.mmocore.skill.list;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.MythicLib;
|
import io.lumine.mythic.lib.MythicLib;
|
||||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
import io.lumine.mythic.lib.player.EquipmentSlot;
|
||||||
import io.lumine.mythic.lib.api.stat.StatMap;
|
import io.lumine.mythic.lib.api.stat.StatMap;
|
||||||
import io.lumine.mythic.lib.damage.DamageType;
|
import io.lumine.mythic.lib.damage.DamageType;
|
||||||
import io.lumine.mythic.lib.version.VersionMaterial;
|
import io.lumine.mythic.lib.version.VersionMaterial;
|
||||||
|
@ -118,7 +118,9 @@ public class SkillMetadata implements MythicSkillInfo {
|
|||||||
LOCKED,
|
LOCKED,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Anything else
|
* Anything else, used for instance when MythicMobs
|
||||||
|
* skill conditions prevent the skill from casting or
|
||||||
|
* when the Bukkit pre cast event is cancelled
|
||||||
*/
|
*/
|
||||||
OTHER;
|
OTHER;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
# a Spigot Plugin by Team Requiem
|
# a Spigot Plugin by Team Requiem
|
||||||
|
|
||||||
# DO NOT TOUCH
|
# DO NOT TOUCH
|
||||||
config-version: 7
|
config-version: 8
|
||||||
|
|
||||||
# Auto-Save feature automatically saves playerdata
|
# Auto-Save feature automatically saves playerdata
|
||||||
# (class, level, etc.) and guild data
|
# (class, level, etc.) and guild data
|
||||||
@ -122,7 +122,7 @@ vanilla-exp-redirection:
|
|||||||
override-vanilla-exp: true
|
override-vanilla-exp: true
|
||||||
|
|
||||||
# Check the target player's RPG profile when shift when shift right clicking.
|
# Check the target player's RPG profile when shift when shift right clicking.
|
||||||
shift-click-player-profile-check: true
|
shift-click-player-profile-check: false
|
||||||
|
|
||||||
# If main class experience holograms should be displayed
|
# If main class experience holograms should be displayed
|
||||||
# whenever a player earns main class exp
|
# whenever a player earns main class exp
|
||||||
|
Loading…
Reference in New Issue
Block a user