/*
 *  This file is part of Cubic Chunks Mod, licensed under the MIT License (MIT).
 *
 *  Copyright (c) 2015 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 cubicchunks.asm.mixin.core.common;

import cubicchunks.world.ICubicWorldSettings;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.WorldSettings;
import org.spongepowered.asm.mixin.Mixin;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;

@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
@Mixin(WorldSettings.class)
public class MixinWorldSettings implements ICubicWorldSettings {

    private boolean isCubic;

    @Override public boolean isCubic() {
        return isCubic;
    }

    @Override public void setCubic(boolean cubic) {
        this.isCubic = cubic;
    }
}

@@ -1480,41 +1480,257 @@
 ort 
-org.spongepowered.asm.mixin.Mixin
+net.minecraft.world.storage.WorldInfo;%0Aimport org.spongepowered.asm.mixin.Mixin;%0Aimport org.spongepowered.asm.mixin.injection.At;%0Aimport org.spongepowered.asm.mixin.injection.Inject;%0Aimport org.spongepowered.asm.mixin.injection.callback.CallbackInfo
 ;%0A%0Ai
@@ -2053,16 +2053,248 @@
 Cubic;%0A%0A
+    @Inject(method = %22%3Cinit%3E(Lnet/minecraft/world/storage/WorldInfo;)V%22, at = @At(%22RETURN%22))%0A    private void onConstruct(WorldInfo info, CallbackInfo cbi) %7B%0A        this.isCubic = ((ICubicWorldSettings) info).isCubic();%0A    %7D%0A    %0A
     @Ove

Fix integrated server height limit when loading existing world