Bukkit/CraftBukkit — pull request #505 by escortkeel (2011-10-12 05:27:37+00:00)
Title: ConsoleReader Declaration Modification - For Bukkit Wrappers

I have modified the statement which initializes the ConsoleReader object in the MinecraftServer class constructor.

The change allows developers to write Java Wrappers for CraftBukkit which control the commands (though System.in) CraftBukkit receives.

The reason this wasn't possible before was because the default ConsoleReader() constructor which is used in the current MinecraftServer class (the ConsoleReader is used in reading-in the commands) uses System.out as the OutputStream (that's fine) but it uses FileDescriptor.in as the input stream. While System.out is configurable using System.setOut(), FileDesctiptor.in is not. Please note, System.in is just a pointer to FileDesctiptor.in but it IS configurable using System.setIn().

This should have no performance effects and should make it much easier for Bukkit Wrapper developers to create effective Java applications.

Awaiting the community's response,
Keeley Hoek (escortkeel)