Jump to content

Recommended Posts

Posted

Hello,

Yesterday I tried to make a tank block, just like Thaumcraft and Buildcraft, but while coding I hit a roadblock. Had to use the Water Texture FX (ID: 205 from the "/terrain.png") and also Textures from my one sprite, I there any way to make this happen? and if so how, I would really appreciate it.

  :)

Posted

Yes typically, unless you do a custom renderer, the simplest solution is to write a TextureFX that will copy a texture from one sprite sheet to another.

It's fairly easy to do, just need to look into it.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I do use a custom renderer for my block but the renderer still uses my one Sprite, Can you please help me making my one TextureFX, I would really appreciate it  :):

 

package mtm.src.render;

 

import net.minecraft.src.Block;

import net.minecraft.src.IBlockAccess;

import net.minecraft.src.RenderBlocks;

import net.minecraft.src.Tessellator;

import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;

import cpw.mods.fml.client.registry.RenderingRegistry;

 

public class MTMTankRenderer implements ISimpleBlockRenderingHandler

{

public static final int MTMTankRenderID = RenderingRegistry.getNextAvailableRenderId();

 

@Override

public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)

{

}

 

@Override

public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int renderType, RenderBlocks renderBlock)

{

Tessellator tessellator = Tessellator.instance;

 

if(renderType == MTMTankRenderID)

{

float metaData = world.getBlockMetadata(x, y, z);

float fluidHeight = (metaData / 4) + (y - 1);

 

//renderBlock.clearOverrideBlockTexture();

//renderBlock.renderStandardBlock(block, x, y, z);

 

//Water

renderBlock.renderBottomFace(block, x, fluidHeight, z, Block.waterStill.blockIndexInTexture);

renderBlock.renderTopFace(block, x, fluidHeight, z, Block.waterStill.blockIndexInTexture);

renderBlock.renderEastFace(block, x, fluidHeight, z + 0.06F, Block.waterStill.blockIndexInTexture);

renderBlock.renderWestFace(block, x, fluidHeight, z - 0.06F, Block.waterStill.blockIndexInTexture);

renderBlock.renderNorthFace(block, x + 0.06F, fluidHeight, z, Block.waterStill.blockIndexInTexture);

renderBlock.renderSouthFace(block, x - 0.06F, fluidHeight, z, Block.waterStill.blockIndexInTexture);

 

renderBlock.renderBottomFace(block, x, y, z, block.getBlockTextureFromSide(0));

renderBlock.renderTopFace(block, x, y, z, block.getBlockTextureFromSide(1));

renderBlock.renderEastFace(block, x, y, z, block.getBlockTextureFromSide(2));

renderBlock.renderWestFace(block, x, y, z, block.getBlockTextureFromSide(3));

renderBlock.renderNorthFace(block, x, y, z, block.getBlockTextureFromSide(4));

renderBlock.renderSouthFace(block, x, y, z, block.getBlockTextureFromSide(5 ));

}

 

return true;

}

 

@Override

public boolean shouldRender3DInInventory()

{

return false;

}

 

@Override

public int getRenderId()

{

return MTMTankRenderID;

}

}

 

 

Posted
:-[ I'm so sorry that I keep bothering you but how do you mean,
switch your textures
and how can you create your one TextureFX's. I have searched the whole forum for this but I keep finding, use ModLoader, use Optifine, use Forge, use MCPather etz. I would really like a clear explaination from somebody. I would reallry like that.  :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.