Java Code Examples for net.minecraft.client.renderer.texture.TextureMap#registerSprite()

The following examples show how to use net.minecraft.client.renderer.texture.TextureMap#registerSprite() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleOrientedCubeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.sprites = new TextureAtlasSprite[6];
    for (CubeSide cubeSide : CubeSide.values()) {
        String fullPath = String.format("blocks/%s/%s", basePath, cubeSide.name().toLowerCase());
        this.sprites[cubeSide.ordinal()] = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, fullPath));
    }
}
 
Example 2
Source File: CTCubeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.ctSprites = new TextureAtlasSprite[16];
    for (int i = 0; i < 16; i++) {
        this.ctSprites[i] = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/" + basePath + "_" + i));
    }
}
 
Example 3
Source File: ChestRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    String formattedBase = GTValues.MODID + ":blocks/" + basePath;
    this.textures = new TextureAtlasSprite[7];
    this.textures[0] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_bottom"));
    this.textures[1] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_top"));
    this.textures[2] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_side"));
    this.textures[3] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_front"));
    this.textures[4] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/cap_bottom"));
    this.textures[5] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/cap_top"));
    this.textures[6] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/lock"));
}
 
Example 4
Source File: LargeTurbineRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.baseRingSprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/multiblock/large_turbine/base_ring"));
    this.baseBackgroundSprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/multiblock/large_turbine/base_bg"));
    this.idleBladeSprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/multiblock/large_turbine/rotor_idle"));
    this.activeBladeSprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/multiblock/large_turbine/rotor_spinning"));
}
 
Example 5
Source File: SafeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    String formattedBase = GTValues.MODID + ":blocks/" + basePath;
    this.textures = new TextureAtlasSprite[7];
    this.textures[0] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_bottom"));
    this.textures[1] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_top"));
    this.textures[2] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_side"));
    this.textures[3] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/base_front"));

    this.textures[4] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/door_side"));
    this.textures[5] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/door_back"));
    this.textures[6] = textureMap.registerSprite(new ResourceLocation(formattedBase + "/door_front"));
}
 
Example 6
Source File: OrientedOverlayRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.sprites = new HashMap<>();
    for (OverlayFace overlayFace : faces) {
        String faceName = overlayFace.name().toLowerCase();
        ResourceLocation normalLocation = new ResourceLocation(GTValues.MODID, String.format("blocks/%s/overlay_%s", basePath, faceName));
        ResourceLocation activeLocation = new ResourceLocation(GTValues.MODID, String.format("blocks/%s/overlay_%s_active", basePath, faceName));
        TextureAtlasSprite normalSprite = textureMap.registerSprite(normalLocation);
        TextureAtlasSprite activeSprite = textureMap.registerSprite(activeLocation);
        sprites.put(overlayFace, new ActivePredicate(normalSprite, activeSprite));
    }
}
 
Example 7
Source File: InvPipeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void registerIcons(TextureMap map) {
    this.jointTextureSprite = map.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/inv_pipe/joint"));
    this.pipeTextureSprite = map.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/inv_pipe/pipe"));

    InventoryPipeType pipeType = InventoryPipeType.NORMAL;
    float thickness = pipeType.getThickness();
    double height = (1.0f - thickness) / 2.0f;
    CCModel connectionModel = ShapeModelGenerator.generateModel(3, height, thickness / 3.0f, height);
    CCModel fullBlockModel = ShapeModelGenerator.generateModel(3, 1.0f, thickness / 3.0f, height);

    this.fullBlockVariants = ShapeModelGenerator.generateFullBlockVariants(fullBlockModel);
    this.connectionModels = ShapeModelGenerator.generateRotatedVariants(connectionModel);
}
 
Example 8
Source File: CableRenderer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void registerIcons(TextureMap map) {
    GTLog.logger.info("Registering cable textures.");
    ResourceLocation wireLocation = new ResourceLocation(GTValues.MODID, "blocks/cable/wire");
    this.wireTexture = map.registerSprite(wireLocation);
    for (int i = 0; i < insulationTextures.length; i++) {
        ResourceLocation location = new ResourceLocation(GTValues.MODID, "blocks/cable/insulation_" + i);
        this.insulationTextures[i] = map.registerSprite(location);
    }
}
 
Example 9
Source File: SimpleCubeRenderer.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.sprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/" + basePath));
}
 
Example 10
Source File: SimpleOverlayRenderer.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(TextureMap textureMap) {
    this.sprite = textureMap.registerSprite(new ResourceLocation(GTValues.MODID, "blocks/" + basePath));
}
 
Example 11
Source File: MetaFluids.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void registerSprites(TextureMap textureMap) {
    for (ResourceLocation spriteLocation : fluidSprites) {
        textureMap.registerSprite(spriteLocation);
    }
}