package me.km.world;

import me.km.utils.ReflectionUtils;
import net.minecraft.world.GameRules;
import net.minecraft.world.storage.DerivedWorldInfo;

public class ModWorldInfo extends DerivedWorldInfo {
    private boolean thundering;
    private int rainTime = 0;
    private int thunderTime = 0;
    private int clearWeatherTime = 0;
    private int traderDelay = 0;
    private int traderSpawnChance = 0;
    private long dayTime = 0;
    private int spawnX = 0;
    private int spawnY = 0;
    private int spawnZ = 0;
    private float spawnAngle = 0.0f;
    private boolean raining = false;
    private final GameRules rules = new GameRules();

    public ModWorldInfo(DerivedWorldInfo parent) {
        super(ReflectionUtils.getDerivedWorldInfoConfiguration(parent),
                ReflectionUtils.getDerivedWorldInfoDelegate(parent));
    }

    @Override
    public void setThundering(boolean bln) {
        thundering = bln;
    }

    @Override
    public int getRainTime() {
        return rainTime;
    }

    @Override
    public void setRainTime(int i) {
        rainTime = i;
    }

    @Override
    public void setThunderTime(int i) {
        thunderTime = i;
    }

    @Override
    public int getThunderTime() {
        return thunderTime;
    }

    @Override
    public int getClearWeatherTime() {
        return clearWeatherTime;
    }

    @Override
    public void setClearWeatherTime(int i) {
        clearWeatherTime = i;
    }

    @Override
    public int getWanderingTraderSpawnDelay() {
        return traderDelay;
    }

    @Override
    public void setWanderingTraderSpawnDelay(int i) {
        traderDelay = i;
    }

    @Override
    public int getWanderingTraderSpawnChance() {
        return traderSpawnChance;
    }

    @Override
    public void setWanderingTraderSpawnChance(int i) {
        traderSpawnChance = i;
    }

    @Override
    public void setDayTime(long l) {
        dayTime = l;
    }

    @Override
    public void setSpawnX(int i) {
        spawnX = i;
    }

    @Override
    public void setSpawnY(int i) {
        spawnY = i;
    }

    @Override
    public void setSpawnZ(int i) {
        spawnZ = i;
    }

    @Override
    public void setSpawnAngle(float f) {
        spawnAngle = f;
    }

    @Override
    public int getSpawnX() {
        return spawnX;
    }

    @Override
    public int getSpawnY() {
        return spawnY;
    }

    @Override
    public int getSpawnZ() {
        return spawnZ;
    }

    @Override
    public float getSpawnAngle() {
        return spawnAngle;
    }

    @Override
    public long getDayTime() {
        return dayTime;
    }

    @Override
    public boolean isThundering() {
        return thundering;
    }

    @Override
    public boolean isRaining() {
        return raining;
    }

    @Override
    public void setRaining(boolean bln) {
        raining = bln;
    }
    
    @Override
    public GameRules getGameRulesInstance() {
        return rules;
    }
}
