Search in sources :

Example 1 with AtlasSpriteFluid

use of buildcraft.energy.client.sprite.AtlasSpriteFluid in project BuildCraft by BuildCraft.

the class BCEnergySprites method onTextureStitchPre.

@SubscribeEvent
public static void onTextureStitchPre(TextureStitchEvent.Pre event) {
    TextureMap map = event.getMap();
    ResourceLocation[][] fromSprites = new ResourceLocation[3][2];
    for (int h = 0; h < 3; h++) {
        fromSprites[h][0] = new ResourceLocation("buildcraftenergy:blocks/fluids/heat_" + h + "_still");
        fromSprites[h][1] = new ResourceLocation("buildcraftenergy:blocks/fluids/heat_" + h + "_flow");
    }
    for (BCFluid f : BCEnergyFluids.allFluids) {
        AtlasSpriteFluid spriteStill = new AtlasSpriteFluid(f.getStill().toString(), fromSprites[f.getHeatValue()][0], f);
        AtlasSpriteFluid spriteFlow = new AtlasSpriteFluid(f.getFlowing().toString(), fromSprites[f.getHeatValue()][1], f);
        map.setTextureEntry(spriteStill);
        map.setTextureEntry(spriteFlow);
    }
}
Also used : TextureMap(net.minecraft.client.renderer.texture.TextureMap) BCFluid(buildcraft.lib.fluid.BCFluid) AtlasSpriteFluid(buildcraft.energy.client.sprite.AtlasSpriteFluid) ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

AtlasSpriteFluid (buildcraft.energy.client.sprite.AtlasSpriteFluid)1 BCFluid (buildcraft.lib.fluid.BCFluid)1 TextureMap (net.minecraft.client.renderer.texture.TextureMap)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1