You can't use direct call to Minecraft class, because it has annotation @SideOnly(Side.CLIENT), meaning that Minecraft class is not packed during compilation with dedicated server, so if you even try to reference it, even if you don't use it on server (with world.isRemote condition), dedicated server will crash with java.lang.classnotfoundexception, because that class don't even exists.
So, you have to call it through SidedProxy.
Something like this:
public class CommonProxy {
public void displayGui(short guiId) {
//NO-OP
}
}
public class ClientProxy extends CommonProxy {
@Override
public void displayGui(short guiId) {
switch(guiId) {
case 0: Minecraft.getMinecraft().displayGuiScreen(new GuiTest()); break;
}
}
}
Edit: Fixed the code, thanks to diesieben07 for pointing to my mistake