Saturday, 15 February 2014

Making the WebAPI use camelCase

The following code can be added to the WebApiApplication to format the JSON in camelCase:
protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters);
        }

The code below adds a camelCase formatter and also a JSONP formatter. You need to Install-Package WebApiContrib.Formatting.Jsonp

public class FormatterConfig
    {
        public static void RegisterFormatters(MediaTypeFormatterCollection formatters)
        {
            var index = formatters.IndexOf(formatters.JsonFormatter);
            formatters[index] = new JsonMediaTypeFormatter
            {
                SerializerSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }
            };


            // Insert the JSONP formatter in front of the standard JSON formatter.
            var jsonpFormatter = new JsonpMediaTypeFormatter(formatters.JsonFormatter);
            formatters.Insert(0, jsonpFormatter);
        }
    }

Sunday, 2 February 2014

Minecraft content mods

Client Mods
Download MultiMC.
Create a new instance.
Select Edit Mods and select the Minecraft.jar tab.
Click on MCForge and select the appropriate version.

Server Mods
HomeSpawnPlus
Lockette
Multiverse-Core
PermissionsBukkit

Saturday, 1 February 2014

Minecraft server - Too Many Items

TooManyItems is a client-side mod - it doesn't work on your multiplayer server. For this to work you need to use the command give <playername> <item number> <quantity>.

Multiverse is used to manage multiple worlds on the server.