Skip to content

Commit

Permalink
Dumb attributes being converted to an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Travja committed Nov 28, 2024
1 parent ce350e3 commit 075a27a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<description>Custom items, combat, and more!</description>

<properties>
<codex.version>1.0.1-R0.15-SNAPSHOT</codex.version>
<codex.version>1.0.1-R0.16-SNAPSHOT</codex.version>
<fabled.version>1.0.4-R0.8-SNAPSHOT</fabled.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class DependencyRequirement {

public static final String MIN_CORE_VERSION = "1.0.1-R0.8-SNAPSHOT";
public static final String MIN_CORE_VERSION = "1.0.1-R0.16-SNAPSHOT";

public static boolean meetsVersion(String requiredVersion, String providedVersion) {
List<Integer> required = splitVersion(requiredVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.elmakers.mine.bukkit.api.magic.MageController;
import com.elmakers.mine.bukkit.api.spell.MageSpell;
import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.attribute.Attribute;
import org.bukkit.Keyed;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
Expand All @@ -22,10 +22,7 @@
import studio.magemonkey.codex.config.api.JYML;
import studio.magemonkey.codex.hooks.Hooks;
import studio.magemonkey.codex.manager.api.task.ITask;
import studio.magemonkey.codex.util.FileUT;
import studio.magemonkey.codex.util.NumberUT;
import studio.magemonkey.codex.util.StringUT;
import studio.magemonkey.codex.util.TimeUT;
import studio.magemonkey.codex.util.*;
import studio.magemonkey.divinity.Divinity;
import studio.magemonkey.divinity.api.event.EntityStatsBonusUpdateEvent;
import studio.magemonkey.divinity.data.api.DivinityUser;
Expand Down Expand Up @@ -479,8 +476,8 @@ public void updateClassData(@NotNull Player player) {
}

for (ClassAttributeType type : ClassAttributeType.values()) {
Attribute a = type.getVanillaAttribute();
AttributeInstance ai = player.getAttribute(a);
Keyed a = type.getVanillaAttribute();
AttributeInstance ai = EntityUT.getAttributeInstance(player, a);
if (ai == null) continue;

double val = ai.getDefaultValue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package studio.magemonkey.divinity.modules.list.classes.object;

import org.bukkit.attribute.Attribute;
import org.bukkit.Keyed;
import org.jetbrains.annotations.NotNull;
import studio.magemonkey.codex.util.AttributeUT;
import studio.magemonkey.codex.util.StringUT;
Expand All @@ -18,9 +18,9 @@ public enum ClassAttributeType {
MOVEMENT_SPEED(0.1D),
;

private Attribute att;
private String name;
private double defValue;
private Keyed att;
private String name;
private double defValue;

private ClassAttributeType(double def) {
this.att = AttributeUT.resolve(this.name());
Expand All @@ -29,7 +29,7 @@ private ClassAttributeType(double def) {
}

@NotNull
public Attribute getVanillaAttribute() {
public Keyed getVanillaAttribute() {
return this.att;
}

Expand Down

0 comments on commit 075a27a

Please sign in to comment.