mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-12-17 06:18:46 +01:00
more work on the spears update
This commit is contained in:
@@ -1,21 +1,20 @@
|
|||||||
Version 2.2.046
|
Version 2.2.046
|
||||||
TODO: Test FlatFile DB
|
TODO: Investigate when right click air sends events for offhand
|
||||||
TODO: Double check locale
|
TODO: Unarmed XP gained from spear offhand interactions
|
||||||
TODO: Double check plugin.yml permissions
|
|
||||||
TODO: Add notes about permission nodes
|
|
||||||
Added Spears combat skill
|
Added Spears combat skill
|
||||||
Added Spears to repair.vanilla.yml and salvage.vanilla.yml (see notes)
|
Added Spears to repair.vanilla.yml and salvage.vanilla.yml (see notes)
|
||||||
Added permissions related to Spears
|
Added permissions related to Spears
|
||||||
Added /spears skill command
|
Added /spears skill command
|
||||||
|
Added Nautilus to taming XP in experience.yml
|
||||||
Fixed bug where converting from SQL to FlatFile would not copy data for tridents, crossbows, maces, or spears
|
Fixed bug where converting from SQL to FlatFile would not copy data for tridents, crossbows, maces, or spears
|
||||||
(Codebase) Added dockerized unit tests for SQL databases (See notes)
|
(Codebase) Added dockerized unit tests for SQL databases (see notes)
|
||||||
(Codebase) Large refactor to both SQLDatabaseManager and FlatFileDatabaseManager
|
(Codebase) Large refactor to both SQLDatabaseManager and FlatFileDatabaseManager
|
||||||
(Codebase) Database related errors are now more descriptive and have had their logging improved
|
(Codebase) Database related errors are now more descriptive and have had their logging improved
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
You will need to manually update repair.vanilla.yml and salvage.vanilla.yml to get support for Spears.
|
You will need to manually update repair.vanilla.yml and salvage.vanilla.yml to get support for Spears, or...
|
||||||
Or you can delete these config files to have mcMMO regenerate them with the new entries.
|
If you want to update salvage/repair configs the easy way, you simply can delete these config files to have mcMMO regenerate them with the new entries.
|
||||||
You can find the default config files in the defaults folder at plugins\mcMMO\defaults after running this mcMMO update at least once.
|
If you don't want to delete them, you can find the default values for these config files in the defaults folder at plugins\mcMMO\defaults after running this mcMMO update at least once.
|
||||||
You can use this default file to copy paste if you please.
|
You can use this default file to copy paste if you please.
|
||||||
If you compile mcMMO you will likely run into errors during unit tests for SQL databases, this is because they now rely on docker being present on the system to load up test containers.
|
If you compile mcMMO you will likely run into errors during unit tests for SQL databases, this is because they now rely on docker being present on the system to load up test containers.
|
||||||
New SQL database unit tests have been added which leverage test containers to test against real installs of MySQL/MariaDB, which require Docker (or an equivalent) to run.
|
New SQL database unit tests have been added which leverage test containers to test against real installs of MySQL/MariaDB, which require Docker (or an equivalent) to run.
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>-->
|
<!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>-->
|
||||||
<spigot.version>1.21.10-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.21.11-R0.1-SNAPSHOT</spigot.version>
|
||||||
<kyori.adventure.version>4.23.0</kyori.adventure.version>
|
<kyori.adventure.version>4.23.0</kyori.adventure.version>
|
||||||
<kyori.adventure.platform.version>4.4.1-SNAPSHOT</kyori.adventure.platform.version>
|
<kyori.adventure.platform.version>4.4.1-SNAPSHOT</kyori.adventure.platform.version>
|
||||||
<kyori.option.version>1.1.0</kyori.option.version>
|
<kyori.option.version>1.1.0</kyori.option.version>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.gmail.nossr50.commands.skills;
|
|||||||
|
|
||||||
import static com.gmail.nossr50.datatypes.skills.SubSkillType.SPEARS_MOMENTUM;
|
import static com.gmail.nossr50.datatypes.skills.SubSkillType.SPEARS_MOMENTUM;
|
||||||
import static com.gmail.nossr50.datatypes.skills.SubSkillType.SPEARS_SPEARS_LIMIT_BREAK;
|
import static com.gmail.nossr50.datatypes.skills.SubSkillType.SPEARS_SPEARS_LIMIT_BREAK;
|
||||||
|
import static com.gmail.nossr50.datatypes.skills.SubSkillType.SPEARS_SPEAR_MASTERY;
|
||||||
import static com.gmail.nossr50.util.skills.SkillUtils.canUseSubskill;
|
import static com.gmail.nossr50.util.skills.SkillUtils.canUseSubskill;
|
||||||
import static com.gmail.nossr50.util.text.TextComponentFactory.appendSubSkillTextComponents;
|
import static com.gmail.nossr50.util.text.TextComponentFactory.appendSubSkillTextComponents;
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.spears.SpearsManager;
|
import com.gmail.nossr50.skills.spears.SpearsManager;
|
||||||
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||||
import com.gmail.nossr50.util.skills.RankUtils;
|
import com.gmail.nossr50.util.skills.RankUtils;
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
@@ -46,6 +48,9 @@ public class SpearsCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance,
|
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance,
|
||||||
boolean isLucky) {
|
boolean isLucky) {
|
||||||
|
final SpearsManager spearsManager = UserManager.getPlayer(player).getSpearsManager();
|
||||||
|
final double spearMasteryBonusDmg = spearsManager.getSpearMasteryBonusDamage();
|
||||||
|
|
||||||
List<String> messages = new ArrayList<>();
|
List<String> messages = new ArrayList<>();
|
||||||
|
|
||||||
if (canUseSubskill(player, SPEARS_SPEARS_LIMIT_BREAK)) {
|
if (canUseSubskill(player, SPEARS_SPEARS_LIMIT_BREAK)) {
|
||||||
@@ -54,6 +59,11 @@ public class SpearsCommand extends SkillCommand {
|
|||||||
SPEARS_SPEARS_LIMIT_BREAK, 1000))));
|
SPEARS_SPEARS_LIMIT_BREAK, 1000))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canUseSubskill(player, SPEARS_SPEAR_MASTERY)) {
|
||||||
|
messages.add(getStatMessage(SPEARS_SPEAR_MASTERY,
|
||||||
|
String.valueOf(spearMasteryBonusDmg)));
|
||||||
|
}
|
||||||
|
|
||||||
if (SkillUtils.canUseSubskill(player, SPEARS_MOMENTUM)) {
|
if (SkillUtils.canUseSubskill(player, SPEARS_MOMENTUM)) {
|
||||||
messages.add(getStatMessage(SPEARS_MOMENTUM, momentumChanceToApply)
|
messages.add(getStatMessage(SPEARS_MOMENTUM, momentumChanceToApply)
|
||||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus",
|
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus",
|
||||||
|
|||||||
@@ -894,4 +894,8 @@ public class AdvancedConfig extends BukkitConfig {
|
|||||||
return config.getDouble("Skills.Spears.Momentum.Chance_To_Apply_On_Hit.Rank_" + rank,
|
return config.getDouble("Skills.Spears.Momentum.Chance_To_Apply_On_Hit.Rank_" + rank,
|
||||||
defaultMomentumValues[rank - 1]);
|
defaultMomentumValues[rank - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getSpearMasteryRankDamageMultiplier() {
|
||||||
|
return config.getDouble("Skills.Spears.SpearMastery.Rank_Damage_Multiplier", 0.4D);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public enum SubSkillType {
|
|||||||
/* Spears */
|
/* Spears */
|
||||||
SPEARS_SPEARS_LIMIT_BREAK(10),
|
SPEARS_SPEARS_LIMIT_BREAK(10),
|
||||||
SPEARS_MOMENTUM(10),
|
SPEARS_MOMENTUM(10),
|
||||||
|
SPEARS_SPEAR_MASTERY(8),
|
||||||
|
|
||||||
/* Swords */
|
/* Swords */
|
||||||
SWORDS_COUNTER_ATTACK(1),
|
SWORDS_COUNTER_ATTACK(1),
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class PlayerListener implements Listener {
|
|||||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) {
|
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// world guard main flag check
|
// world guard main flag check
|
||||||
if (WorldGuardUtils.isWorldGuardLoaded() && !WorldGuardManager.getInstance()
|
if (WorldGuardUtils.isWorldGuardLoaded() && !WorldGuardManager.getInstance()
|
||||||
.hasMainFlag((Player) event.getEntity())) {
|
.hasMainFlag((Player) event.getEntity())) {
|
||||||
@@ -342,8 +343,8 @@ public class PlayerListener implements Listener {
|
|||||||
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
||||||
|
|
||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
|
// CAUGHT_FISH happens for any item caught (including junk and treasure)
|
||||||
case CAUGHT_FISH:
|
case CAUGHT_FISH:
|
||||||
//TODO Update to new API once available! Waiting for case CAUGHT_TREASURE
|
|
||||||
if (event.getCaught() != null) {
|
if (event.getCaught() != null) {
|
||||||
Item fishingCatch = (Item) event.getCaught();
|
Item fishingCatch = (Item) event.getCaught();
|
||||||
|
|
||||||
@@ -675,6 +676,10 @@ public class PlayerListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPlayerInteractLowest(PlayerInteractEvent event) {
|
public void onPlayerInteractLowest(PlayerInteractEvent event) {
|
||||||
|
if (event.getAction() == Action.PHYSICAL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* WORLD BLACKLIST CHECK */
|
/* WORLD BLACKLIST CHECK */
|
||||||
if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
|
if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
|
||||||
return;
|
return;
|
||||||
@@ -817,6 +822,10 @@ public class PlayerListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerInteractMonitor(PlayerInteractEvent event) {
|
public void onPlayerInteractMonitor(PlayerInteractEvent event) {
|
||||||
|
if (event.getAction() == Action.PHYSICAL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* WORLD BLACKLIST CHECK */
|
/* WORLD BLACKLIST CHECK */
|
||||||
if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
|
if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -113,4 +113,9 @@ public class SpearsManager extends SkillManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getSpearMasteryBonusDamage() {
|
||||||
|
return mcMMO.p.getAdvancedConfig().getSpearMasteryRankDamageMultiplier()
|
||||||
|
* getRank(getPlayer(), SubSkillType.SPEARS_SPEAR_MASTERY);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -649,6 +649,8 @@ Skills:
|
|||||||
Rank_3: 20
|
Rank_3: 20
|
||||||
Rank_4: 33
|
Rank_4: 33
|
||||||
Spears:
|
Spears:
|
||||||
|
SpearMastery:
|
||||||
|
Rank_Damage_Multiplier: 0.4
|
||||||
Momentum:
|
Momentum:
|
||||||
Chance_To_Apply_On_Hit:
|
Chance_To_Apply_On_Hit:
|
||||||
Rank_1: 5
|
Rank_1: 5
|
||||||
|
|||||||
@@ -606,6 +606,7 @@ Experience_Values:
|
|||||||
Goat: 250
|
Goat: 250
|
||||||
Axolotl: 600
|
Axolotl: 600
|
||||||
Frog: 900
|
Frog: 900
|
||||||
|
Nautilus: 1700
|
||||||
Combat:
|
Combat:
|
||||||
Multiplier:
|
Multiplier:
|
||||||
Animals: 1.0
|
Animals: 1.0
|
||||||
|
|||||||
@@ -486,10 +486,13 @@ Spears.SubSkill.SpearsLimitBreak.Description=Breaking your limits. Increased dam
|
|||||||
Spears.SubSkill.SpearsLimitBreak.Stat=Limit Break Max DMG
|
Spears.SubSkill.SpearsLimitBreak.Stat=Limit Break Max DMG
|
||||||
Spears.SubSkill.SpearAbility.Name=WIP
|
Spears.SubSkill.SpearAbility.Name=WIP
|
||||||
Spears.SubSkill.Momentum.Name=Momentum
|
Spears.SubSkill.Momentum.Name=Momentum
|
||||||
Spears.SubSkill.Momentum.Description=Adds a chance to increase movement speed when attacking.
|
Spears.SubSkill.Momentum.Description=Adds a chance to increase movement speed for a short duration when attacking.
|
||||||
Spears.SubSkill.Momentum.Stat=Momentum Chance
|
Spears.SubSkill.Momentum.Stat=Momentum Chance
|
||||||
Spears.SubSkill.Momentum.Stat.Extra=[[DARK_AQUA]]Momentum Duration: &e{0}s
|
Spears.SubSkill.Momentum.Stat.Extra=[[DARK_AQUA]]Momentum Duration: &e{0}s
|
||||||
Spears.SubSkill.Momentum.Activated=MOMENTUM ACTIVATED!
|
Spears.SubSkill.Momentum.Activated=MOMENTUM ACTIVATED!
|
||||||
|
Spears.SubSkill.SpearMastery.Name=Spear Mastery
|
||||||
|
Spears.SubSkill.SpearMastery.Description=Adds bonus damage to your attacks.
|
||||||
|
Spears.SubSkill.SpearMastery.Stat=Spear Mastery Bonus DMG
|
||||||
Spears.Listener=Spears:
|
Spears.Listener=Spears:
|
||||||
|
|
||||||
#SWORDS
|
#SWORDS
|
||||||
|
|||||||
@@ -660,10 +660,13 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
mcmmo.ability.spears.spearslimitbreak: true
|
mcmmo.ability.spears.spearslimitbreak: true
|
||||||
mcmmo.ability.spears.momentum: true
|
mcmmo.ability.spears.momentum: true
|
||||||
|
mcmmo.ability.spears.spearmastery: true
|
||||||
mcmmo.ability.spears.spearslimitbreak:
|
mcmmo.ability.spears.spearslimitbreak:
|
||||||
description: Adds damage to spears
|
description: Adds damage to spears
|
||||||
mcmmo.ability.spears.momentum:
|
mcmmo.ability.spears.momentum:
|
||||||
description: Adds a chance to increase movement speed temporarily after hitting an entity
|
description: Allows access to the Spear Momentum ability
|
||||||
|
mcmmo.ability.spears.spearmastery:
|
||||||
|
description: Allows access to the Spear Mastery ability
|
||||||
mcmmo.ability.swords.*:
|
mcmmo.ability.swords.*:
|
||||||
default: false
|
default: false
|
||||||
description: Allows access to all Swords abilities
|
description: Allows access to all Swords abilities
|
||||||
|
|||||||
@@ -428,6 +428,25 @@ Spears:
|
|||||||
Rank_8: 800
|
Rank_8: 800
|
||||||
Rank_9: 900
|
Rank_9: 900
|
||||||
Rank_10: 1000
|
Rank_10: 1000
|
||||||
|
SpearMastery:
|
||||||
|
Standard:
|
||||||
|
Rank_1: 5
|
||||||
|
Rank_2: 15
|
||||||
|
Rank_3: 30
|
||||||
|
Rank_4: 45
|
||||||
|
Rank_5: 60
|
||||||
|
Rank_6: 75
|
||||||
|
Rank_7: 90
|
||||||
|
Rank_8: 100
|
||||||
|
RetroMode:
|
||||||
|
Rank_1: 50
|
||||||
|
Rank_2: 150
|
||||||
|
Rank_3: 300
|
||||||
|
Rank_4: 450
|
||||||
|
Rank_5: 600
|
||||||
|
Rank_6: 750
|
||||||
|
Rank_7: 900
|
||||||
|
Rank_8: 1000
|
||||||
Momentum:
|
Momentum:
|
||||||
Standard:
|
Standard:
|
||||||
Rank_1: 1
|
Rank_1: 1
|
||||||
@@ -439,7 +458,7 @@ Spears:
|
|||||||
Rank_7: 50
|
Rank_7: 50
|
||||||
Rank_8: 60
|
Rank_8: 60
|
||||||
Rank_9: 80
|
Rank_9: 80
|
||||||
Rank_10: 100
|
Rank_10: 95
|
||||||
RetroMode:
|
RetroMode:
|
||||||
Rank_1: 1
|
Rank_1: 1
|
||||||
Rank_2: 100
|
Rank_2: 100
|
||||||
@@ -450,7 +469,7 @@ Spears:
|
|||||||
Rank_7: 500
|
Rank_7: 500
|
||||||
Rank_8: 600
|
Rank_8: 600
|
||||||
Rank_9: 800
|
Rank_9: 800
|
||||||
Rank_10: 1000
|
Rank_10: 950
|
||||||
Salvage:
|
Salvage:
|
||||||
ScrapCollector:
|
ScrapCollector:
|
||||||
Standard:
|
Standard:
|
||||||
|
|||||||
Reference in New Issue
Block a user