use of net.minecraft.client.renderer.texture.TextureMap 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);
}
}
use of net.minecraft.client.renderer.texture.TextureMap in project GregTech by GregTechCE.
the class MetaTileEntityRenderer method renderBlock.
@Override
public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) {
MetaTileEntity metaTileEntity = BlockMachine.getMetaTileEntity(world, pos);
if (metaTileEntity == null) {
return false;
}
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.bind(buffer);
Matrix4 translation = new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ());
BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer();
if (metaTileEntity.canRenderInLayer(renderLayer)) {
renderState.lightMatrix.locate(world, pos);
IVertexOperation[] pipeline = new IVertexOperation[] { renderState.lightMatrix };
metaTileEntity.renderMetaTileEntity(renderState, translation.copy(), pipeline);
}
Matrix4 coverTranslation = new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ());
metaTileEntity.renderCovers(renderState, coverTranslation, renderLayer);
if (metaTileEntity.isFragile() && renderLayer == BlockRenderLayer.CUTOUT) {
TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
Random posRand = new Random(MathHelper.getPositionRandom(pos));
int destroyStage = posRand.nextInt(10);
TextureAtlasSprite atlasSprite = textureMap.getAtlasSprite("minecraft:blocks/destroy_stage_" + destroyStage);
for (EnumFacing face : EnumFacing.VALUES) {
Textures.renderFace(renderState, translation, new IVertexOperation[0], face, Cuboid6.full, atlasSprite);
}
}
return true;
}
use of net.minecraft.client.renderer.texture.TextureMap in project GregTech by GregTechCE.
the class ToolRenderHandler method updateDestroyBlockIcons.
private void updateDestroyBlockIcons() {
Minecraft mc = Minecraft.getMinecraft();
TextureMap texturemap = mc.getTextureMapBlocks();
for (int i = 0; i < destroyBlockIcons.length; ++i) {
this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i);
}
}
use of net.minecraft.client.renderer.texture.TextureMap in project Gaia-Dimension by Andromander.
the class ClientEvents method textureStitch.
@SubscribeEvent
public static void textureStitch(TextureStitchEvent.Pre e) {
TextureMap map = e.getMap();
map.registerSprite(new ResourceLocation(GaiaDimension.MODID, "particle/yellow_fire"));
map.registerSprite(new ResourceLocation(GaiaDimension.MODID, "particle/green_fire"));
map.registerSprite(new ResourceLocation(GaiaDimension.MODID, "particle/portal_sparkle"));
}
use of net.minecraft.client.renderer.texture.TextureMap in project ForestryMC by ForestryMC.
the class ItemHabitatLocator method registerIcons.
/* TEXTURES */
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister register) {
if (register instanceof TextureMap) {
TextureAtlasSprite texture = new TextureHabitatLocator(iconName);
((TextureMap) register).setTextureEntry(iconName, texture);
itemIcon = texture;
}
}
Aggregations