mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-12-17 06:18:46 +01:00
Spears (wip pt 2)
This commit is contained in:
@@ -2,6 +2,7 @@ Version 2.2.046
|
|||||||
Added Spears combat skill
|
Added Spears combat skill
|
||||||
Added permissions related to Spears
|
Added permissions related to Spears
|
||||||
Added /spears skill command
|
Added /spears skill command
|
||||||
|
Fixed bug where converting from SQL to FlatFile would not copy data for tridents, crossbows, maces, or spears
|
||||||
|
|
||||||
Version 2.2.045
|
Version 2.2.045
|
||||||
Green Thumb now replants some crops it was failing to replant before (see notes)
|
Green Thumb now replants some crops it was failing to replant before (see notes)
|
||||||
|
|||||||
109
pom.xml
109
pom.xml
@@ -1,4 +1,6 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||||
<artifactId>mcMMO</artifactId>
|
<artifactId>mcMMO</artifactId>
|
||||||
@@ -13,7 +15,7 @@
|
|||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<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.10-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>
|
||||||
@@ -182,11 +184,13 @@
|
|||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>co.aikar.commands</pattern>
|
<pattern>co.aikar.commands</pattern>
|
||||||
<shadedPattern>com.gmail.nossr50.mcmmo.acf</shadedPattern> <!-- Replace this -->
|
<shadedPattern>com.gmail.nossr50.mcmmo.acf
|
||||||
|
</shadedPattern> <!-- Replace this -->
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>co.aikar.locales</pattern>
|
<pattern>co.aikar.locales</pattern>
|
||||||
<shadedPattern>com.gmail.nossr50.mcmmo.locales</shadedPattern> <!-- Replace this -->
|
<shadedPattern>com.gmail.nossr50.mcmmo.locales
|
||||||
|
</shadedPattern> <!-- Replace this -->
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.apache.commons.logging</pattern>
|
<pattern>org.apache.commons.logging</pattern>
|
||||||
@@ -194,7 +198,8 @@
|
|||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.apache.juli</pattern>
|
<pattern>org.apache.juli</pattern>
|
||||||
<shadedPattern>com.gmail.nossr50.mcmmo.database.tomcat.juli</shadedPattern>
|
<shadedPattern>com.gmail.nossr50.mcmmo.database.tomcat.juli
|
||||||
|
</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.apache.tomcat</pattern>
|
<pattern>org.apache.tomcat</pattern>
|
||||||
@@ -390,11 +395,11 @@
|
|||||||
<version>3.0.2</version>
|
<version>3.0.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>io.papermc.paper</groupId>-->
|
<!-- <groupId>io.papermc.paper</groupId>-->
|
||||||
<!-- <artifactId>paper-api</artifactId>-->
|
<!-- <artifactId>paper-api</artifactId>-->
|
||||||
<!-- <version>1.21.8-R0.1-SNAPSHOT</version>-->
|
<!-- <version>1.21.8-R0.1-SNAPSHOT</version>-->
|
||||||
<!-- </dependency>-->
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
@@ -431,10 +436,76 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- JUnit 5 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>5.11.0-M2</version>
|
<version>5.11.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Testcontainers core -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testcontainers</groupId>
|
||||||
|
<artifactId>testcontainers</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Testcontainers JUnit Jupiter integration -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testcontainers</groupId>
|
||||||
|
<artifactId>testcontainers-junit-jupiter</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Log4j core for tests -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
<version>2.25.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Log4j API -->
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-api</artifactId>
|
||||||
|
<version>2.25.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-slf4j-impl</artifactId>
|
||||||
|
<version>2.25.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- MySQL Testcontainers module -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testcontainers</groupId>
|
||||||
|
<artifactId>testcontainers-mysql</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- MariaDB Testcontainers module -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testcontainers</groupId>
|
||||||
|
<artifactId>testcontainers-mariadb</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- MySQL JDBC driver -->
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.mysql/mysql-connector-j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
<version>9.5.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MariaDB JDBC driver -->
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<version>3.5.6</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -452,7 +523,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>org.apache.tomcat</groupId>
|
||||||
<artifactId>tomcat-jdbc</artifactId>
|
<artifactId>tomcat-jdbc</artifactId>
|
||||||
<version>10.1.24</version>
|
<version>11.0.14</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -463,7 +534,8 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>33.2.0-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
|
<version>33.2.0-jre
|
||||||
|
</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -473,4 +545,15 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testcontainers</groupId>
|
||||||
|
<artifactId>testcontainers-bom</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ public class MacesCommand extends SkillCommand {
|
|||||||
super(PrimarySkillType.MACES);
|
super(PrimarySkillType.MACES);
|
||||||
}
|
}
|
||||||
|
|
||||||
String crippleChanceToApply, crippleChanceToApplyLucky, crippleLengthAgainstPlayers, crippleLengthAgainstMobs;
|
String crippleChanceToApply, crippleChanceToApplyLucky, crippleLengthAgainstPlayers,
|
||||||
|
crippleLengthAgainstMobs;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations(Player player, float skillValue) {
|
protected void dataCalculations(Player player, float skillValue) {
|
||||||
@@ -33,7 +34,6 @@ public class MacesCommand extends SkillCommand {
|
|||||||
MacesManager.getCrippleTickDuration(true) / 20.0D);
|
MacesManager.getCrippleTickDuration(true) / 20.0D);
|
||||||
crippleLengthAgainstMobs = String.valueOf(
|
crippleLengthAgainstMobs = String.valueOf(
|
||||||
MacesManager.getCrippleTickDuration(false) / 20.0D);
|
MacesManager.getCrippleTickDuration(false) / 20.0D);
|
||||||
|
|
||||||
crippleChanceToApply =
|
crippleChanceToApply =
|
||||||
mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) + "%";
|
mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) + "%";
|
||||||
crippleChanceToApplyLucky = String.valueOf(
|
crippleChanceToApplyLucky = String.valueOf(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.gmail.nossr50.commands.skills;
|
|||||||
|
|
||||||
|
|
||||||
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.util.skills.SkillUtils.canUseSubskill;
|
||||||
import static com.gmail.nossr50.util.text.TextComponentFactory.appendSubSkillTextComponents;
|
import static com.gmail.nossr50.util.text.TextComponentFactory.appendSubSkillTextComponents;
|
||||||
|
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
@@ -32,7 +33,7 @@ public class SpearsCommand extends SkillCommand {
|
|||||||
boolean isLucky) {
|
boolean isLucky) {
|
||||||
List<String> messages = new ArrayList<>();
|
List<String> messages = new ArrayList<>();
|
||||||
|
|
||||||
if (SkillUtils.canUseSubskill(player, SPEARS_SPEARS_LIMIT_BREAK)) {
|
if (canUseSubskill(player, SPEARS_SPEARS_LIMIT_BREAK)) {
|
||||||
messages.add(getStatMessage(SPEARS_SPEARS_LIMIT_BREAK,
|
messages.add(getStatMessage(SPEARS_SPEARS_LIMIT_BREAK,
|
||||||
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player,
|
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player,
|
||||||
SPEARS_SPEARS_LIMIT_BREAK, 1000))));
|
SPEARS_SPEARS_LIMIT_BREAK, 1000))));
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ public class DatabaseManagerFactory {
|
|||||||
: "Flatfile") + " database");
|
: "Flatfile") + " database");
|
||||||
}
|
}
|
||||||
|
|
||||||
return mcMMO.p.getGeneralConfig().getUseMySQL() ? new SQLDatabaseManager(logger,
|
return mcMMO.p.getGeneralConfig().getUseMySQL()
|
||||||
MYSQL_DRIVER)
|
? new SQLDatabaseManager(logger, MYSQL_DRIVER)
|
||||||
: new FlatFileDatabaseManager(userFilePath, logger, purgeTime, startingLevel);
|
: new FlatFileDatabaseManager(userFilePath, logger, purgeTime, startingLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -845,45 +846,47 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void convertUsers(DatabaseManager destination) {
|
public void convertUsers(DatabaseManager destination) {
|
||||||
BufferedReader in = null;
|
|
||||||
int convertedUsers = 0;
|
int convertedUsers = 0;
|
||||||
long startMillis = System.currentTimeMillis();
|
long startMillis = System.currentTimeMillis();
|
||||||
|
|
||||||
synchronized (fileWritingLock) {
|
synchronized (fileWritingLock) {
|
||||||
try {
|
try (BufferedReader reader = new BufferedReader(new FileReader(usersFilePath))) {
|
||||||
// Open the user file
|
|
||||||
in = new BufferedReader(new FileReader(usersFilePath));
|
|
||||||
String line;
|
String line;
|
||||||
|
|
||||||
while ((line = in.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
if (line.startsWith("#")) {
|
line = line.trim();
|
||||||
|
|
||||||
|
// Skip comments and empty lines
|
||||||
|
if (line.isEmpty() || line.startsWith("#")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] character = line.split(":");
|
final String[] character = line.split(":");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
destination.saveUser(loadFromLine(character));
|
destination.saveUser(loadFromLine(character));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
// Keep the same semantics as before, but log via logger
|
||||||
|
final String username = (character.length > USERNAME_INDEX)
|
||||||
|
? character[USERNAME_INDEX]
|
||||||
|
: "<unknown username>";
|
||||||
|
logger.log(
|
||||||
|
Level.SEVERE,
|
||||||
|
"Could not convert user from FlatFile to SQL DB: " + username,
|
||||||
|
e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
convertedUsers++;
|
convertedUsers++;
|
||||||
Misc.printProgress(convertedUsers, progressInterval, startMillis);
|
Misc.printProgress(convertedUsers, progressInterval, startMillis);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
if (in != null) {
|
|
||||||
try {
|
|
||||||
in.close();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Ignore
|
logger.log(Level.SEVERE, "Failed to convert users from FlatFile to SQL DB", e);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean saveUserUUID(String userName, UUID uuid) {
|
public boolean saveUserUUID(String userName, UUID uuid) {
|
||||||
boolean worked = false;
|
boolean worked = false;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,7 @@ import com.gmail.nossr50.skills.mining.MiningManager;
|
|||||||
import com.gmail.nossr50.skills.repair.RepairManager;
|
import com.gmail.nossr50.skills.repair.RepairManager;
|
||||||
import com.gmail.nossr50.skills.salvage.SalvageManager;
|
import com.gmail.nossr50.skills.salvage.SalvageManager;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
|
import com.gmail.nossr50.skills.spears.SpearsManager;
|
||||||
import com.gmail.nossr50.skills.swords.SwordsManager;
|
import com.gmail.nossr50.skills.swords.SwordsManager;
|
||||||
import com.gmail.nossr50.skills.taming.TamingManager;
|
import com.gmail.nossr50.skills.taming.TamingManager;
|
||||||
import com.gmail.nossr50.skills.tridents.TridentsManager;
|
import com.gmail.nossr50.skills.tridents.TridentsManager;
|
||||||
@@ -63,6 +64,7 @@ import com.gmail.nossr50.util.sounds.SoundType;
|
|||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.logging.Level;
|
||||||
import net.kyori.adventure.identity.Identified;
|
import net.kyori.adventure.identity.Identified;
|
||||||
import net.kyori.adventure.identity.Identity;
|
import net.kyori.adventure.identity.Identity;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -171,73 +173,50 @@ public class McMMOPlayer implements Identified {
|
|||||||
try {
|
try {
|
||||||
initManager(primarySkillType);
|
initManager(primarySkillType);
|
||||||
} catch (InvalidSkillException e) {
|
} catch (InvalidSkillException e) {
|
||||||
e.printStackTrace();
|
mcMMO.p.getLogger().log(Level.SEVERE,
|
||||||
|
"Invalid skill while initializing skill managers for player "
|
||||||
|
+ player.getName()
|
||||||
|
+ ". Contact the plugin developers.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Add test
|
//TODO: Add test
|
||||||
private void initManager(PrimarySkillType primarySkillType) throws InvalidSkillException {
|
private void initManager(PrimarySkillType primarySkillType) throws InvalidSkillException {
|
||||||
switch (primarySkillType) {
|
final var version = mcMMO.getCompatibilityManager().getMinecraftGameVersion();
|
||||||
case ACROBATICS:
|
|
||||||
skillManagers.put(primarySkillType, new AcrobaticsManager(this));
|
final SkillManager manager = switch (primarySkillType) {
|
||||||
break;
|
case ACROBATICS -> new AcrobaticsManager(this);
|
||||||
case ALCHEMY:
|
case ALCHEMY -> new AlchemyManager(this);
|
||||||
skillManagers.put(primarySkillType, new AlchemyManager(this));
|
case ARCHERY -> new ArcheryManager(this);
|
||||||
break;
|
case AXES -> new AxesManager(this);
|
||||||
case ARCHERY:
|
case CROSSBOWS -> new CrossbowsManager(this);
|
||||||
skillManagers.put(primarySkillType, new ArcheryManager(this));
|
case EXCAVATION -> new ExcavationManager(this);
|
||||||
break;
|
case FISHING -> new FishingManager(this);
|
||||||
case AXES:
|
case HERBALISM -> new HerbalismManager(this);
|
||||||
skillManagers.put(primarySkillType, new AxesManager(this));
|
case MINING -> new MiningManager(this);
|
||||||
break;
|
case REPAIR -> new RepairManager(this);
|
||||||
case CROSSBOWS:
|
case SALVAGE -> new SalvageManager(this);
|
||||||
skillManagers.put(primarySkillType, new CrossbowsManager(this));
|
case SMELTING -> new SmeltingManager(this);
|
||||||
break;
|
case SWORDS -> new SwordsManager(this);
|
||||||
case EXCAVATION:
|
case TAMING -> new TamingManager(this);
|
||||||
skillManagers.put(primarySkillType, new ExcavationManager(this));
|
case TRIDENTS -> new TridentsManager(this);
|
||||||
break;
|
case UNARMED -> new UnarmedManager(this);
|
||||||
case FISHING:
|
case WOODCUTTING -> new WoodcuttingManager(this);
|
||||||
skillManagers.put(primarySkillType, new FishingManager(this));
|
|
||||||
break;
|
case MACES -> version.isAtLeast(1, 21, 0)
|
||||||
case HERBALISM:
|
? new MacesManager(this)
|
||||||
skillManagers.put(primarySkillType, new HerbalismManager(this));
|
: null; // keep current behavior: no manager on older versions
|
||||||
break;
|
|
||||||
case MINING:
|
case SPEARS -> version.isAtLeast(1, 21, 11)
|
||||||
skillManagers.put(primarySkillType, new MiningManager(this));
|
? new SpearsManager(this)
|
||||||
break;
|
: null; // same here
|
||||||
case REPAIR:
|
};
|
||||||
skillManagers.put(primarySkillType, new RepairManager(this));
|
|
||||||
break;
|
if (manager != null) {
|
||||||
case SALVAGE:
|
skillManagers.put(primarySkillType, manager);
|
||||||
skillManagers.put(primarySkillType, new SalvageManager(this));
|
} else {
|
||||||
break;
|
throw new InvalidSkillException("No valid skill manager for skill: " + primarySkillType);
|
||||||
case SMELTING:
|
|
||||||
skillManagers.put(primarySkillType, new SmeltingManager(this));
|
|
||||||
break;
|
|
||||||
case SWORDS:
|
|
||||||
skillManagers.put(primarySkillType, new SwordsManager(this));
|
|
||||||
break;
|
|
||||||
case TAMING:
|
|
||||||
skillManagers.put(primarySkillType, new TamingManager(this));
|
|
||||||
break;
|
|
||||||
case TRIDENTS:
|
|
||||||
skillManagers.put(primarySkillType, new TridentsManager(this));
|
|
||||||
break;
|
|
||||||
case UNARMED:
|
|
||||||
skillManagers.put(primarySkillType, new UnarmedManager(this));
|
|
||||||
break;
|
|
||||||
case WOODCUTTING:
|
|
||||||
skillManagers.put(primarySkillType, new WoodcuttingManager(this));
|
|
||||||
break;
|
|
||||||
case MACES:
|
|
||||||
if (mcMMO.getCompatibilityManager().getMinecraftGameVersion().isAtLeast(1, 21, 0)) {
|
|
||||||
skillManagers.put(primarySkillType, new MacesManager(this));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new InvalidSkillException(
|
|
||||||
"The skill named has no manager! Contact the devs!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,6 +348,10 @@ public class McMMOPlayer implements Identified {
|
|||||||
return (SmeltingManager) skillManagers.get(PrimarySkillType.SMELTING);
|
return (SmeltingManager) skillManagers.get(PrimarySkillType.SMELTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SpearsManager getSpearsManager() {
|
||||||
|
return (SpearsManager) skillManagers.get(PrimarySkillType.SPEARS);
|
||||||
|
}
|
||||||
|
|
||||||
public SwordsManager getSwordsManager() {
|
public SwordsManager getSwordsManager() {
|
||||||
return (SwordsManager) skillManagers.get(PrimarySkillType.SWORDS);
|
return (SwordsManager) skillManagers.get(PrimarySkillType.SWORDS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class PlayerProfile {
|
|||||||
this.loaded = isLoaded;
|
this.loaded = isLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerProfile(@NotNull String playerName, UUID uuid, boolean isLoaded, int startingLvl) {
|
public PlayerProfile(@NotNull String playerName, @Nullable UUID uuid, boolean isLoaded, int startingLvl) {
|
||||||
this(playerName, uuid, startingLvl);
|
this(playerName, uuid, startingLvl);
|
||||||
this.loaded = isLoaded;
|
this.loaded = isLoaded;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ JSON.Salvage=Salvage
|
|||||||
JSON.Swords=Swords
|
JSON.Swords=Swords
|
||||||
JSON.Taming=Taming
|
JSON.Taming=Taming
|
||||||
JSON.Tridents=Tridents
|
JSON.Tridents=Tridents
|
||||||
|
JSON.Spears=Spears
|
||||||
JSON.Maces=Maces
|
JSON.Maces=Maces
|
||||||
JSON.Unarmed=Unarmed
|
JSON.Unarmed=Unarmed
|
||||||
JSON.Woodcutting=Woodcutting
|
JSON.Woodcutting=Woodcutting
|
||||||
@@ -98,6 +99,7 @@ Overhaul.Name.Smelting=Smelting
|
|||||||
Overhaul.Name.Swords=Swords
|
Overhaul.Name.Swords=Swords
|
||||||
Overhaul.Name.Taming=Taming
|
Overhaul.Name.Taming=Taming
|
||||||
Overhaul.Name.Tridents=Tridents
|
Overhaul.Name.Tridents=Tridents
|
||||||
|
Overhaul.Name.Spears=Spears
|
||||||
Overhaul.Name.Maces=Maces
|
Overhaul.Name.Maces=Maces
|
||||||
Overhaul.Name.Unarmed=Unarmed
|
Overhaul.Name.Unarmed=Unarmed
|
||||||
Overhaul.Name.Woodcutting=Woodcutting
|
Overhaul.Name.Woodcutting=Woodcutting
|
||||||
@@ -125,6 +127,7 @@ XPBar.Smelting=Smelting Lv.&6{0}
|
|||||||
XPBar.Swords=Swords Lv.&6{0}
|
XPBar.Swords=Swords Lv.&6{0}
|
||||||
XPBar.Taming=Taming Lv.&6{0}
|
XPBar.Taming=Taming Lv.&6{0}
|
||||||
XPBar.Tridents=Tridents Lv.&6{0}
|
XPBar.Tridents=Tridents Lv.&6{0}
|
||||||
|
XPBar.Spears=Spears Lv.&6{0}
|
||||||
XPBar.Maces=Maces Lv.&6{0}
|
XPBar.Maces=Maces Lv.&6{0}
|
||||||
XPBar.Unarmed=Unarmed Lv.&6{0}
|
XPBar.Unarmed=Unarmed Lv.&6{0}
|
||||||
XPBar.Woodcutting=Woodcutting Lv.&6{0}
|
XPBar.Woodcutting=Woodcutting Lv.&6{0}
|
||||||
@@ -474,6 +477,16 @@ Maces.SubSkill.Cripple.Stat=Cripple Chance
|
|||||||
Maces.SubSkill.Cripple.Stat.Extra=[[DARK_AQUA]]Cripple Duration: &e{0}s&a vs Players, &e{1}s&a vs Mobs.
|
Maces.SubSkill.Cripple.Stat.Extra=[[DARK_AQUA]]Cripple Duration: &e{0}s&a vs Players, &e{1}s&a vs Mobs.
|
||||||
Maces.Listener=Maces:
|
Maces.Listener=Maces:
|
||||||
|
|
||||||
|
#SPEARS
|
||||||
|
Spears.SkillName=SPEARS
|
||||||
|
Spears.Ability.Lower=&7You lower your spear.
|
||||||
|
Spears.Ability.Ready=&3You &6ready&3 your spear.
|
||||||
|
Spears.SubSkill.SpearsLimitBreak.Name=Spears Limit Break
|
||||||
|
Spears.SubSkill.SpearsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether it will boost damage in PVE.
|
||||||
|
Spears.SubSkill.SpearsLimitBreak.Stat=Limit Break Max DMG
|
||||||
|
Spears.SubSkill.SpearAbility.Name=WIP
|
||||||
|
Spears.Listener=Spears:
|
||||||
|
|
||||||
#SWORDS
|
#SWORDS
|
||||||
Swords.Ability.Lower=&7You lower your sword.
|
Swords.Ability.Lower=&7You lower your sword.
|
||||||
Swords.Ability.Ready=&3You &6ready&3 your Sword.
|
Swords.Ability.Ready=&3You &6ready&3 your Sword.
|
||||||
@@ -913,6 +926,7 @@ Commands.XPGain.Repair=Repairing
|
|||||||
Commands.XPGain.Swords=Attacking Monsters
|
Commands.XPGain.Swords=Attacking Monsters
|
||||||
Commands.XPGain.Taming=Animal Taming, or combat w/ your wolves
|
Commands.XPGain.Taming=Animal Taming, or combat w/ your wolves
|
||||||
Commands.XPGain.Tridents=Attacking Monsters
|
Commands.XPGain.Tridents=Attacking Monsters
|
||||||
|
Commands.XPGain.Spears=Attacking Monsters
|
||||||
Commands.XPGain.Unarmed=Attacking Monsters
|
Commands.XPGain.Unarmed=Attacking Monsters
|
||||||
Commands.XPGain.Woodcutting=Chopping down trees
|
Commands.XPGain.Woodcutting=Chopping down trees
|
||||||
Commands.XPGain=&8XP GAIN: &f{0}
|
Commands.XPGain=&8XP GAIN: &f{0}
|
||||||
@@ -1047,12 +1061,12 @@ Guides.Woodcutting.Section.1=&3How does Tree Feller work?\n&eTree Feller is an a
|
|||||||
Guides.Woodcutting.Section.2=&3How does Leaf Blower work?\n&eLeaf Blower is a passive ability that will cause leaf\n&eblocks to break instantly when hit with an axe. By default,\nðis ability unlocks at level 100.
|
Guides.Woodcutting.Section.2=&3How does Leaf Blower work?\n&eLeaf Blower is a passive ability that will cause leaf\n&eblocks to break instantly when hit with an axe. By default,\nðis ability unlocks at level 100.
|
||||||
Guides.Woodcutting.Section.3=&3How do Double Drops work?\n&eThis passive ability gives you a chance to obtain an extra\n&eblock for every log you chop.
|
Guides.Woodcutting.Section.3=&3How do Double Drops work?\n&eThis passive ability gives you a chance to obtain an extra\n&eblock for every log you chop.
|
||||||
# Crossbows
|
# Crossbows
|
||||||
Guides.Crossbows.Section.0=&3About Crossbows:\n&eCrossbows is all about shooting with your crossbow.\n\n&3XP GAIN:\n&eXP is gained whenever you shoot mobs with a crossbow.\nThis is a WIP skill and more information will be added soon.
|
Guides.Crossbows.Section.0=&3About Crossbows:\n&eCrossbows is all about shooting with your crossbow.\n\n&3XP GAIN:\n&eXP is gained whenever you shoot mobs with a crossbow.
|
||||||
Guides.Crossbows.Section.1=&3How does Trickshot work?\n&eTrickshot is an passive ability, you shoot your bolts at a shallow angle with a crossbow to attempt a Trickshot. This will cause the arrow to ricochet off of blocks and potentially hit a target. The number of potential bounces from a ricochet depend on the rank of Trickshot.
|
Guides.Crossbows.Section.1=&3How does Trickshot work?\n&eTrickshot is an passive ability, you shoot your bolts at a shallow angle with a crossbow to attempt a Trickshot. This will cause the arrow to ricochet off of blocks and potentially hit a target. The number of potential bounces from a ricochet depend on the rank of Trickshot.
|
||||||
# Tridents
|
# Tridents
|
||||||
Guides.Tridents.Section.0=&3About Tridents:\n&eTridents skill involves impaling foes with your trident.\n\n&3XP GAIN:\n&eXP is gained whenever you hit mobs with a trident.\nThis is a WIP skill and more information will be added soon.
|
Guides.Tridents.Section.0=&3About Tridents:\n&eTridents skill involves impaling foes with your trident.\n\n&3XP GAIN:\n&eXP is gained whenever you hit mobs with a trident.
|
||||||
Guides.Maces.Section.0=&3About Maces:\n&eMaces is all about smashing your foes with a mace.\n\n&3XP GAIN:\n&eXP is gained whenever you hit mobs with a mace.\nThis is a WIP skill and more information will be added soon.
|
Guides.Maces.Section.0=&3About Maces:\n&eMaces is all about smashing your foes with a mace.\n\n&3XP GAIN:\n&eXP is gained whenever you hit mobs with a mace.
|
||||||
|
Guides.Spears.Section.0=&3About Spears:\n&eSpears is all about impaling your foes with a spear.\n\n&3XP GAIN:\n&eXP is gained whenever you hit mobs with a spear.
|
||||||
#INSPECT
|
#INSPECT
|
||||||
Inspect.Offline= &cYou do not have permission to inspect offline players!
|
Inspect.Offline= &cYou do not have permission to inspect offline players!
|
||||||
Inspect.OfflineStats=mcMMO Stats for Offline Player &e{0}
|
Inspect.OfflineStats=mcMMO Stats for Offline Player &e{0}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user