/*
 *  This file is part of Cubic Chunks Mod, licensed under the MIT License (MIT).
 *
 *  Copyright (c) 2015-2021 OpenCubicChunks
 *  Copyright (c) 2015-2021 contributors
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */
package io.github.opencubicchunks.cubicchunks.api.worldgen.structure.event;

import io.github.opencubicchunks.cubicchunks.api.worldgen.structure.ICubicStructureGenerator;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

/**
 * This event is fired on initialization of cubic terrain generators during
 * cubic type world load.<br> This event is not {@link Cancelable}. This event
 * is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
 *
 */
public class InitCubicStructureGeneratorEvent extends Event {

    private final EventType type;
    private final ICubicStructureGenerator originalGen;
    private ICubicStructureGenerator newGen;

    public InitCubicStructureGeneratorEvent(EventType type, ICubicStructureGenerator original) {
        this.type = type;
        this.originalGen = original;
        this.setNewGen(original);
    }

    public EventType getType() {
        return type;
    }

    public ICubicStructureGenerator getOriginalGen() {
        return originalGen;
    }

    public ICubicStructureGenerator getNewGen() {
        return newGen;
    }

    public void setNewGen(ICubicStructureGenerator newGen) {
        this.newGen = newGen;
    }
}

@@ -1430,16 +1430,50 @@
 erator;%0A
+import net.minecraft.world.World;%0A
 import n
@@ -1703,16 +1703,51 @@
 Event;%0A%0A
+import javax.annotation.Nullable;%0A%0A
 /**%0A * T
@@ -2161,16 +2161,75 @@
 newGen;%0A
+    private World world;%0A%0A    @Deprecated // to be removed!
 %0A    pub
@@ -2414,32 +2414,347 @@
 iginal);%0A    %7D%0A%0A
+    public InitCubicStructureGeneratorEvent(EventType type, ICubicStructureGenerator original, World world) %7B%0A        this.type = type;%0A        this.originalGen = original;%0A        this.world = world;%0A        this.setNewGen(original);%0A    %7D%0A%0A    @Nullable%0A    public World getWorld() %7B%0A        return world;%0A    %7D%0A%0A
     public Event

Add a constructor with World to InitCubicStructureGeneratorEvent