========================================================================
                        Classic+ Server Stable
========================================================================

### !!!IMPORTANT!!! ###

In order to properly set up a server using a docker container, make sure that the server is listening to the same port that the container is mapped to!!!
Also, if you want people to join your server using a hostname, make sure to add it to the server.properties' hostname field! Otherwise, the server will expect people to connect using IP instead.
Currently there is no way to have both hostname and IP connectivity. 
Lastly, if you want to join your own online server, localhost or local IP won't work for the reasons above. Use the public IP or hostname instead. 
None of this applies if you run your server with verify-names turned off!  

### INTRODUCTION ###

To run a server, make sure you have port forwarding enabled in your router. Then, simply run the "start server" bat file. 
If you are on Linux or Mac, open up your console and type the following command to start the server: 
java -cp classic-plus-server.jar com.mojang.minecraft.server.MinecraftServer 
You will see a new command prompt window open up. Here, you can track the server status, chat, server messages etc. 
You can also use admin commands directly from the console, or say hi to active players!
In order to change server settings, edit the server.properties file with a text editor. Keep in mind you must restart the server for the changes to take effect! 
To close the server, simply close the command prompt / console window. 

### SERVER PROPERTIES ###

The following is a list of server properties and what each one does: 

verify-names: Enforces people to be logged in in order to join the server. Highly recommended to leave this on.
admin-slot: Reserve slots for admins (e.g. if the server has 16 player slots, you can reserve 4 of them for admins, so normal players can't join if there's already 12 others)
port: Specify the port of the server to use. Clients can connect to other ports with IP:PORT. Default is always 25565.
public: If set to false, the server will run on the local network. 
server-name: Self explanatory. 
max-players: Player slots for the server. 
physics: Toggles game physics. When disabled, all block ticks are disabled, making it possible for everyone to use water and lava. WARNING: if this gets re-enabled, any water and lava WILL flood the world! Use at your own caution. 
max-connections: Specify the max amount of connections per user. 
motd: Message of the day, the text that displays when players connect to the server.
grow-trees: Toggles saplings growing into trees on and off. 
spawn-protection: Toggles spawn protection. When this is enabled, non-admin players cannot break or place any blocks in a 5x5x5 radius of spawn. Only applies in creative mode
survival-mode: Toggles the level gamemode between creative and survival modes. 
peaceful-mode: Enables peaceful mode on the server (survival only). 
pvp: Toggles pvp (player versus player) combat (survival only).
trees: Enables/disables tree generation when making a new level.
caves: Enables/disables cave generation when making a new level.
beaches: Enables/disables gravel, sand and coral generation when making a new level.
flowers: Enables/disables flower generation when making a new level.
ores: Enables/disables ore generation when making a new level.
liquids: Enables/disables lava and water generation when making a new level.
weather: Toggles dynamic weather on and off when the server is in survival mode. 
aiDisabled: Determines if mob AI is functional or not. 
hostname: If you are running a public server and want people to connect to it with a hostname rather than an IP, set it here. Make sure it is EXACTLY THE SAME as your hostname and WITHOUT the port!!

### FILES ###

You may have noticed the server spewed out some files after the first launch. THESE ARE VERY IMPORTANT! If you remove one, you will have to reconfigure it!
Here's a quick rundown of them: 

server.properties: Main settings file. Controls the aforementioned server settings. 
server.log: A full chatlog of the server since it was started. 
admins.txt: List of admins for the server. Simply add/remove their Minecraft username. 
banned.txt: List of banned users. 
banned-ip.txt: List of users with banned IP's. 
externalurl.txt: If you wish to run your server using an external url, place it here. 
muted.txt: List of users that have been muted from the chat. 
dead.txt: List of users who have been killed in-game (automatically clears when new level is made). Only applicable in survival mode. 
players.txt: Lists all currently connected players.
server_level.dat: The server level file. Servers still use serialized levels that clients read, despite level IO for clients using the NBT format in singleplayer.
server_level.bak: A backup of the server_level.dat file which gets saved along with the .dat file periodically every minute or so. This does not get saved if the server shuts down, in case there's an unexpected crash or power outage which may corrupt the .dat file. 

