// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.command.commands.world.entity;

import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.modules.entity.tracker.LegacyEntityTrackerSystems;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.AbstractCommand;
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgumentType;
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
import javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;

public class EntityLodCommand extends CommandBase
{
    @Nonnull
    private final RequiredArg<Double> ratioArg;
    
    public EntityLodCommand() {
        super("lod", "server.commands.entity.lod.desc");
        this.ratioArg = this.withRequiredArg("ratio", "server.commands.entity.lod.ratio.desc", ArgTypes.DOUBLE);
        this.addSubCommand(new Default());
    }
    
    @Override
    protected void executeSync(@Nonnull final CommandContext context) {
        LegacyEntityTrackerSystems.LegacyLODCull.ENTITY_LOD_RATIO = this.ratioArg.get(context);
        context.sendMessage(Message.translation("server.commands.entity.lod.ratioSet").param("ratio", LegacyEntityTrackerSystems.LegacyLODCull.ENTITY_LOD_RATIO));
    }
    
    static class Default extends CommandBase
    {
        Default() {
            super("default", "server.commands.entity.lod.default.desc");
        }
        
        @Override
        protected void executeSync(@Nonnull final CommandContext context) {
            LegacyEntityTrackerSystems.LegacyLODCull.ENTITY_LOD_RATIO = 3.5E-5;
            context.sendMessage(Message.translation("server.commands.entity.lod.ratioSet").param("ratio", LegacyEntityTrackerSystems.LegacyLODCull.ENTITY_LOD_RATIO));
        }
    }
}
