From 67cd4e44d16c4a5c332909926ea0db8079334f20 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 22 Jan 2022 14:34:48 +0100 Subject: [PATCH] Support for latest ML --- pom.xml | 6 +++--- src/main/java/net/Indyuce/mmocore/MMOCore.java | 3 +-- .../net/Indyuce/mmocore/api/player/PlayerData.java | 10 ++++------ .../mmocore/api/player/profess/PlayerClass.java | 2 +- .../Indyuce/mmocore/experience/ExperienceObject.java | 2 +- .../net/Indyuce/mmocore/skill/list/Sneaky_Picky.java | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index b2c18c0b..56e2545f 100644 --- a/pom.xml +++ b/pom.xml @@ -44,8 +44,8 @@ maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 9 + 9 UTF-8 -proc:none @@ -140,7 +140,7 @@ io.lumine MythicLib-dist - 1.3-R20-SNAPSHOT + 1.3-R21-SNAPSHOT provided diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index d283f016..bd186966 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -101,7 +101,7 @@ public class MMOCore extends LuminePlugin { public boolean shouldDebugSQL = false; - private static final int MYTHICLIB_COMPATIBILITY_INDEX = 3; + private static final int MYTHICLIB_COMPATIBILITY_INDEX = 4; public MMOCore() { plugin = this; @@ -362,7 +362,6 @@ public class MMOCore extends LuminePlugin { // Clear spawned loot chests lootChests.getActive().forEach(chest -> chest.unregister(false)); - } /** diff --git a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 4d39884a..c7842b85 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -246,20 +246,18 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc @Override public int getClaims(ExperienceObject object, ExperienceTable table, ExperienceItem item) { - String key = object.geyKey() + "." + table.getId() + "." + item.getId(); + String key = object.getKey() + "." + table.getId() + "." + item.getId(); return tableItemClaims.get(key); } @Override public void setClaims(ExperienceObject object, ExperienceTable table, ExperienceItem item, int times) { - String key = object.geyKey() + "." + table.getId() + "." + item.getId(); + String key = object.getKey() + "." + table.getId() + "." + item.getId(); tableItemClaims.put(key, times); } - @Deprecated(since = "1.9") - public void setProfessionExpItemClaims(String professionTableItemKey, int times) { - Validate.isTrue(!professionTableItemKey.startsWith("class.") && !professionTableItemKey.startsWith("profession."), "Invalid exp item key"); - tableItemClaims.put("profession." + professionTableItemKey, times); + public Map getItemClaims() { + return tableItemClaims; } /** diff --git a/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java b/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java index 76762b1a..d6b1fc20 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java @@ -218,7 +218,7 @@ public class PlayerClass extends PostLoadObject implements ExperienceObject { } @Override - public String geyKey() { + public String getKey() { return "class." + getId(); } diff --git a/src/main/java/net/Indyuce/mmocore/experience/ExperienceObject.java b/src/main/java/net/Indyuce/mmocore/experience/ExperienceObject.java index c0e82e7e..e57a64bb 100644 --- a/src/main/java/net/Indyuce/mmocore/experience/ExperienceObject.java +++ b/src/main/java/net/Indyuce/mmocore/experience/ExperienceObject.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; */ public interface ExperienceObject { - String geyKey(); + String getKey(); /** * Indicates the amount of exp required to level up diff --git a/src/main/java/net/Indyuce/mmocore/skill/list/Sneaky_Picky.java b/src/main/java/net/Indyuce/mmocore/skill/list/Sneaky_Picky.java index 266d1f52..eeb3b1e3 100644 --- a/src/main/java/net/Indyuce/mmocore/skill/list/Sneaky_Picky.java +++ b/src/main/java/net/Indyuce/mmocore/skill/list/Sneaky_Picky.java @@ -30,7 +30,7 @@ public class Sneaky_Picky extends SkillHandler implements Lis @Override public void whenCast(SimpleSkillResult result, SkillMetadata skillMeta) { LivingEntity target = (LivingEntity) skillMeta.getTargetEntity(); - skillMeta.getAttack().getDamage().multiply(1 + skillMeta.getModifier("extra") / 100, DamageType.WEAPON); + skillMeta.getAttack().getDamage().multiplicativeModifier(1 + skillMeta.getModifier("extra") / 100, DamageType.WEAPON); target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().add(0, target.getHeight() / 2, 0), 64, 0, 0, 0, .05); target.getWorld().playSound(target.getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 1, 2); }