001/*
002 * Trident - A Multithreaded Server Alternative
003 * Copyright 2014 The TridentSDK Team
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package net.tridentsdk;
019
020// if these shouldn't exist, or should go somewhere else, just move them
021// this is probably temporary
022
023import net.tridentsdk.util.TridentLogger;
024import net.tridentsdk.world.settings.Difficulty;
025
026import javax.annotation.concurrent.ThreadSafe;
027import java.util.concurrent.ThreadFactory;
028
029/**
030 * Contains the default values used in server.json
031 *
032 * @author The TridentSDK Team
033 * @since 0.3-alpha-DP
034 */
035@ThreadSafe
036public final class Defaults {
037    /**
038     * Maximum allowed players on the server
039     */
040    public static final int MAX_PLAYERS = 10;
041    /**
042     * The text displayed below the server name in the multiplayer menu
043     */
044    public static final String MOTD = "Just another Trident server...";
045    /**
046     * The difficulty of the game
047     */
048    public static final Difficulty DIFFICULTY = Difficulty.EASY;
049    /**
050     * The icon on the left of the server
051     */
052    public static final String MOTD_IMAGE_LOCATION = "server-icon.png";
053    /**
054     * The threshold used for compression
055     */
056    public static final int COMPRESSION_THRESHOLD = 256;
057    /**
058     * The server port
059     */
060    public static final int PORT = 25565;
061    /**
062     * The default address for the server
063     */
064    public static final String ADDRESS = "localhost";
065    /**
066     * The default view distance of the server
067     */
068    public static final int VIEW_DISTANCE = 15;
069
070    public static final boolean IMAGE_CHANGING_ALLOWED = false;
071
072    /**
073     * The thread factory which makes a thread that handles exceptions
074     */
075    public static final ThreadFactory ERROR_HANDLED = runnable -> new Thread(() -> {
076        try {
077            runnable.run();
078        } catch (Exception e) {
079            TridentLogger.get().error(e);
080        }
081    });
082
083    private Defaults() {
084    }
085}