File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
eternalcombat-plugin/src/main/java/com/eternalcode/combat/fight/controller Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,11 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
55
55
UUID attackedUniqueId = attackedPlayerByPerson .getUniqueId ();
56
56
UUID attackerUniqueId = attacker .getUniqueId ();
57
57
58
- if (attacker .isOp () && this .config .settings .excludeOpFromCombat ||
59
- attacker .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
58
+ if (this .cannotBeTagged (attacker )) {
60
59
return ;
61
60
}
62
61
63
- if (attackedPlayerByPerson .isOp () && this .config .settings .excludeOpFromCombat ||
64
- attackedPlayerByPerson .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
62
+ if (this .cannotBeTagged (attackedPlayerByPerson )) {
65
63
return ;
66
64
}
67
65
@@ -95,6 +93,10 @@ void onEntityDamage(EntityDamageEvent event) {
95
93
return ;
96
94
}
97
95
96
+ if (this .cannotBeTagged (player )) {
97
+ return ;
98
+ }
99
+
98
100
Duration combatTime = this .config .settings .combatDuration ;
99
101
100
102
UUID uuid = player .getUniqueId ();
@@ -132,4 +134,9 @@ private boolean isPlayerInDisabledWorld(Player player) {
132
134
return this .config .settings .worldsToIgnore .contains (worldName );
133
135
}
134
136
137
+ private boolean cannotBeTagged (Player player ) {
138
+ return (player .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) ||
139
+ (player .isOp () && this .config .settings .excludeOpFromCombat );
140
+ }
141
+
135
142
}
You can’t perform that action at this time.
0 commit comments