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) {
5555 UUID attackedUniqueId = attackedPlayerByPerson .getUniqueId ();
5656 UUID attackerUniqueId = attacker .getUniqueId ();
5757
58- if (attacker .isOp () && this .config .settings .excludeOpFromCombat ||
59- attacker .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
58+ if (this .cannotBeTagged (attacker )) {
6059 return ;
6160 }
6261
63- if (attackedPlayerByPerson .isOp () && this .config .settings .excludeOpFromCombat ||
64- attackedPlayerByPerson .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
62+ if (this .cannotBeTagged (attackedPlayerByPerson )) {
6563 return ;
6664 }
6765
@@ -95,6 +93,10 @@ void onEntityDamage(EntityDamageEvent event) {
9593 return ;
9694 }
9795
96+ if (this .cannotBeTagged (player )) {
97+ return ;
98+ }
99+
98100 Duration combatTime = this .config .settings .combatDuration ;
99101
100102 UUID uuid = player .getUniqueId ();
@@ -132,4 +134,9 @@ private boolean isPlayerInDisabledWorld(Player player) {
132134 return this .config .settings .worldsToIgnore .contains (worldName );
133135 }
134136
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+
135142}
You can’t perform that action at this time.
0 commit comments