This commit is contained in:
DBotThePony 2021-08-23 14:24:00 +07:00
parent 9ff3fefd50
commit b1373c4360
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1,18 +1,15 @@
package ru.dbotthepony.mc.otm.android.feature; package ru.dbotthepony.mc.otm.android.feature;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.attributes.Attributes;
import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.android.AndroidFeature; import ru.dbotthepony.mc.otm.android.AndroidFeature;
import ru.dbotthepony.mc.otm.android.AndroidFeatureType; import ru.dbotthepony.mc.otm.android.AndroidFeatureType;
import ru.dbotthepony.mc.otm.android.AndroidResearch;
import ru.dbotthepony.mc.otm.capability.IAndroidCapability; import ru.dbotthepony.mc.otm.capability.IAndroidCapability;
import java.util.UUID; import java.util.UUID;
public class AndroidLimbOverclocking extends AndroidFeature { public class AndroidLimbOverclocking extends AndroidFeature {
public final UUID MODIFIED_NAME = UUID.fromString("4a3fae46-e57b-4e20-857d-f5c2b2c8f2f2"); public final UUID MODIFIER_NAME = UUID.fromString("4a3fae46-e57b-4e20-857d-f5c2b2c8f2f2");
public AndroidLimbOverclocking(AndroidFeatureType<?> type, IAndroidCapability capability) { public AndroidLimbOverclocking(AndroidFeatureType<?> type, IAndroidCapability capability) {
super(type, capability); super(type, capability);
@ -23,8 +20,8 @@ public class AndroidLimbOverclocking extends AndroidFeature {
var speed = capability.getEntity().getAttribute(Attributes.MOVEMENT_SPEED); var speed = capability.getEntity().getAttribute(Attributes.MOVEMENT_SPEED);
if (speed != null) { if (speed != null) {
speed.removePermanentModifier(MODIFIED_NAME); speed.removePermanentModifier(MODIFIER_NAME);
speed.addPermanentModifier(new AttributeModifier(MODIFIED_NAME, type.getDisplayName().toString(), 0.08d * (level + 1), AttributeModifier.Operation.MULTIPLY_TOTAL)); speed.addPermanentModifier(new AttributeModifier(MODIFIER_NAME, type.getDisplayName().toString(), 0.08d * (level + 1), AttributeModifier.Operation.MULTIPLY_TOTAL));
} }
} }
@ -33,7 +30,7 @@ public class AndroidLimbOverclocking extends AndroidFeature {
var speed = capability.getEntity().getAttribute(Attributes.MOVEMENT_SPEED); var speed = capability.getEntity().getAttribute(Attributes.MOVEMENT_SPEED);
if (speed != null) { if (speed != null) {
speed.removePermanentModifier(MODIFIED_NAME); speed.removePermanentModifier(MODIFIER_NAME);
} }
} }
} }