Search in sources :

Example 6 with ShaderLayer

use of blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer in project ImmersiveEngineering by BluSunrize.

the class ShaderRegistry method registerShader_Item.

/**
	 * Method to register a default implementation of Item Shaders<br>
	 * It is used for the colour and layers of the base shader item
	 * @param name name of the shader
	 * @param rarity Rarity of the shader item
	 * @param colour0 grip colour
	 * @param colour1 base colour
	 * @param colour2 design colour
	 * @return the registered ShaderCase
	 */
public static ShaderCaseItem registerShader_Item(String name, EnumRarity rarity, int colour0, int colour1, int colour2) {
    ArrayList<ShaderLayer> list = new ArrayList();
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shader_0"), colour0));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shader_1"), colour1));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shader_2"), colour2));
    ShaderCaseItem shader = new ShaderCaseItem(list);
    return registerShaderCase(name, shader, rarity);
}
Also used : ShaderLayer(blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 7 with ShaderLayer

use of blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer in project ImmersiveEngineering by BluSunrize.

the class ClientProxy method textureStich.

@SubscribeEvent
public void textureStich(TextureStitchEvent.Pre event) {
    IELogger.info("Stitching Revolver Textures!");
    ((ItemRevolver) IEContent.itemRevolver).stichRevolverTextures(event.getMap());
    for (ShaderRegistry.ShaderRegistryEntry entry : ShaderRegistry.shaderRegistry.values()) for (ShaderCase sCase : entry.getCases()) if (sCase.stitchIntoSheet())
        for (ShaderLayer layer : sCase.getLayers()) if (layer.getTexture() != null)
            ApiUtils.getRegisterSprite(event.getMap(), layer.getTexture());
    for (DrillHeadPerm p : ((ItemDrillhead) IEContent.itemDrillhead).perms) p.sprite = ApiUtils.getRegisterSprite(event.getMap(), p.texture);
    WireType.iconDefaultWire = ApiUtils.getRegisterSprite(event.getMap(), "immersiveengineering:blocks/wire");
    ApiUtils.getRegisterSprite(event.getMap(), "immersiveengineering:blocks/shaders/greyscaleFire");
    for (BulletHandler.IBullet bullet : BulletHandler.registry.values()) for (ResourceLocation rl : bullet.getTextures()) ApiUtils.getRegisterSprite(event.getMap(), rl);
    for (ResourceLocation rl : ModelConveyor.rl_casing) ApiUtils.getRegisterSprite(event.getMap(), rl);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorHandler.textureConveyorColour);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorBasic.texture_off);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorBasic.texture_on);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorDrop.texture_off);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorDrop.texture_on);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorVertical.texture_off);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorVertical.texture_on);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorSplit.texture_off);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorSplit.texture_on);
    ApiUtils.getRegisterSprite(event.getMap(), ConveyorSplit.texture_casing);
    ApiUtils.getRegisterSprite(event.getMap(), IEContent.fluidPotion.getStill());
    ApiUtils.getRegisterSprite(event.getMap(), IEContent.fluidPotion.getFlowing());
    ApiUtils.getRegisterSprite(event.getMap(), "immersiveengineering:items/shader_slot");
}
Also used : ShaderRegistry(blusunrize.immersiveengineering.api.shader.ShaderRegistry) DrillHeadPerm(blusunrize.immersiveengineering.common.items.ItemDrillhead.DrillHeadPerm) BulletHandler(blusunrize.immersiveengineering.api.tool.BulletHandler) ShaderLayer(blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ShaderCase(blusunrize.immersiveengineering.api.shader.ShaderCase) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 8 with ShaderLayer

use of blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer in project ImmersiveEngineering by BluSunrize.

the class ShaderRegistry method registerShader_Drill.

/**
	 * Method to register a default implementation of Drill Shaders<br>
	 * Note that they have an extra layer with null for the ResourceLocation, for the drill head and augers
	 * @param name name of the shader
	 * @param overlayType uses IE's existing overlays. To use custom ones, you'll need your own method.
	 * @param rarity Rarity of the shader item
	 * @param colour0 grip colour
	 * @param colour1 base colour
	 * @param colour2 design colour
	 * @param additionalTexture additional overlay texture. Null if not needed.
	 * @param colourAddtional colour for the additional texture, if present
	 * @return the registered ShaderCase
	 */
public static ShaderCaseDrill registerShader_Drill(String name, String overlayType, EnumRarity rarity, int colour0, int colour1, int colour2, String additionalTexture, int colourAddtional) {
    ArrayList<ShaderLayer> list = new ArrayList();
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/drill_diesel_0"), colour0));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/drill_diesel_0"), colour1));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/drill_diesel_1_" + overlayType), colour2));
    if (additionalTexture != null) {
        ResourceLocation rl = new ResourceLocation("immersiveengineering:items/shaders/drill_diesel_" + additionalTexture);
        list.add(new ShaderLayer(rl, colourAddtional).setTextureBounds(defaultLayerBounds.get(rl)));
    }
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/drill_diesel_uncoloured"), 0xffffffff));
    //final pass is for drill head and augers
    list.add(new ShaderLayer(null, 0xffffffff));
    ShaderCaseDrill shader = new ShaderCaseDrill(list);
    return registerShaderCase(name, shader, rarity);
}
Also used : ShaderLayer(blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 9 with ShaderLayer

use of blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer in project ImmersiveEngineering by BluSunrize.

the class ShaderRegistry method registerShader_Minecart.

/**
	 * Method to register a default implementation of Minecart Shaders
	 * @param name name of the shader
	 * @param overlayType uses IE's existing overlays. To use custom ones, you'll need your own method.
	 * @param rarity Rarity of the shader item
	 * @param colour0 base colour
	 * @param colour1 design colour
	 * @param additionalTexture additional overlay texture. Null if not needed.
	 * @param colourAddtional colour for the additional texture, if present
	 * @return the registered ShaderCase
	 */
public static ShaderCaseMinecart registerShader_Minecart(String name, String overlayType, EnumRarity rarity, int colour0, int colour1, String additionalTexture, int colourAddtional) {
    ArrayList<ShaderLayer> list = new ArrayList();
    //Minecart textures need .png behind them, since they are used for direct binding, not stitching >_>
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:textures/models/shaders/minecart_0.png"), colour0));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:textures/models/shaders/minecart_1_" + overlayType + ".png"), colour1));
    if (additionalTexture != null)
        list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:textures/models/shaders/minecart_" + additionalTexture + ".png"), colourAddtional));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:textures/models/shaders/minecart_uncoloured.png"), 0xffffffff));
    ShaderCaseMinecart shader = new ShaderCaseMinecart(list);
    if (overlayType.equals("1") || overlayType.equals("2") || overlayType.equals("7")) {
        shader.renderSides[1][1] = false;
        shader.renderSides[1][2] = false;
    }
    if (additionalTexture != null) {
        shader.renderSides[2][1] = false;
        shader.renderSides[2][2] = false;
    }
    return registerShaderCase(name, shader, rarity);
}
Also used : ShaderLayer(blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 10 with ShaderLayer

use of blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer in project ImmersiveEngineering by BluSunrize.

the class ShaderRegistry method registerShader_Chemthrower.

/**
	 * Method to register a default implementation of Chemthrower Shaders<br>
	 * @param name name of the shader
	 * @param overlayType uses IE's existing overlays. To use custom ones, you'll need your own method.
	 * @param rarity Rarity of the shader item
	 * @param colour0 grip colour
	 * @param colour1 base colour
	 * @param colour2 design colour
	 * @param additionalTexture additional overlay texture. Null if not needed.
	 * @param colourAddtional colour for the additional texture, if present
	 * @return the registered ShaderCase
	 */
public static ShaderCaseChemthrower registerShader_Chemthrower(String name, String overlayType, EnumRarity rarity, int colour0, int colour1, int colour2, String additionalTexture, int colourAddtional) {
    ArrayList<ShaderLayer> list = new ArrayList();
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/chemthrower_0"), colour0));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/chemthrower_0"), colour1));
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/chemthrower_1_" + overlayType), colour2));
    if (additionalTexture != null) {
        ResourceLocation rl = new ResourceLocation("immersiveengineering:items/shaders/chemthrower_" + additionalTexture);
        list.add(new ShaderLayer(rl, colourAddtional).setTextureBounds(defaultLayerBounds.get(rl)));
    }
    list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:items/shaders/chemthrower_uncoloured"), 0xffffffff));
    ShaderCaseChemthrower shader = new ShaderCaseChemthrower(list);
    return registerShaderCase(name, shader, rarity);
}
Also used : ShaderLayer(blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer) ResourceLocation(net.minecraft.util.ResourceLocation)

Aggregations

ShaderLayer (blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer)11 ResourceLocation (net.minecraft.util.ResourceLocation)10 ShaderCase (blusunrize.immersiveengineering.api.shader.ShaderCase)2 ItemStack (net.minecraft.item.ItemStack)2 ComparableItemStack (blusunrize.immersiveengineering.api.ComparableItemStack)1 ShaderWrapper (blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)1 IShaderItem (blusunrize.immersiveengineering.api.shader.IShaderItem)1 ShaderRegistry (blusunrize.immersiveengineering.api.shader.ShaderRegistry)1 ShaderRegistryEntry (blusunrize.immersiveengineering.api.shader.ShaderRegistry.ShaderRegistryEntry)1 BulletHandler (blusunrize.immersiveengineering.api.tool.BulletHandler)1 ITextureOverride (blusunrize.immersiveengineering.common.items.IEItemInterfaces.ITextureOverride)1 DrillHeadPerm (blusunrize.immersiveengineering.common.items.ItemDrillhead.DrillHeadPerm)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 UnpackedBakedQuad (net.minecraftforge.client.model.pipeline.UnpackedBakedQuad)1 TRSRTransformation (net.minecraftforge.common.model.TRSRTransformation)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1