Search in sources :

Example 1 with EnumRobotStationState

use of buildcraft.robotics.RobotStationPluggable.EnumRobotStationState in project BuildCraft by BuildCraft.

the class RobotStationModel method textureStitchPost.

@SubscribeEvent
public void textureStitchPost(TextureStitchEvent.Post post) {
    for (final EnumRobotStationState state : EnumRobotStationState.values()) {
        Matrix4f translation = new Matrix4f();
        translation.setIdentity();
        translation.setTranslation(new Vector3f(2.8f / 16f, 0, 0));
        List<MutableQuad> quads = Lists.newArrayList();
        for (MutableQuad mutable : BuildCraftBakedModel.createQuadsItemLayer(stateSprites.get(state))) {
            mutable.transform(translation);
            mutable.colouri(0xFF_FF_FF_FF);
            quads.add(mutable);
        }
        stateQuads.put(state, quads);
    }
}
Also used : Matrix4f(javax.vecmath.Matrix4f) Vector3f(javax.vecmath.Vector3f) EnumRobotStationState(buildcraft.robotics.RobotStationPluggable.EnumRobotStationState) MutableQuad(buildcraft.lib.client.model.MutableQuad) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with EnumRobotStationState

use of buildcraft.robotics.RobotStationPluggable.EnumRobotStationState in project BuildCraft by BuildCraft.

the class RobotStationModel method textureStitchPre.

@SubscribeEvent
public void textureStitchPre(TextureStitchEvent.Pre pre) {
    TextureMap map = pre.map;
    baseSprite = null;
    baseSprite = map.getTextureExtry("buildcraftrobotics:station/base");
    if (baseSprite == null)
        baseSprite = map.registerSprite(new ResourceLocation("buildcraftrobotics:station/base"));
    for (final EnumRobotStationState state : EnumRobotStationState.values()) {
        String suffix = state.getTextureSuffix() + (BuildCraftCore.colorBlindMode ? "_cb" : "");
        ResourceLocation location = new ResourceLocation("buildcraftrobotics:station/state_" + suffix);
        TextureAtlasSprite sprite = map.getTextureExtry(location.toString());
        if (sprite == null)
            sprite = map.registerSprite(location);
        stateSprites.put(state, sprite);
    }
}
Also used : TextureMap(net.minecraft.client.renderer.texture.TextureMap) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) ResourceLocation(net.minecraft.util.ResourceLocation) EnumRobotStationState(buildcraft.robotics.RobotStationPluggable.EnumRobotStationState) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EnumRobotStationState (buildcraft.robotics.RobotStationPluggable.EnumRobotStationState)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 MutableQuad (buildcraft.lib.client.model.MutableQuad)1 Matrix4f (javax.vecmath.Matrix4f)1 Vector3f (javax.vecmath.Vector3f)1 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)1 TextureMap (net.minecraft.client.renderer.texture.TextureMap)1 ResourceLocation (net.minecraft.util.ResourceLocation)1