mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-12-17 06:18:46 +01:00
2.2.048 hotfix for spear manager exception Fixes #5237
Some checks failed
EpicKnarvik97/mcMMO/pipeline/head There was a failure building this commit
Some checks failed
EpicKnarvik97/mcMMO/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
Version 2.2.048
|
||||
Fixed error when loading Spears skill manager on older Minecraft versions
|
||||
Fixed error when using /spears command on an older Minecraft version
|
||||
|
||||
Version 2.2.047
|
||||
Fix bug where off-hand spears damage could be attributed to various combat skills and trigger their abilities
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.2.047</version>
|
||||
<version>2.2.048</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
|
||||
@@ -181,7 +181,6 @@ public class McMMOPlayer implements Identified {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Add test
|
||||
private void initManager(PrimarySkillType primarySkillType) throws InvalidSkillException {
|
||||
final var version = mcMMO.getCompatibilityManager().getMinecraftGameVersion();
|
||||
|
||||
@@ -203,20 +202,12 @@ public class McMMOPlayer implements Identified {
|
||||
case TRIDENTS -> new TridentsManager(this);
|
||||
case UNARMED -> new UnarmedManager(this);
|
||||
case WOODCUTTING -> new WoodcuttingManager(this);
|
||||
|
||||
case MACES -> version.isAtLeast(1, 21, 0)
|
||||
? new MacesManager(this)
|
||||
: null; // keep current behavior: no manager on older versions
|
||||
|
||||
case SPEARS -> version.isAtLeast(1, 21, 11)
|
||||
? new SpearsManager(this)
|
||||
: null; // same here
|
||||
case MACES -> version.isAtLeast(1, 21, 0) ? new MacesManager(this) : null;
|
||||
case SPEARS -> version.isAtLeast(1, 21, 11) ? new SpearsManager(this) : null;
|
||||
};
|
||||
|
||||
if (manager != null) {
|
||||
skillManagers.put(primarySkillType, manager);
|
||||
} else {
|
||||
throw new InvalidSkillException("No valid skill manager for skill: " + primarySkillType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,12 @@ public final class CommandRegistrationManager {
|
||||
|
||||
private static void registerSkillCommands() {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
if (primarySkillType == PrimarySkillType.SPEARS
|
||||
&& !mcMMO.getCompatibilityManager().getMinecraftGameVersion()
|
||||
.isAtLeast(1, 21, 11)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (primarySkillType == PrimarySkillType.MACES
|
||||
&& !mcMMO.getCompatibilityManager().getMinecraftGameVersion()
|
||||
.isAtLeast(1, 21, 0)) {
|
||||
|
||||
Reference in New Issue
Block a user