### COMMANDS ###

Below is a list of commands that admins can use. Some commands can only be used via the console, whilst others only in-game:

/op <name> - Sets the named user as an admin. Admins have purple names in-game. 
/deop <name> - Remvoes the named user from the admin list (if applicable)
/kick <name> - Kicks the named user from the server.
/ban <name> - Bans the named user from connecting to the server indefinitely. 
/banip <name> - Bans the named user's IP from connecting to the server, but they can still connect using a different IP.
/say <message> - Send a text message to everyone in the server. 
/broadcast <message> - Same as /say. 
/whisper <player name> <message> - Sends a direct message to the specified player that only they can see. 
/setspawn - Sets the world spawn. Can only be used in-game. 
/tpd <name> - Teleport to the specified player. 
/tp <first-player> <second-player> - Teleports the first player to the second one. 
/solid - Toggles between placing normal and unbreakable stone. 
/mute <name> - Mutes the specified user from the chat for an indefinite amount of time. 
/generatelvl <type> <size> <theme> - Generates a new server level using the specified level properties. Can only be used through the console. BE WARNED: Upon using this, the server will automatically shut down and needs to be restarted!
/gamemode <gamemode> - Changes server gamemode. Recommended to do it through server.properties instead, as this force closes the server! 
/give <player name> <block id> <count> - Gives the specified player the chosen block (if valid) and count. Note: count must be 99 or below! 
/arrows <player name> <count> - Gives the specified player arrows. Note: amount must be 99 or below!
/score <player name> <amount> - Gives the specified player score. 
/spawn <mob name> - Spawns a mob of the specified type nearby. Note: Humans cannot be spawned in multiplayer! 
/rain - Toggles rain on/off. Can be used even if weather is disabled in server.properties. 
/theme <theme-name or ID> - Changes the current level's theme to the specified value
/peaceful - Toggles peaceful mode on/off. 
/spawn-protection - Toggles spawn protection on/off. 
/physics - Toggles server physics on/off. 
/kill-all - Destroys all living entities except players.
/ai - Toggles all mob AI on the server.  

### FUTURE PLANS ###

Eventually, there are plans to make the server use a proper GUI, along with plugin support for things like Fortress mode, Capture the Flag etc. 

### CHANGELOG ###

v1.0: Initial release
v1.0_01: Sponges can now absorb water/lava when the server physics are set to false.
v1.0.1: Sneaking animation now applies in multiplayer. 
v1.1: Added support for server-side entities.
v1.1.1: Added a new server property for toggling spawn protection on/off. 
v1.2: Gamemode toggle, pvp and peaceful mode, along with full survival-mode support. 
v1.3: Added a heap of new commands and made /verify-names (server authentication) function properly. 
v1.3.1: Fixed meat and armor not being obtainable through the /give command. 
v1.3.2: Fixed /give, /score and /arrows commands kicking admins if not used correct (if no number is inputted)
v1.3.2_01: Fixed Cedar saplings decaying when on grass or dirt. 
v1.3.3: Added new world sizes: Tiny (64x64x64) and Tall (256x256x256)
v1.3.4: Added new blocks from client and some minor fixes. 
v1.3.4_01: Fixed a bug with cedar trees overwriting blocks when growing. 
rev. 20220901: Fixed more issues with crafting and added the AI server property + command. 
rev. 20220904: Added slimes and fixed some armor related issues. 
rev. 20220911: Fixed arrow duping bug and candles decaying in darkness. 
rev. 20220913: Minor bug fixes 
rev. 20220915: Made ginormous worlds usable, fixed slime drops.
rev. 20220920: Added a linux .sh file to start server and fixed spider cobwebs overriding existing blocks. 
rev. 20220922: Added server support for doors, minor fixes 
rev. 20220923: Added support for hostnames 
rev. 20220924: Fixed a door exploit glitch. 
rev. 20231225: Added tables to the server