Can I make blockIndexInTexture, blockIndexInTexture2 through blockIndexInTexture5? i know this is png heavy, but is this possible? and how does this work out with multiple blocks in one mod with multiple textures?
Yes it's possible, and it works the same for more than one block. Both Block****.java files would be the same in terms of setup, and in the mod_****.java file you'd just do something like this:
Yes it's possible, and it works the same for more than one block. Both Block****.java files would be the same in terms of setup, and in the mod_****.java file you'd just do something like this:
package net.minecraft.src;
import java.util.Random;
public class BlockvbHay extends Block
{
protected BlockvbHay(int i, int j)
{
super(i, j, Material.cloth);
blockIndexInTexture2 = 0;
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if (l == 0 || l == 1)
{
return blockIndexInTexture2;
}
if (l >= 2)
{
return blockIndexInTexture;
}
return 0;
}
public static int blockIndexInTexture2;
public int idDropped(int i, Random random)
{
return Item.wheat.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 9;
}
}
and this is my mod:
package net.minecraft.src;
import java.util.Random;
public class mod_VillageBlox extends BaseMod
{
//add yer damn blocks here
public static final Block BlockvbHay = new BlockvbHay(255, 0).setHardness(1.3F).setResistance(1.0F).setBlockName("BlockvbHay").setStepSound(Block.soundGrassFootstep);
public mod_VillageBlox()
{
//--HAY
ModLoader.RegisterBlock(BlockvbHay);
ModLoader.AddName(BlockvbHay, "Hay Bale");
BlockvbHay.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHaySide.png");
BlockvbHay.blockIndexInTexture2 = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHayTop.png");
ModLoader.AddRecipe(new ItemStack(BlockvbHay, 1), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), Item.wheat });
}
public String Version()
{
return "VillageBlox 0.1";
}
}
But I get this error:
I am not sure how to fix that, or maybe it is not part of modloader for 1.8.1?
package net.minecraft.src;
import java.util.Random;
public class BlockvbHay extends Block
{
protected BlockvbHay(int i, int j)
{
super(i, j, Material.cloth);
blockIndexInTexture2 = 0;
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if (l == 0 || l == 1)
{
return blockIndexInTexture2;
}
if (l >= 2)
{
return blockIndexInTexture;
}
return 0;
}
public static int blockIndexInTexture2;
public int idDropped(int i, Random random)
{
return Item.wheat.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 9;
}
public static int blockIndexInTexture2;
}
Your mod_ file also has a problem:
public static final Block BlockvbHay = new BlockvbHay(255, 0).setHardness(1.3F).setResistance(1.0F).setBlockName("BlockvbHay").setStepSound(Block.soundGrassFootstep);
should be:
public static final Block blockvbHay = new BlockvbHay(255, 0).setHardness(1.3F).setResistance(1.0F).setBlockName("blockvbHay").setStepSound(Block.soundGrassFootstep);
This is so it knows it's a variable, otherwise it might conflict with the texture setup and cause problems. Now it should look like so:
package net.minecraft.src;
import java.util.Random;
public class mod_VillageBlox extends BaseMod
{
//add yer damn blocks here
public static final Block blockvbHay = new BlockvbHay(255, 0).setHardness(1.3F).setResistance(1.0F).setBlockName("blockvbHay").setStepSound(Block.soundGrassFootstep);
public mod_VillageBlox()
{
//--HAY
ModLoader.RegisterBlock(blockvbHay);
ModLoader.AddName(blockvbHay, "Hay Bale");
blockvbHay.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHaySide.png");
BlockvbHay.blockIndexInTexture2 = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHayTop.png"); //Notice how this is still uppercase, keep it like that
ModLoader.AddRecipe(new ItemStack(blockvbHay, 1), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), Item.wheat });
}
public String Version()
{
return "VillageBlox 0.1";
}
}
i actually figured this all out, also public static int blockIndexInTexture2; was in there, just not in the same place as where you put it. the problem now is that when i place the block in the game, everything works fine. but the icon in the containers shows the wrong top texture.
i actually figured this all out, also public static int blockIndexInTexture2; was in there, just not in the same place as where you put it. the problem now is that when i place the block in the game, everything works fine. but the icon in the containers shows the wrong top texture.
So it was, my bad. :tongue.gif:
I have had this issue for awhile, I am looking for a fix, so when I do find it i'll update the tutorial.
Hi (Yes it's me again XD. (thanks for tutorial)) I have tried to make multi-textured block, but I got this:
== MCP v4.4 ==
> Recompiling client...
"C:\Program Files\Java\jdk1.6.0_27\bin\javac.exe" -g -source 1.6 -target 1.6 -cl
asspath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.ja
r;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecr
aft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/mine
craft\net\minecraft\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\Blockcolorer.java:5: invalid method declaration;
return type required
public Blockc() // this is ADDED to Block**** not a NEW Block****
^
src\minecraft\net\minecraft\src\ItemBlockcolorer.java:15: illegal character: \35
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
^
src\minecraft\net\minecraft\src\ItemBlockcolorer.java:15: ')' expected
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
^
src\minecraft\net\minecraft\src\ItemBlockcolorer.java:15: ';' expected
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
^
src\minecraft\net\minecraft\src\ItemBlockcolorer.java:15: illegal start of expre
ssion
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
^
src\minecraft\net\minecraft\src\ItemBlockcolorer.java:15: ';' expected
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
^
6 errors
==================
> Done in 3.23 seconds
> Recompiling server...
!! Can not find server sources !!
my ItemBlockcolorer.java
package net.minecraft.src;
public class ItemBlockcolorer extends ItemBlock
{
public ItemBlockcolorer(int i)
{
super(i);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getIconFromDamage(int i)
{
return (mod_mineplast.Blockcolorer.getBlockTextureFromSideAndMetadata(#, i));
}
public int getPlacedBlockMetadata(int i)
{
return i;
}
}
What can I do?
Reread the tutorial, unlike Stength's there's stuff you MUST rename. Like this:
Nice. Hey don't mind the flak on starting at the begining... You don't know how many times I've had to point people back to the basics because they want to start at the hard stuff but don't know enough to get started. Keep it up!
I am terribly sorry I did not help you sooner! I am glad it appears to have worked out. And thanks, like I said this tutorial's not simple (so which is why I screwed up with ofc doesn't help lol, fixing that right now) so naturally there will be problems either on my end or yours. (in this case mine, sorry)
Also if it worked post it here! I'd like to see it, might use it as an example screen if you want :smile.gif:
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_medieval.java:35: error: illegal start of ex
pression
static //ditto
^
1 error
1 warning
*snip*
you put the static bracket in the wrong place, it should be outside any methods like so:
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
import java.io.File;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_medieval extends BaseMod
{
public static final Block blast = new BlockBlast(202, false).setHardness(3.0F).setResistance(5F).setBlockName("blast");
public static final Block blastActive = new BlockBlast(203, true).setHardness(3.0F).setLightValue(0.875F).setResistance(5F).setBlockName("refiner");
public static int rarity = 29;
public static int blastTop;
public static int blastOn;
public static int blastOff;
public mod_medieval()
{
ModLoader.RegisterBlock(blast);
ModLoader.RegisterBlock(blastActive);
ModLoader.AddName(blast, "Blaster");
TileEntityTingRenderer tileent1 = new TileEntityTingRenderer();
ModLoader.RegisterTileEntity(TileEntityTing.class, "Ting", tileent1);
ModLoader.RegisterTileEntity(net.minecraft.src.TileEntityBlast.class, "Blast");
blast.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MMtextures/MMblock/blast.png");
blastTop = ModLoader.addOverride("/terrain.png", "/MMtextures/MMblock/blastTop.png");
blastOn = ModLoader.addOverride("/terrain.png", "/MMtextures/MMblock/blastOn.png");
blastOff = ModLoader.addOverride("/terrain.png", "/MMtextures/MMblock/blastOff.png");
ModLoader.AddRecipe(new ItemStack(mod_medieval.blast, 1), new Object[]
{
"X", Character.valueOf('X'), Block.sand
});
}
public static ItemStack getOutPut(int i, int j)
{
if (i == Block.cobblestone.blockID && j == Block.cobblestone.blockID)
{
return new ItemStack(Block.stoneBrick, 4);
}
else
{
return null;
}
}
public void GenerateSurface(World world, Random rand, int i, int j)
{
for(int k = 0; k < rarity; k++)
{
int RandPosX = i + rand.nextInt(16);
int RandPosY = rand.nextInt(128);
int RandPosZ = j + rand.nextInt(16);
(new WorldGenHaus1()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
}
}
static{
blockTing = (new BlockTing(237, 0, net.minecraft.src.TileEntityTing.class)).setBlockName("blockTing");
itemTing = (new ItemReed(2003, blockTing)).setIconCoord(0, 0).setItemName("itemTing");
}
public String Version()
{
return "1.8.1";
}
}
Yes it's possible, and it works the same for more than one block. Both Block****.java files would be the same in terms of setup, and in the mod_****.java file you'd just do something like this:
This would make 2 unique blocks, each with 2 different textures. (placement would vary based on each block's java file)
Also you do have to use blockIndexInTexture FIRST as this is what the game uses for particle effects when you break a block.
I see! well disregard what I said in my thread!
and this is my mod:
But I get this error:
I am not sure how to fix that, or maybe it is not part of modloader for 1.8.1?
In BlockvbHay.java, like so:
Your mod_ file also has a problem:
should be:
This is so it knows it's a variable, otherwise it might conflict with the texture setup and cause problems. Now it should look like so:
So it was, my bad. :tongue.gif:
I have had this issue for awhile, I am looking for a fix, so when I do find it i'll update the tutorial.
Plus Insta Bookmarked
Reread the tutorial, unlike Stength's there's stuff you MUST rename. Like this:
should be:
not the actual symbol, but a number between 0-5. If you still have issues post your mod_ and block files.
Post your Blockcolorer.java file, I need more info.
That tutorial is really complicated so if you hit any problems, post away!
you have two constructors, stick the blockIndexInTexture2 = 0; line in the FIRST one:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Also if it worked post it here! I'd like to see it, might use it as an example screen if you want :smile.gif:
Sorry but your english is difficult to decipher, what do you mean?
The early bird might get the worm, but the second mouse gets the cheese.
you put the static bracket in the wrong place, it should be outside any methods like so:
I got it all to work except the texture. Do you take the techne texture and stick that name into the
or is there something I'm missing?
I've tried getting the texture to work for a little less than an hour, but I just can't get it. Think you can explain that a bit for me?
Thanks,
-Muserae
Yup. Although it depends on where your sticking the .png; like if you put it in muserae/models/, you'd need to put that in the string:
We are talking about the texturemap you can export from techne correct? The normal block override won't work since this is a model not a block.
EDIT: if you still have problems, PM me.