Skip to content

Commit

Permalink
Merge pull request #71 from TownyAdvanced/hotfix/attribute_flood
Browse files Browse the repository at this point in the history
Fix knockback attributes not being removed.
  • Loading branch information
LlmDl authored Jan 7, 2023
2 parents 3bd522f + 63be604 commit 2eb08c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.townyadvanced</groupId>
<artifactId>TownyCombat</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
<name>townycombat</name> <!-- Leave lower-cased -->

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static void adjustPlayerKnockbackResistance(Player player) {
return;

//Remove old modifier
for(AttributeModifier attributeModifier: new ArrayList<>(player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getModifiers())) {
for(AttributeModifier attributeModifier: new ArrayList<>(player.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).getModifiers())) {
if(attributeModifier.getName().equals(ATTRIBUTE_MODIFIER_NAME)) {
player.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).removeModifier(attributeModifier);
}
Expand All @@ -185,7 +185,7 @@ public static void adjustMountKnockbackResistance(Player player) {
return;

//Remove old modifier
for(AttributeModifier attributeModifier: new ArrayList<>(mount.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getModifiers())) {
for(AttributeModifier attributeModifier: new ArrayList<>(mount.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).getModifiers())) {
if(attributeModifier.getName().equals(ATTRIBUTE_MODIFIER_NAME)) {
mount.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).removeModifier(attributeModifier);
}
Expand Down

0 comments on commit 2eb08c0

Please sign in to comment.