9
0
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:
Auxilor
2021-08-29 12:36:28 +01:00
parent 14be897fa0
commit d02640bd4c
5 changed files with 14 additions and 1 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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