So, I came from the post you made on my topic, and I'm still unsure where to paste it. I read it, but I'm kinda afraid I might **** up my code...
Here is my code:
BlockBurner.java
package net.minecraft.src;
import java.util.Random;
public class BlockBurner extends Block
{
public BlockBurner(int i, int j, boolean flag)
{
super(i, Material.rock);
blockIndexInTexture = j;
}
public int idDropped(int i, Random random)
{
return mod_Burner.Burner.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(world.isBlockIndirectlyGettingPowered(i, j, k))
{
world.setBlockWithNotify(i, j + 1, k, Block.fire.blockID);
} else
{
world.setBlockWithNotify(i, j + 1, k, 0);
}
}
}
mod_Burner.java
package net.minecraft.src;
public class mod_Burner extends BaseMod
{
public static Block Burner;
public mod_Burner()
{
ModLoader.AddName(Burner, "Burner");
ModLoader.RegisterBlock(Burner);
}
public String Version()
{
return "1.9.5";
}
static
{
Burner = (new BlockBurner(233, ModLoader.addOverride("/terrain.png", "/Burner.png"), false)).setHardness(2.0F).setBlockName("Burner");
ModLoader.AddRecipe(new ItemStack(Burner, 1), new Object[] {
"###", "YXY", "YYY", Character.valueOf('#'), Block.netherrack, Character.valueOf('X'), Item.redstone, Character.valueOf('Y'), Block.cobblestone
});
}
}
Sorry for a late reply.
What I reccomend is backing these up in a seperate folder and then trying out the tutorial, even if some parts seem fuzzy; I can only really help you once you get errors. (or if your either really good or really lucky you managed to get it working first time, then good job :biggrin.gif:)
Can you just real fast, tell me how I could add my own textures to a custom furnace I've made? Having lots of trouble, and my experimenting won't work. Thanks for any help!
Rollback Post to RevisionRollBack
This isn't my signature, I just type this on every single post I make. ~Or1g1n
This is how fire's texture is loaded to render an entity on fire. This function is in Render.java. The parts I think you might need are:
int i = Block.fire.blockIndexInTexture;
This gets the specific texture index.
loadTexture("/terrain.png");
can be changed to:
bindTextureByName("/terrain.png");
and this should load terrain.png. (or w/e spritesheet your using)
However I have not experimented with this and thus I can't say exactly how this would work, I mgiht be wrong, but I am pretty sure this function should help in the right direction.
EDIT: One that is potentially less confusing is RenderSnowball:
This is the entire thing. As you see it loads from "items.png", and uses an iconIndex set in the constructor to say what the index is to render from. (both eggs and snowballs use this, I think Eye of Enders do too)
Can you just real fast, tell me how I could add my own textures to a custom furnace I've made? Having lots of trouble, and my experimenting won't work. Thanks for any help!
Post your block and mod_ file and I will see what the problem is.
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// BlockContainer, Material, Block, World,
// IBlockAccess, TileEntityFurnace, EntityPlayer, TileEntity,
// EntityLiving, MathHelper, IInventory, ItemStack,
// EntityItem
public class BlockForge extends BlockContainer
{
protected BlockForge(int i, boolean flag)
{
super(i, Material.rock);
ForgeRand = new Random();
isActive = flag;
blockIndexInTexture = 45;
}
public int idDropped(int i, Random random)
{
return Block.stoneOvenIdle.blockID;
}
public void onBlockAdded(World world, int i, int j, int k)
{
super.onBlockAdded(world, i, j, k);
setDefaultDirection(world, i, j, k);
}
private void setDefaultDirection(World world, int i, int j, int k)
{
if(world.multiplayerWorld)
{
return;
}
int l = world.getBlockId(i, j, k - 1);
int i1 = world.getBlockId(i, j, k + 1);
int j1 = world.getBlockId(i - 1, j, k);
int k1 = world.getBlockId(i + 1, j, k);
byte byte0 = 3;
if(Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])
{
byte0 = 3;
}
if(Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])
{
byte0 = 2;
}
if(Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])
{
byte0 = 5;
}
if(Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])
{
byte0 = 4;
}
world.setBlockMetadataWithNotify(i, j, k, byte0);
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
private int topTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeTop.png");
private int sideTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeSide.png");
private int frontOn = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront2.png");
private int FrontOff = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront1.png");
}
public void randomDisplayTick(World world, int i, int j, int k, Random random)
{
if(!isActive)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
float f = (float)i + 0.5F;
float f1 = (float)j + 0.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float)k + 0.5F;
float f3 = 0.52F;
float f4 = random.nextFloat() * 0.6F - 0.3F;
if(l == 4)
{
world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 5)
{
world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 2)
{
world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} else
if(l == 3)
{
world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
public int getBlockTextureFromSide(int i)
{
if(i == 0 || i == 1)
return topTexture;
else
if(i == 1 || i == 2)
return frontOn;
else
return sideTexture;
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return true;
}
TileEntityForge tileentityForge = (TileEntityForge)world.getBlockTileEntity(i, j, k);
if(tileentityForge != null)
{
ModLoader.OpenGui(entityplayer, new GuiForge(entityplayer.inventory, tileentityForge));
}
return true;
}
public static void updateForgeBlockState(boolean flag, World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
TileEntity tileentity = world.getBlockTileEntity(i, j, k);
keepForgeInventory = true;
if(flag)
{
world.setBlockWithNotify(i, j, k, Block.stoneOvenActive.blockID);
} else
{
world.setBlockWithNotify(i, j, k, Block.stoneOvenIdle.blockID);
}
keepForgeInventory = false;
world.setBlockMetadataWithNotify(i, j, k, l);
if(tileentity != null)
{
tileentity.validate();
world.setBlockTileEntity(i, j, k, tileentity);
}
}
public TileEntity getBlockEntity()
{
return new TileEntityForge();
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if(l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
if(l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 5);
}
if(l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
if(l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 4);
}
}
public void onBlockRemoval(World world, int i, int j, int k)
{
if(!keepForgeInventory)
{
TileEntityForge tileentityForge = (TileEntityForge)world.getBlockTileEntity(i, j, k);
if(tileentityForge != null)
{
label0:
for(int l = 0; l < tileentityForge.getSizeInventory(); l++)
{
ItemStack itemstack = tileentityForge.getStackInSlot(l);
if(itemstack == null)
{
continue;
}
float f = ForgeRand.nextFloat() * 0.8F + 0.1F;
float f1 = ForgeRand.nextFloat() * 0.8F + 0.1F;
float f2 = ForgeRand.nextFloat() * 0.8F + 0.1F;
do
{
if(itemstack.stackSize <= 0)
{
continue label0;
}
int i1 = ForgeRand.nextInt(21) + 10;
if(i1 > itemstack.stackSize)
{
i1 = itemstack.stackSize;
}
itemstack.stackSize -= i1;
EntityItem entityitem = new EntityItem(world, (float)i + f, (float)j + f1, (float)k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)ForgeRand.nextGaussian() * f3;
entityitem.motionY = (float)ForgeRand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)ForgeRand.nextGaussian() * f3;
world.entityJoinedWorld(entityitem);
} while(true);
}
}
}
super.onBlockRemoval(world, i, j, k);
}
private Random ForgeRand;
private final boolean isActive;
private static boolean keepForgeInventory = false;
}
And my Mod_XXX:
package net.minecraft.src;
import java.util.Random;
public class mod_Forge extends BaseMod
{
public static final Block Forge = new Forge(114,0).setHardness(10.0F).setResistance(5.0F).setLightValue(1.0F).setBlockName("Forge");
public mod_Forge()
{
ModLoader.RegisterBlock(Forge);
ModLoader.AddName(Forge, "Forge");
ModLoader.AddRecipe(new ItemStack(Forge, 1), new Object[] {
"XXX", "XXX", "ZZZ" Character.valueOf('X'), Item.ingotGold, Character.valueOf('Z'), Block.Obsidian
});
}
public int idDropped(int i, Random random)
{
return Block.Forge.blockID;
}
public String Version()
{
return "1.8.1";
}
}
Thanks for any help you can give! :smile.gif:
Rollback Post to RevisionRollBack
My YouTube Channel, Working really hard on getting some MC videos going on it. Subscribe!
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// BlockContainer, Material, Block, World,
// IBlockAccess, TileEntityFurnace, EntityPlayer, TileEntity,
// EntityLiving, MathHelper, IInventory, ItemStack,
// EntityItem
public class BlockForge extends BlockContainer
{
protected BlockForge(int i, boolean flag)
{
super(i, Material.rock);
ForgeRand = new Random();
isActive = flag;
blockIndexInTexture = 45;
}
public int idDropped(int i, Random random)
{
return Block.stoneOvenIdle.blockID;
}
public void onBlockAdded(World world, int i, int j, int k)
{
super.onBlockAdded(world, i, j, k);
setDefaultDirection(world, i, j, k);
}
private void setDefaultDirection(World world, int i, int j, int k)
{
if(world.multiplayerWorld)
{
return;
}
int l = world.getBlockId(i, j, k - 1);
int i1 = world.getBlockId(i, j, k + 1);
int j1 = world.getBlockId(i - 1, j, k);
int k1 = world.getBlockId(i + 1, j, k);
byte byte0 = 3;
if(Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])
{
byte0 = 3;
}
if(Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])
{
byte0 = 2;
}
if(Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])
{
byte0 = 5;
}
if(Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])
{
byte0 = 4;
}
world.setBlockMetadataWithNotify(i, j, k, byte0);
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
private int topTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeTop.png");
private int sideTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeSide.png");
private int frontOn = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront2.png");
private int FrontOff = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront1.png");
}
public void randomDisplayTick(World world, int i, int j, int k, Random random)
{
if(!isActive)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
float f = (float)i + 0.5F;
float f1 = (float)j + 0.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float)k + 0.5F;
float f3 = 0.52F;
float f4 = random.nextFloat() * 0.6F - 0.3F;
if(l == 4)
{
world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 5)
{
world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 2)
{
world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} else
if(l == 3)
{
world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
public int getBlockTextureFromSide(int i)
{
if(i == 0 || i == 1)
return topTexture;
else
if(i == 1 || i == 2)
return frontOn;
else
return sideTexture;
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return true;
}
TileEntityForge tileentityForge = (TileEntityForge)world.getBlockTileEntity(i, j, k);
if(tileentityForge != null)
{
ModLoader.OpenGui(entityplayer, new GuiForge(entityplayer.inventory, tileentityForge));
}
return true;
}
public static void updateForgeBlockState(boolean flag, World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
TileEntity tileentity = world.getBlockTileEntity(i, j, k);
keepForgeInventory = true;
if(flag)
{
world.setBlockWithNotify(i, j, k, Block.stoneOvenActive.blockID);
} else
{
world.setBlockWithNotify(i, j, k, Block.stoneOvenIdle.blockID);
}
keepForgeInventory = false;
world.setBlockMetadataWithNotify(i, j, k, l);
if(tileentity != null)
{
tileentity.validate();
world.setBlockTileEntity(i, j, k, tileentity);
}
}
public TileEntity getBlockEntity()
{
return new TileEntityForge();
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if(l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
if(l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 5);
}
if(l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
if(l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 4);
}
}
public void onBlockRemoval(World world, int i, int j, int k)
{
if(!keepForgeInventory)
{
TileEntityForge tileentityForge = (TileEntityForge)world.getBlockTileEntity(i, j, k);
if(tileentityForge != null)
{
label0:
for(int l = 0; l < tileentityForge.getSizeInventory(); l++)
{
ItemStack itemstack = tileentityForge.getStackInSlot(l);
if(itemstack == null)
{
continue;
}
float f = ForgeRand.nextFloat() * 0.8F + 0.1F;
float f1 = ForgeRand.nextFloat() * 0.8F + 0.1F;
float f2 = ForgeRand.nextFloat() * 0.8F + 0.1F;
do
{
if(itemstack.stackSize <= 0)
{
continue label0;
}
int i1 = ForgeRand.nextInt(21) + 10;
if(i1 > itemstack.stackSize)
{
i1 = itemstack.stackSize;
}
itemstack.stackSize -= i1;
EntityItem entityitem = new EntityItem(world, (float)i + f, (float)j + f1, (float)k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)ForgeRand.nextGaussian() * f3;
entityitem.motionY = (float)ForgeRand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)ForgeRand.nextGaussian() * f3;
world.entityJoinedWorld(entityitem);
} while(true);
}
}
}
super.onBlockRemoval(world, i, j, k);
}
private Random ForgeRand;
private final boolean isActive;
private static boolean keepForgeInventory = false;
}
And my Mod_XXX:
package net.minecraft.src;
import java.util.Random;
public class mod_Forge extends BaseMod
{
public static final Block Forge = new Forge(114,0).setHardness(10.0F).setResistance(5.0F).setLightValue(1.0F).setBlockName("Forge");
public mod_Forge()
{
ModLoader.RegisterBlock(Forge);
ModLoader.AddName(Forge, "Forge");
ModLoader.AddRecipe(new ItemStack(Forge, 1), new Object[] {
"XXX", "XXX", "ZZZ" Character.valueOf('X'), Item.ingotGold, Character.valueOf('Z'), Block.Obsidian
});
}
public int idDropped(int i, Random random)
{
return Block.Forge.blockID;
}
public String Version()
{
return "1.8.1";
}
}
Thanks for any help you can give! :smile.gif:
Well this has two problems, the first being you defined the variables in a function, and second is you use two texture functions.
This part of your code:
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
private int topTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeTop.png");
private int sideTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeSide.png");
private int frontOn = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront2.png");
private int FrontOff = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront1.png");
}
public int getBlockTextureFromSide(int i)
{
if(i == 0 || i == 1)
return topTexture;
else
if(i == 1 || i == 2)
return frontOn;
else
return sideTexture;
}
Can be changed to:
public int getBlockTextureFromSide(int i)
{
if(i == 0 || i == 1)
{
return topTexture;
}
if((i == 1 || i == 2) && isActive)
{
return frontOn;
}
if((i == 1 || i == 2) && !isActive)
{
return frontOff;
}
return sideTexture;
}
private int topTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeTop.png");
private int sideTexture = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeSide.png");
private int frontOn = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront2.png");
private int frontOff = ModLoader.addOverride( "/terrain.png", "/Blocks/ForgeFront1.png");
This will both fix your problem and I added in an extra if statement; now both return a texture based on activity; if isActive is true, return the On texture. If not, return the Off texture.
I am trying to make a block with a custom model. It sort of works but there are some problems:
In my model class, in the render method it doesnt say aPart.render or anotherPart.render it just says light.render so in the renderModel method, when I put aPart.render and anotherPart.render it doesnt work. (light is the name of my model)
I kind of fixed that by just putting light.render in the renderModel method.
My other error is that when I destroy my block, if quantityDropped is greater than one then the crashes when I destroy the block.
package net.minecraft.src;
import java.util.Random;
public class BlockLight extends BlockContainer
{
public BlockLight(int i, int j, boolean lit, Class class1)
{
super(i, j, Material.circuits);
anEntityClass = class1;
}
public int idDropped(int i, Random random)
{
return mod_Tools.itemlight.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return -1;
}
public TileEntity getBlockEntity()
{
try
{
return (TileEntity)anEntityClass.newInstance();
}
catch(Exception exception)
{
throw new RuntimeException(exception);
}
}
public void playBlock(World world, int i, int j, int k, int l, int i1)
{
}
private Class anEntityClass;
}
My mod_ class has some other stuff so these are the relevant bits:
public static final Block blocklight = (new BlockLight(210, 0, true, net.minecraft.src.TileEntityLight.class)).setLightValue(1.0F).setBlockName("blocklight");
public static final Item itemlight = (new ItemReed(3703, blocklight)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/ItemChanger.png")).setItemName("itemlight");
TileEntityLightRenderer tileent1 = new TileEntityLightRenderer();
ModLoader.RegisterTileEntity(TileEntityLight.class, "light", tileent1);
aPart was example code; you were supposed to replace it with your own code. (like you eventually did it appears)
Anyway I noticed an issue:
public static final Item itemlight = (new ItemReed(3703, blocklight)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/ItemChanger.png")).setItemName("itemlight");
you did this incorrectly, you need to do it like blocks:
itemlight.iconIndex = ModLoader.addOverride("/gui/items.png", "/ItemChanger.png");
public static final Item itemlight = (new ItemReed(3703, blocklight)).setIconIndex(0, 0).setItemName("itemlight");
But I don't think this would cause crashing with multiple drops. Try making it drop something else and make the quantity dropped greater than 1 to test if it's the item or block that is causing the issue.
Ok, I followed your tutorial on making a different modelled block but am encountering a small issue. Despite having the following code, upon breaking the block Minecraft crashes with the error that would be expected if these pieces of code were completely absent (due to being unable to render the block as an item). Any idea why?
public int idDropped(int i, Random random)
{
return mod_WorldCraft.bigWireCoil.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}
Also, I haven't a clue as to why, but my model is rendered upside down...
Your tutorials is very useful!!I saw many tutorials but you explain everything very well!
for you!
I created multi textured block with your tutorial. In tutorial you say it's necessary to create ItemBlockName.java file, because texture loads incorrectly in item of block.
I tryed to do without that, because it gave me an error I cant fix and everything work perfect even without it!!
Maybe you can create tutorial, about how to change texture rotation as in furnace and in chest,( , ) so textures will depend on wich side you are facing when you placing a block.
Also, I want to ask you to update export template for Techne, because it dont work with newest version.
Right, I see what I did.
I was forgetting to add the folder.
The texturing part works the same as the textures for mobs I'm assuming then?
Also, there there a way so I don't need to make my model upside-down?
-Muserae
Yes, it's how mobs do it as well it's just simplified for block use.
There probably is but I haven't had any luck finding it. (rotating it outside of techne apparently doesn't work...)
Sorry for a late reply.
What I reccomend is backing these up in a seperate folder and then trying out the tutorial, even if some parts seem fuzzy; I can only really help you once you get errors. (or if your either really good or really lucky you managed to get it working first time, then good job :biggrin.gif:)
Well you can bind the .png,but as for getting the texture might take some work. I can point you in the right direction:
This is how fire's texture is loaded to render an entity on fire. This function is in Render.java. The parts I think you might need are:
This gets the specific texture index.
can be changed to:
and this should load terrain.png. (or w/e spritesheet your using)
However I have not experimented with this and thus I can't say exactly how this would work, I mgiht be wrong, but I am pretty sure this function should help in the right direction.
EDIT: One that is potentially less confusing is RenderSnowball:
This is the entire thing. As you see it loads from "items.png", and uses an iconIndex set in the constructor to say what the index is to render from. (both eggs and snowballs use this, I think Eye of Enders do too)
Post your block and mod_ file and I will see what the problem is.
BlockXXX:
And my Mod_XXX:
Thanks for any help you can give! :smile.gif:
Well this has two problems, the first being you defined the variables in a function, and second is you use two texture functions.
This part of your code:
Can be changed to:
This will both fix your problem and I added in an extra if statement; now both return a texture based on activity; if isActive is true, return the On texture. If not, return the Off texture.
P.S: You should put a tutorial on how to make a Custom Crafting Table, if you know how. I think I might know how but I haven't tried yet.
This part of your Render file:
Asks for a float.
In the mod_ file:
You put the model AND the float. Change the above code to this:
Keep up the amazing tutorials :laugh.gif:
aPart was example code; you were supposed to replace it with your own code. (like you eventually did it appears)
Anyway I noticed an issue:
you did this incorrectly, you need to do it like blocks:
But I don't think this would cause crashing with multiple drops. Try making it drop something else and make the quantity dropped greater than 1 to test if it's the item or block that is causing the issue.
Also, I haven't a clue as to why, but my model is rendered upside down...
for you!
I created multi textured block with your tutorial. In tutorial you say it's necessary to create ItemBlockName.java file, because texture loads incorrectly in item of block.
I tryed to do without that, because it gave me an error I cant fix and everything work perfect even without it!!
Maybe you can create tutorial, about how to change texture rotation as in furnace and in chest,( , ) so textures will depend on wich side you are facing when you placing a block.
Also, I want to ask you to update export template for Techne, because it dont work with newest version.