diff --git a/pom.xml b/pom.xml
index 1bb18315..f308891d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
net.Indyuce
MMOCore
- 1.8.0
+ 1.8.1
MMOCore
Offer your players a brand new RPG experience!!
diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java
index 58ccdf20..6dfbffc3 100644
--- a/src/main/java/net/Indyuce/mmocore/MMOCore.java
+++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java
@@ -90,6 +90,11 @@ public class MMOCore extends LuminePlugin {
public final MMOLoadManager loadManager = new MMOLoadManager();
+ public boolean healthRegenFlat;
+ public boolean manaRegenFlat;
+ public boolean staminaRegenFlat;
+ public boolean stelliumRegenFlat;
+
public boolean shouldDebugSQL = false;
public MMOCore() {
@@ -141,6 +146,13 @@ public class MMOCore extends LuminePlugin {
if (getConfig().isConfigurationSection("default-playerdata"))
dataProvider.getDataManager().loadDefaultData(getConfig().getConfigurationSection("default-playerdata"));
+ if (getConfig().isConfigurationSection("stat-regen-flat")) {
+ healthRegenFlat = getConfig().getBoolean("stat-regen-flat.health", true);
+ manaRegenFlat = getConfig().getBoolean("stat-regen-flat.mana", true);
+ staminaRegenFlat = getConfig().getBoolean("stat-regen-flat.stamina", true);
+ stelliumRegenFlat = getConfig().getBoolean("stat-regen-flat.stellium", true);
+ }
+
if (Bukkit.getPluginManager().getPlugin("Vault") != null) economy = new VaultEconomy();
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
@@ -177,8 +189,33 @@ public class MMOCore extends LuminePlugin {
for (PlayerData player : PlayerData.getAll())
if (player.isOnline() && !player.getPlayer().isDead())
for (PlayerResource resource : PlayerResource.values()) {
- double d = player.getProfess().getHandler(resource).getRegen(player);
- if (d != 0) resource.regen(player, d);
+ double regenAmount = player.getProfess().getHandler(resource).getRegen(player);
+ switch (resource) {
+ case HEALTH:
+ if (healthRegenFlat && regenAmount != 0)
+ resource.regen(player, regenAmount);
+ else if (!healthRegenFlat && regenAmount * player.getStats().getStat(StatType.HEALTH_REGENERATION) != 0)
+ resource.regen(player, player.getStats().getStat(StatType.MAX_HEALTH) * regenAmount);
+ break;
+ case MANA:
+ if (manaRegenFlat && regenAmount != 0)
+ resource.regen(player, regenAmount);
+ else if (!manaRegenFlat && regenAmount * player.getStats().getStat(StatType.MANA_REGENERATION) != 0)
+ resource.regen(player, player.getStats().getStat(StatType.MAX_MANA) * regenAmount);
+ break;
+ case STAMINA:
+ if (staminaRegenFlat && regenAmount != 0)
+ resource.regen(player, regenAmount);
+ else if (!staminaRegenFlat && regenAmount * player.getStats().getStat(StatType.STAMINA_REGENERATION) != 0)
+ resource.regen(player, player.getStats().getStat(StatType.MAX_STAMINA) * regenAmount);
+ break;
+ case STELLIUM:
+ if (stelliumRegenFlat && regenAmount != 0)
+ resource.regen(player, regenAmount);
+ else if (!stelliumRegenFlat && regenAmount * player.getStats().getStat(StatType.STELLIUM_REGENERATION) != 0)
+ resource.regen(player, player.getStats().getStat(StatType.MAX_STELLIUM) * regenAmount);
+ break;
+ }
}
}
}.runTaskTimer(MMOCore.plugin, 100, 20);
diff --git a/src/main/java/net/Indyuce/mmocore/api/event/CustomBlockMineEvent.java b/src/main/java/net/Indyuce/mmocore/api/event/CustomBlockMineEvent.java
index f4f02577..93102780 100644
--- a/src/main/java/net/Indyuce/mmocore/api/event/CustomBlockMineEvent.java
+++ b/src/main/java/net/Indyuce/mmocore/api/event/CustomBlockMineEvent.java
@@ -14,7 +14,7 @@ public class CustomBlockMineEvent extends PlayerDataEvent implements Cancellable
private final Block block;
private final BlockInfo info;
- private final List drops;
+ private List drops;
private boolean cancelled;
@@ -39,6 +39,10 @@ public class CustomBlockMineEvent extends PlayerDataEvent implements Cancellable
return info;
}
+ public void setDrops(List list) {
+ this.drops = list;
+ }
+
@Override
public boolean isCancelled() {
return cancelled;
diff --git a/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java b/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java
index aa0c8576..5aeddc78 100644
--- a/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java
+++ b/src/main/java/net/Indyuce/mmocore/listener/BlockListener.java
@@ -102,6 +102,8 @@ public class BlockListener implements Listener {
return;
}
+ drops = called.getDrops();
+
/*
* Remove vanilla drops if needed and
* decreases the durability of the item
diff --git a/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java b/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java
index 86569824..eaac9db1 100644
--- a/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java
+++ b/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java
@@ -1,19 +1,14 @@
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.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
-import org.bukkit.inventory.Inventory;
public class PlayerProfileCheck implements Listener {
@EventHandler
public void a(PlayerInteractEntityEvent event) {
+ /**
if (event.getRightClicked().getType() != EntityType.PLAYER || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION))
return;
@@ -24,7 +19,10 @@ public class PlayerProfileCheck implements Listener {
* Opening inventories like that to other players does NOT
* necessarily works for any other custom inventory.
* */
+ /**
Inventory inv = InventoryManager.PLAYER_STATS.newInventory(PlayerData.get(event.getRightClicked().getUniqueId())).getInventory();
event.getPlayer().openInventory(inv);
+ **/
}
+
}
diff --git a/src/main/java/net/Indyuce/mmocore/skill/list/Fire_Storm.java b/src/main/java/net/Indyuce/mmocore/skill/list/Fire_Storm.java
index 000c3c76..b69a9918 100644
--- a/src/main/java/net/Indyuce/mmocore/skill/list/Fire_Storm.java
+++ b/src/main/java/net/Indyuce/mmocore/skill/list/Fire_Storm.java
@@ -1,6 +1,14 @@
package net.Indyuce.mmocore.skill.list;
+import io.lumine.mythic.lib.damage.DamageType;
+import io.lumine.mythic.lib.version.VersionSound;
+import net.Indyuce.mmocore.MMOCore;
+import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
+import net.Indyuce.mmocore.api.util.math.particle.ParabolicProjectile;
import net.Indyuce.mmocore.skill.CasterMetadata;
+import net.Indyuce.mmocore.skill.Skill;
+import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
+import net.Indyuce.mmocore.skill.metadata.TargetSkillMetadata;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
@@ -9,23 +17,13 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
-import net.Indyuce.mmocore.MMOCore;
-import net.Indyuce.mmocore.api.player.PlayerData;
-import net.Indyuce.mmocore.skill.Skill;
-import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
-import net.Indyuce.mmocore.skill.metadata.TargetSkillMetadata;
-import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
-import net.Indyuce.mmocore.api.util.math.particle.ParabolicProjectile;
-import io.lumine.mythic.lib.MythicLib;
-import io.lumine.mythic.lib.api.AttackResult;
-import io.lumine.mythic.lib.damage.DamageType;;
-import io.lumine.mythic.lib.version.VersionSound;
-
public class Fire_Storm extends Skill {
public Fire_Storm() {
super();
setMaterial(Material.BLAZE_POWDER);
- setLore("Casts a flurry of 6 fire projectiles onto", "nearby enemies, proritizing the initial", "target. Each projectile deals &c{damage} &7damage", "and ignite the target for &c{ignite} &7seconds.", "", "&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}");
+ setLore("Casts a flurry of 6 fire projectiles onto", "nearby enemies, proritizing the initial",
+ "target. Each projectile deals &c{damage} &7damage", "and ignite the target for &c{ignite} &7seconds.", "",
+ "&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}");
addModifier("mana", new LinearValue(15, 2));
addModifier("damage", new LinearValue(5, 3));
@@ -36,8 +34,7 @@ public class Fire_Storm extends Skill {
@Override
public SkillMetadata whenCast(CasterMetadata caster, SkillInfo skill) {
TargetSkillMetadata cast = new TargetSkillMetadata(caster, skill, 20);
- if (!cast.isSuccessful() )
- return cast;
+ if (!cast.isSuccessful()) return cast;
LivingEntity target = cast.getTarget();
@@ -50,7 +47,8 @@ public class Fire_Storm extends Skill {
@Override
public void run() {
- if (j++ > 5 || caster.getPlayer().isDead() || !caster.getPlayer().isOnline() || target.isDead() || !caster.getPlayer().getWorld().equals(target.getWorld())) {
+ if (j++ > 5 || caster.getPlayer().isDead() || !caster.getPlayer().isOnline() || target.isDead() || !caster.getPlayer().getWorld()
+ .equals(target.getWorld())) {
cancel();
return;
}
@@ -58,7 +56,8 @@ public class Fire_Storm extends Skill {
// TODO dynamic target location
caster.getPlayer().getWorld().playSound(caster.getPlayer().getLocation(), Sound.BLOCK_FIRE_AMBIENT, 1, 1);
- new ParabolicProjectile(caster.getPlayer().getLocation().add(0, 1, 0), target.getLocation().add(0, target.getHeight() / 2, 0), randomVector(caster.getPlayer()), () -> {
+ new ParabolicProjectile(caster.getPlayer().getLocation().add(0, 1, 0), target.getLocation().add(0, target.getHeight() / 2, 0),
+ randomVector(caster.getPlayer()), () -> {
target.getWorld().playSound(target.getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 1, 2);
target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().add(0, target.getHeight() / 2, 0), 8, 0, 0, 0, .15);
caster.attack(target, damage, DamageType.SKILL, DamageType.PROJECTILE, DamageType.MAGIC);
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 44313ada..00a56201 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -8,7 +8,7 @@
# a Spigot Plugin by Team Requiem
# DO NOT TOUCH
-config-version: 7
+config-version: 8
# Auto-Save feature automatically saves playerdata
# (class, level, etc.) and guild data
@@ -42,6 +42,17 @@ default-playerdata:
attribute-points: 0
attribute-realloc-points: 0
+# Should these Stats regenrate with a FLAT value or PERCENTAGE value?
+# By default, they are set to TRUE, which means they will regenerate
+# based off the FLAT Regeneration value for the respective stat
+# Setting a stat to FALSE means that it will regenerate
+# with the formula (Stat Regen * Max Stat) for example (Mana Regeneration * Max Mana)
+stat-regen-flat:
+ health: true
+ mana: true
+ stamina: true
+ stellium: true
+
# The list of all conditions which must be met for the
# BLOCK REGEN and BLOCK RESTRICTIONS to apply. Set to
# 'custom-mine-conditions: []' to disable custom mining entirely.