/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package com.skelril.skree.content.zone.global.templeoffate;

import com.skelril.skree.SkreePlugin;
import com.skelril.skree.content.zone.LocationZone;
import com.skelril.skree.content.zone.ZoneImmutableBlockListener;
import com.skelril.skree.content.zone.ZoneNaturalSpawnBlocker;
import com.skelril.skree.service.internal.zone.ZoneRegion;
import com.skelril.skree.service.internal.zone.ZoneSpaceAllocator;
import com.skelril.skree.service.internal.zone.global.GlobalZoneManager;
import org.spongepowered.api.Sponge;

import java.util.function.Consumer;

public class TempleOfFateManager extends GlobalZoneManager<TempleOfFateInstance> implements LocationZone<TempleOfFateInstance> {

    public TempleOfFateManager() {
        Sponge.getEventManager().registerListeners(
                SkreePlugin.inst(),
                new TempleOfFateListener(this)
        );
        Sponge.getEventManager().registerListeners(
                SkreePlugin.inst(),
                new ZoneImmutableBlockListener(a -> getApplicableZone(a).isPresent())
        );
        Sponge.getEventManager().registerListeners(
                SkreePlugin.inst(),
                new ZoneNaturalSpawnBlocker(a -> getApplicableZone(a).isPresent())
        );
    }

    @Override
    public void init(ZoneSpaceAllocator allocator, Consumer<TempleOfFateInstance> callback) {
        allocator.regionFor(getSystemName(), clause -> {
            ZoneRegion region = clause.getKey();

            TempleOfFateInstance instance = new TempleOfFateInstance(region);
            instance.init();

            callback.accept(instance);
        });
    }

    @Override
    public String getName() {
        return "Temple of Fate";
    }
}
@@ -479,24 +479,79 @@
 awnBlocker;%0A
+import com.skelril.skree.content.zone.ZonePvPListener;%0A
 import com.s
@@ -1486,24 +1486,198 @@
 %0A        );%0A
+        Sponge.getEventManager().registerListeners(%0A                SkreePlugin.inst(),%0A                new ZonePvPListener(a -%3E getApplicableZone(a).isPresent())%0A        );%0A
     %7D%0A%0A    @

Add a PvP listener to the Temple of Fate