Fix ClassCastException for Rupture

Fixes #4476
This commit is contained in:
nossr50 2021-04-03 09:46:01 -07:00
parent 3e60dfcf98
commit e8577e4a9e
4 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.187
Fixed a ClassCastException error involving Rupture
Version 2.1.186
Rupture has been reworked to solve a few outstanding issues (see notes)
Fixed an exploit involving enchantments (thanks TheBusyBiscuit)

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.186</version>
<version>2.1.187-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -1081,7 +1081,7 @@ public class McMMOPlayer implements Identified {
public void logout(boolean syncSave) {
Player thisPlayer = getPlayer();
if(getPlayer().hasMetadata(mcMMO.RUPTURE_META_KEY)) {
RuptureTaskMeta ruptureTaskMeta = (RuptureTaskMeta) getPlayer().getMetadata(mcMMO.RUPTURE_META_KEY);
RuptureTaskMeta ruptureTaskMeta = (RuptureTaskMeta) getPlayer().getMetadata(mcMMO.RUPTURE_META_KEY).get(0);
//Punish a logout
ruptureTaskMeta.getRuptureTimerTask().explode();

View File

@ -65,7 +65,7 @@ public class SwordsManager extends SkillManager {
*/
public void processRupture(@NotNull LivingEntity target) {
if(target.hasMetadata(mcMMO.RUPTURE_META_KEY)) {
RuptureTaskMeta ruptureTaskMeta = (RuptureTaskMeta) target.getMetadata(mcMMO.RUPTURE_META_KEY);
RuptureTaskMeta ruptureTaskMeta = (RuptureTaskMeta) target.getMetadata(mcMMO.RUPTURE_META_KEY).get(0);
if(mmoPlayer.isDebugMode()) {
mmoPlayer.getPlayer().sendMessage("Rupture task ongoing for target " + target.toString());