File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
eternalcombat-plugin/src/main/java/com/eternalcode/combat Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,13 @@ public static class Settings extends OkaeriConfig {
68
68
"# Setting this to true - admins cannot be tagged and will not tag other players on hit" ,
69
69
"# Setting this to false - admins can be tagged and can tag other players on hit"
70
70
})
71
- public boolean excludeAdminFromCombat = false ;
71
+ public boolean excludeOpFromCombat = false ;
72
+
73
+ @ Comment ({"# If you want to exclude players in creative mode from combat, " ,
74
+ "# Setting this to true - players in creative mode cannot be tagged and will not tag other players on hit" ,
75
+ "# Setting this to false - players in creative mode can be tag others"
76
+ })
77
+ public boolean excludeCreativeFromCombat = false ;
72
78
73
79
@ Comment ("# Command blocking mode, available modes: WHITELIST, BLACKLIST" )
74
80
public WhitelistBlacklistMode commandBlockingMode = WhitelistBlacklistMode .BLACKLIST ;
Original file line number Diff line number Diff line change 4
4
import com .eternalcode .combat .config .implementation .PluginConfig ;
5
5
import com .eternalcode .combat .fight .FightManager ;
6
6
import com .eternalcode .combat .fight .event .CauseOfTag ;
7
+ import org .bukkit .GameMode ;
7
8
import org .bukkit .entity .EntityType ;
8
9
import org .bukkit .entity .Player ;
9
10
import org .bukkit .entity .Projectile ;
@@ -54,11 +55,13 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
54
55
UUID attackedUniqueId = attackedPlayerByPerson .getUniqueId ();
55
56
UUID attackerUniqueId = attacker .getUniqueId ();
56
57
57
- if (attacker .isOp () && this .config .settings .excludeAdminFromCombat ) {
58
+ if (attacker .isOp () && this .config .settings .excludeOpFromCombat ||
59
+ attacker .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
58
60
return ;
59
61
}
60
62
61
- if (attackedPlayerByPerson .isOp () && this .config .settings .excludeAdminFromCombat ) {
63
+ if (attackedPlayerByPerson .isOp () && this .config .settings .excludeOpFromCombat ||
64
+ attackedPlayerByPerson .getGameMode ().equals (GameMode .CREATIVE ) && this .config .settings .excludeCreativeFromCombat ) {
62
65
return ;
63
66
}
64
67
You can’t perform that action at this time.
0 commit comments