Skip to content

Commit b0622dc

Browse files
committed
2.2.048 hotfix for spear manager exception Fixes #5237
1 parent e2f18a9 commit b0622dc

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 2.2.048
2+
Fixed error when loading Spears skill manager on older Minecraft versions
3+
14
Version 2.2.047
25
Fix bug where off-hand spears damage could be attributed to various combat skills and trigger their abilities
36

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.gmail.nossr50.mcMMO</groupId>
66
<artifactId>mcMMO</artifactId>
7-
<version>2.2.047</version>
7+
<version>2.2.048</version>
88
<name>mcMMO</name>
99
<url>https://github.com/mcMMO-Dev/mcMMO</url>
1010
<scm>

src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ private void initSkillManagers() {
181181
}
182182
}
183183

184-
//TODO: Add test
185184
private void initManager(PrimarySkillType primarySkillType) throws InvalidSkillException {
186185
final var version = mcMMO.getCompatibilityManager().getMinecraftGameVersion();
187186

@@ -203,20 +202,12 @@ private void initManager(PrimarySkillType primarySkillType) throws InvalidSkillE
203202
case TRIDENTS -> new TridentsManager(this);
204203
case UNARMED -> new UnarmedManager(this);
205204
case WOODCUTTING -> new WoodcuttingManager(this);
206-
207-
case MACES -> version.isAtLeast(1, 21, 0)
208-
? new MacesManager(this)
209-
: null; // keep current behavior: no manager on older versions
210-
211-
case SPEARS -> version.isAtLeast(1, 21, 11)
212-
? new SpearsManager(this)
213-
: null; // same here
205+
case MACES -> version.isAtLeast(1, 21, 0) ? new MacesManager(this) : null;
206+
case SPEARS -> version.isAtLeast(1, 21, 11) ? new SpearsManager(this) : null;
214207
};
215208

216209
if (manager != null) {
217210
skillManagers.put(primarySkillType, manager);
218-
} else {
219-
throw new InvalidSkillException("No valid skill manager for skill: " + primarySkillType);
220211
}
221212
}
222213

0 commit comments

Comments
 (0)