[1.8.1 Mod Creation] How to make Multi-Textured blocks!
4 posters
Page 1 of 1
[1.8.1 Mod Creation] How to make Multi-Textured blocks!
ok this goes into ChargeBlock.java
This goes into mod_ChargeBlock:
- Code:
package net.minecraft.src;
import java.util.Random;
public class ChargeBlock extends Block
{
// Top texture will be the same for bottom.
private int topTexture = ModLoader.addOverride( "/terrain.png", "/chargetop.png");
private int sideTexture = ModLoader.addOverride( "/terrain.png", "/chargeside.png");
private int frontOn = ModLoader.addOverride( "/terrain.png", "/chargefronton.png");
private int FrontOff = ModLoader.addOverride( "/terrain.png", "/chargefrontoff.png");
protected ChargeBlock(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSide(int i)
{
if(i == 0 || i == 1) // 0 is the bottom texture, 1 is the top
return topTexture; // in theory, the ModLoader.addOverride will work here, but having separate variables for them is much neater.
else
if(i == 1 || i == 2)
return frontOn;
else
return sideTexture;
}
}
This goes into mod_ChargeBlock:
- Code:
package net.minecraft.src;
import java.util.Random;
public class mod_ChargeBlock extends BaseMod
{
public static final Block chargeBlock = new ChargeBlock(197,0).setHardness(0.0F).setResistance(5.0F).setLightValue(1.0F).setBlockName("asdf");
public mod_ChargeBlock()
{
ModLoader.RegisterBlock(chargeBlock);
ModLoader.AddName(chargeBlock, "chargeBlock");
ModLoader.AddRecipe(new ItemStack(chargeBlock, 10), new Object[] {
" * ", Character.valueOf('*'), Block.dirt
});
}
public String Version()
{
return "1.8.1";
}
}
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: [1.8.1 Mod Creation] How to make Multi-Textured blocks!
Please, explain it. Don't just copy/paste.
Re: [1.8.1 Mod Creation] How to make Multi-Textured blocks!
Its very simple really just read it don't post a comment without reading it full detail.
This how the furnace does it. What do you think private int toptextue means.
This how the furnace does it. What do you think private int toptextue means.
Re: [1.8.1 Mod Creation] How to make Multi-Textured blocks!
Lol hmmmm idk? xD
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: [1.8.1 Mod Creation] How to make Multi-Textured blocks!
here austin the code is here for it I will send a link to it its more simple and you only need to put it into the namhere.class you then edit the textures it works the same as yours
- Code:
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 1)
{
return blockIndexInTexture + 17;
}
if(l == 0)
{
return blockIndexInTexture + 17;
}
int i1 = iblockaccess.getBlockMetadata(i, j, k);
if(l != i1)
{
return blockIndexInTexture;
}
if(isActive)
{
return blockIndexInTexture + 16;
} else
{
return blockIndexInTexture - 1;
}
}
- Code:
public int getBlockTextureFromSide(int i)
{
if(i == 1)
{
return blockIndexInTexture + 17;
}
if(i == 0)
{
return blockIndexInTexture + 17;
}
if(i == 3)
{
return blockIndexInTexture - 1;
} else
{
return blockIndexInTexture;
}
}
Re: [1.8.1 Mod Creation] How to make Multi-Textured blocks!
How would I make this with MineForge? [Reading it from a spritesheet rather than a .addOverride]
msw1- Member
- Posts : 8
Join date : 2011-11-01
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Similar topics
» [1.2.5] How Do I Add Blocks
» How to make fuel
» How do i make a bow? [UNANSWERED]
» How to make a new block that has a gui simply
» [SSP Modding For 1.0.0] How To Make An Item For 1.0.0
» How to make fuel
» How do i make a bow? [UNANSWERED]
» How to make a new block that has a gui simply
» [SSP Modding For 1.0.0] How To Make An Item For 1.0.0
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum