Added legacy modifiers
This commit is contained in:
@@ -15,9 +15,16 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AttackSpeedTalisman extends Talisman {
|
||||
private Map<TalismanLevel, AttributeModifier> modifiers;
|
||||
private final AttributeModifier legacyModifier = new AttributeModifier(
|
||||
UUID.nameUUIDFromBytes(this.getKey().getKey().getBytes()),
|
||||
this.getKey().getKey(),
|
||||
0,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
);
|
||||
|
||||
public AttackSpeedTalisman() {
|
||||
super("attack_speed");
|
||||
@@ -52,6 +59,8 @@ public class AttackSpeedTalisman extends Talisman {
|
||||
|
||||
AttributeModifier modifier = modifiers.get(event.getTalisman());
|
||||
|
||||
movementSpeed.removeModifier(legacyModifier);
|
||||
|
||||
if (event.getType() == EquipType.EQUIP) {
|
||||
if (this.getDisabledWorlds().contains(player.getWorld())) {
|
||||
movementSpeed.removeModifier(modifier);
|
||||
|
||||
@@ -14,9 +14,16 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class SpeedTalisman extends Talisman {
|
||||
private Map<TalismanLevel, AttributeModifier> modifiers;
|
||||
private final AttributeModifier legacyModifier = new AttributeModifier(
|
||||
UUID.nameUUIDFromBytes(this.getKey().getKey().getBytes()),
|
||||
this.getKey().getKey(),
|
||||
0,
|
||||
AttributeModifier.Operation.MULTIPLY_SCALAR_1
|
||||
);
|
||||
|
||||
public SpeedTalisman() {
|
||||
super("speed");
|
||||
@@ -51,6 +58,8 @@ public class SpeedTalisman extends Talisman {
|
||||
|
||||
AttributeModifier modifier = modifiers.get(event.getTalisman());
|
||||
|
||||
movementSpeed.removeModifier(legacyModifier);
|
||||
|
||||
if (event.getType() == EquipType.EQUIP) {
|
||||
if (this.getDisabledWorlds().contains(player.getWorld())) {
|
||||
movementSpeed.removeModifier(modifier);
|
||||
|
||||
Reference in New Issue
Block a user