Skip to content

Commit e56cb4e

Browse files
committed
Add option for close inventory
1 parent ec42b9f commit e56cb4e

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

pvpmanager/src/main/java/me/chancesd/pvpmanager/player/CombatPlayer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ public final synchronized void tag(final boolean isAttacker, final CombatPlayer
185185
getPlayer().setGlowing(true);
186186
}
187187

188-
getPlayer().closeInventory();
188+
if (Conf.CLOSE_INVENTORY_ON_TAG.asBool()) {
189+
getPlayer().closeInventory();
190+
}
189191

190192
if (nametag != null) {
191193
ScheduleUtils.runAsync(nametag::setInCombat);

pvpmanager/src/main/java/me/chancesd/pvpmanager/setting/Conf.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public enum Conf {
3939
SELF_TAG(ConfSection.COMBAT_TAG, "Self Tag", false, Boolean.class),
4040
PEARL_RENEW_TAG(ConfSection.COMBAT_TAG, "EnderPearl Renews Tag", true, Boolean.class),
4141
WIND_CHARGE_RENEW_TAG(ConfSection.COMBAT_TAG, "WindCharge Renews Tag", bool -> MCVersion.isAtLeast(MCVersion.V1_21) && bool, Boolean.class, Boolean.class),
42+
CLOSE_INVENTORY_ON_TAG(ConfSection.COMBAT_TAG, "Close Inventory On Tag", true, Boolean.class),
4243

4344
DUEL_MODE_ENABLED(ConfSection.COMBAT_TAG, "Duel Mode", false, Boolean.class),
4445

pvpmanager/src/main/resources/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Combat Tag:
3232
EnderPearl Renews Tag: true
3333
# If enabled, will retag the player when they use a wind charge
3434
WindCharge Renews Tag: true
35+
# Automatically close the player inventory and chat when they get tagged
36+
Close Inventory On Tag: true
3537

3638
# Allows for a fair fight between only two combat tagged players, without third party interference
3739
# Useful for FFA or mass PvP scenarios

0 commit comments

Comments
 (0)