TownyAdvanced / FlagWar

The original war system for Towny, now with it's own repository. Celebrating over Ten Years of warfare.
https://townyadvanced.github.io/flagwar.html
Apache License 2.0
22 stars 12 forks source link

Suggestion: PvP need to be force enabled on the attacking chunk #93

Closed kenny1998cr closed 2 years ago

kenny1998cr commented 2 years ago

Please explain your feature request to the best of your abilities: Well, in my server people start a battle for the flag, everything works good BUT the most important, players cannot use PvP in the attacking chunk because the town/nation mayor set the PvP permission Off, so the attackers cannot stop the defenders.

So my suggestion is: force the PvP on the attacked chunk, If the defenders wins= Just go back to the perms that the mayor set up previously. If the attackers wins= The normal warflag stuff, the winner keep the chunk.

Here I show a video with the example: https://youtu.be/aFfLULPQXeo

LlmDl commented 2 years ago

Last I tested, on the current version, pvp is enabled in the attacked area.

kenny1998cr commented 2 years ago

Last I tested, on the current version, pvp is enabled in the attacked area.

Hello LlmDl thanks for you reply, im currently using towny 0.97.2.18 and Flagwar 0.5.1 and the same issue happening. Even worldguad is disabled. Here's a video: https://youtu.be/4O5TtagW7h0

imagen

Edit: I think that the solution is when towny detects that the flag as being planted then force PVP on the attacking town [Towny] [Global Message] [FlagWar] Town-B (Settlement) (CostaRica,328, 148) is under attack by Leader kenny1998cr!

LlmDl commented 2 years ago
    @EventHandler
    public void onTownBlockPVPTestEvent(final TownBlockPVPTestEvent townBlockPVPTestEvent) {
        if (!FlagWarConfig.isAllowingAttacks()
        || !Cell.parse(townBlockPVPTestEvent.getTownBlock().getWorldCoord()).isUnderAttack()) {
            return;
        }
        townBlockPVPTestEvent.setPvp(true);
    }

Is the code which makes any plot with a flag in it have PVP on. I'll test this myself but I'm sure it was working.

kenny1998cr commented 2 years ago
    @EventHandler
    public void onTownBlockPVPTestEvent(final TownBlockPVPTestEvent townBlockPVPTestEvent) {
        if (!FlagWarConfig.isAllowingAttacks()
        || !Cell.parse(townBlockPVPTestEvent.getTownBlock().getWorldCoord()).isUnderAttack()) {
            return;
        }
        townBlockPVPTestEvent.setPvp(true);
    }

Is the code which makes any plot with a flag in it have PVP on. I'll test this myself but I'm sure it was working.

I just made a clear install of Towny and FlagWar but the issue appear, also I have allow attacks on true

imagen

LlmDl commented 2 years ago

I've been able to reproduce it, I think I have a fix for it.

kenny1998cr commented 2 years ago

I've been able to reproduce it, I think I have a fix for it.

Good ! And thanks for the fix LlmDl you are the best (I have to donate you for all the support :) ). This fix would take some time or is going to be quick? because my server need it asap, but take your time of course. Thanks again!.