Search in sources :

Example 1 with ColourMapProducer

use of com.microsoft.Malmo.Schemas.ColourMapProducer in project malmo by Microsoft.

the class ColourMapProducerImplementation method parseParameters.

@Override
public boolean parseParameters(Object params) {
    MinecraftForge.EVENT_BUS.register(this);
    if (params == null || !(params instanceof ColourMapProducer))
        return false;
    this.cmParams = (ColourMapProducer) params;
    for (MobWithColour mob : this.cmParams.getColourSpec()) {
        byte[] col = mob.getColour();
        int c = (col[2] & 0xff) + ((col[1] & 0xff) << 8) + ((col[0] & 0xff) << 16);
        for (EntityTypes ent : mob.getType()) {
            String mobName = ent.value();
            this.mobColours.put(mobName, c);
        }
    }
    miscColours.put("textures/environment/sun.png", 0xffff00);
    miscColours.put("textures/environment/moon_phases.png", 0xffffff);
    return true;
}
Also used : EntityTypes(com.microsoft.Malmo.Schemas.EntityTypes) ColourMapProducer(com.microsoft.Malmo.Schemas.ColourMapProducer) MobWithColour(com.microsoft.Malmo.Schemas.MobWithColour)

Aggregations

ColourMapProducer (com.microsoft.Malmo.Schemas.ColourMapProducer)1 EntityTypes (com.microsoft.Malmo.Schemas.EntityTypes)1 MobWithColour (com.microsoft.Malmo.Schemas.MobWithColour)1