mirror of
https://github.com/Auxilor/Reforges.git
synced 2025-12-25 09:59:27 +00:00
Changed attribute modifiers
This commit is contained in:
@@ -19,6 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class Reforge implements Listener, Watcher {
|
||||
/**
|
||||
@@ -33,6 +34,12 @@ public abstract class Reforge implements Listener, Watcher {
|
||||
@Getter
|
||||
private final String key;
|
||||
|
||||
/**
|
||||
* The UUID used in attribute modifiers.
|
||||
*/
|
||||
@Getter
|
||||
private final UUID uuid;
|
||||
|
||||
/**
|
||||
* The reforges config.
|
||||
*/
|
||||
@@ -79,6 +86,7 @@ public abstract class Reforge implements Listener, Watcher {
|
||||
@NotNull final Prerequisite... prerequisites) {
|
||||
this.key = key;
|
||||
this.config = new ReforgeConfig(this.getKey(), this.getClass(), this.plugin);
|
||||
this.uuid = UUID.nameUUIDFromBytes(key.getBytes());
|
||||
|
||||
if (!Prerequisite.areMet(prerequisites)) {
|
||||
return;
|
||||
|
||||
@@ -35,11 +35,13 @@ public class ReforgeLight extends Reforge {
|
||||
assert meta != null;
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
this.getUuid(),
|
||||
"light-speed",
|
||||
this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "speed-multiplier") - 1,
|
||||
(this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "speed-multiplier") - 1),
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_KNOCKBACK, new AttributeModifier(
|
||||
this.getUuid(),
|
||||
"light-kb",
|
||||
this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "knockback-multiplier") - 1,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
|
||||
@@ -35,6 +35,7 @@ public class ReforgeStrong extends Reforge {
|
||||
assert meta != null;
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_KNOCKBACK, new AttributeModifier(
|
||||
this.getUuid(),
|
||||
"strong-kb",
|
||||
this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "knockback-multiplier") - 1,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ReforgeThin extends Reforge {
|
||||
assert meta != null;
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_MOVEMENT_SPEED, new AttributeModifier(
|
||||
this.getUuid(),
|
||||
"thin-speed",
|
||||
this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "speed-multiplier") - 1,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ReforgeTough extends Reforge {
|
||||
assert meta != null;
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_MOVEMENT_SPEED, new AttributeModifier(
|
||||
this.getUuid(),
|
||||
"tough-speed",
|
||||
this.getConfig().getDouble(Reforges.CONFIG_LOCATION + "speed-multiplier") - 1,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
|
||||
Reference in New Issue
Block a user