Fix Sprint Assist Module not working (Scala to Java porting error)
This commit is contained in:
parent
49ced9fd0d
commit
b99f707743
|
@ -73,7 +73,7 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
||||||
NBTTagList modifiers = item.getTagCompound().getTagList("AttributeModifiers", (byte)10);
|
NBTTagList modifiers = item.getTagCompound().getTagList("AttributeModifiers", (byte)10);
|
||||||
for (int i = 0; i< modifiers.tagCount(); i++) {
|
for (int i = 0; i< modifiers.tagCount(); i++) {
|
||||||
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
||||||
if (Objects.equals(new AttributeModifier(tag).name, "Sprint Assist")) {
|
if (new AttributeModifier(tag).name == "Sprint Assist") {
|
||||||
tag.setDouble("Amount", 0);
|
tag.setDouble("Amount", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,17 +83,17 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
||||||
public void setMovementModifier(ItemStack item, double multiplier) {
|
public void setMovementModifier(ItemStack item, double multiplier) {
|
||||||
NBTTagList modifiers = item.getTagCompound().getTagList("AttributeModifiers", (byte) 10); // Type 10 for tag compound
|
NBTTagList modifiers = item.getTagCompound().getTagList("AttributeModifiers", (byte) 10); // Type 10 for tag compound
|
||||||
item.getTagCompound().setTag("AttributeModifiers", modifiers);
|
item.getTagCompound().setTag("AttributeModifiers", modifiers);
|
||||||
List sprintModifiers = new ArrayList();
|
NBTTagCompound sprintModifiers = new NBTTagCompound();
|
||||||
for (int i = 0; i < modifiers.tagCount(); i++) {
|
for (int i = 0; i < modifiers.tagCount(); i++) {
|
||||||
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
||||||
if (Objects.equals(new AttributeModifier(tag).name, "Sprint Assist")) {
|
if (new AttributeModifier(tag).name == "Sprint Assist") {
|
||||||
tag.setInteger("Operation", 1);
|
sprintModifiers = tag;
|
||||||
tag.setDouble("Amount", multiplier - 1);
|
sprintModifiers.setInteger("Operation", 1);
|
||||||
sprintModifiers.add(tag);
|
sprintModifiers.setDouble("Amount", multiplier - 1);
|
||||||
}
|
}
|
||||||
if (sprintModifiers.isEmpty())
|
|
||||||
modifiers.appendTag(new AttributeModifier(1, TAGUUID, multiplier - 1, "generic.movementSpeed", "Sprint Assist").toNBT());
|
|
||||||
}
|
}
|
||||||
|
if (sprintModifiers.hasNoTags())
|
||||||
|
modifiers.appendTag(new AttributeModifier(1, TAGUUID, multiplier - 1, "generic.movementSpeed", "Sprint Assist").toNBT());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue