The RenderInvBlock() method in your mod_ class will also need to be changed to point to your new getBlockTextureFromSideAndMetadata() method when rendering each side of your block. I'm sure you would have figured that out but I thought you might like to know beforehand.
Cool, thanks man!
Although it's unlikely to wind up in my mod_ class as I've got way too much functionality in my mod to put things in there (my mod weighs it at close to 30 different blocks and 20 different items with a handful of extra entities thrown in for good measure).
I tend to have a number of various utility classes that handle this kind of common functionality to keep things a little more tidy :smile.gif:
I may have forgotten some information about using this makeshift fix: I only recommend using it on blocks that aren't found too often/aren't placed in the world everywhere. This may cause lag if over-used. If anyone reading this has used PremiumWood, you may notice an extra fps drop. Most people assume it is from the fancy leaves on all of the trees, but it is mostly caused by the makeshift terrain sprite fix, seeing as planks from the mod are used a lot, and the trees are all around the terrain. Using this terrain sprite fix should not cause lag on blocks that aren't found in abundance on the surface or anywhere visible (actually, anywhere that block's sides are rendered), so I would suggest that if you have a mod that adds something that is used in great abundance, use the normal ModLoader.AddOverride instead of rendering it with your custom block render ID. I will post this information with less explanation on the main post. If anyone feels I need more information posted on the main post, or any other tips, please PM me, as I do not check this thread very often. Thank you.
I've already been using custom renderers like crazy, so I'm surprised the above hadn't already occurred to me (I just had to skim it over and immediately got what you were saying), but your post just clued me into how to solve a whack of incompatibility problems with my mod (Better Than Wolves).
The funny part is that I was just thinking the other day that I could remap to items.png during block rendering to save on some terrain indices, but I totally brain-farted in not realizing I could just remap to an entirely separate file :smile.gif:
So thanks a bunch man. Very cool post.
It's no problem. I've used this in PremiumWood to make the mod so compatible with everything else, since it adds only a few item and block sprites.
do i make it so when i am braking a block the particles come off the mod terrain file and not the minecraft terrain
Thanks Fish2
This was discussed on the first (and a little bit at the beginning of the second) page of this topic. If you're still having trouble with it after reading through the topic, PM me for more specific help.
Scokeev9, if you're still following this thread,
I tried to use this method, and successfully recompiled, but when I go into my inventory and craft one of my blocks, the texture that is binded is from the original terrain.png.
I believe that I successfully did everything the op tells me to, but I feel there's something missing still that I don't know because my entire knowledge of Java has come from 1 month of modding minecraft (to moderate success).
Is it something with the lines of this type?
oreChalcanthite.blockIndexInTexture = 10;
Because that's assigning 10 from terrain.png, as are all the others.
Or should this line in RenderInvBlocks be different?
Interesting tutorial, I'll have to see if I can try that :smile.gif:
However I do fear the FPS impacts... Having a full texture file for a mod is a little "heavy", especially for mods that do not really need that many extra sprites anyway. scokeev9, do you think it would be doable to have a system like your ItemSpritesAPI for item and block sprites that uses override like ModLoader, but instead of sticking with the default texture file would be able to automatically switch to a new one when there are no sprites left? That way there would be no new texture file used for users with only one or two mods that don't add too many sprites, and for people with "big" mods like your PremiumWood, there would most likely be only one new texture file, not one per mod. It would be even greater if there was a way to indicate how important a sprite is so that those marked important would have priority when it comes to getting on the "main" texture file :wink.gif:
Otherwise, I wanted to ask, how did you check the FPS impact of using this system for "common" textures? Intuitively I would have though that whether a sprite is visible on only one block or on one thousand would not matter - only it not being visible at all most of the time would help.
Rollback Post to RevisionRollBack
You are welcome to PM-me, but I'm unable to reply to everyone. Vous pouvez m'envoyer un MP, mais je ne peux pas répondre à tous. आप मुझसे संपर्क कर सकते हैं, लेकिन मैं हर मेल का जवाब नहीं दे सकता.
I have been searching for a couple months trying to find out how to do a few things and I finally found this post. I can't even begin to count how many things this solves or improves for me. Now I just have to get used to using tessellator instead of setBlockBounds and renderStandardBlock drawing.
I am sure I am just missing something stupid. It runs fine but the textures from my version of the terrain.png file don't show up on the blocks. Am I referencing the file incorrectly? here is my code
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class mod_LegendOfZelda extends BaseMod {
int getRenderType() {
return mod_LegendOfZelda.renderID;
}
public static final Block DungeonFloor1 = new BlockZeldaBlocks(230, 0, Material.rock).setBlockName("Black Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor2 = new BlockZeldaBlocks(231, 0, Material.rock).setBlockName("Blue Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor3 = new BlockZeldaBlocks(232, 0, Material.rock).setBlockName("Gold Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor4 = new BlockZeldaBlocks(233, 0, Material.rock).setBlockName("Green Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor5 = new BlockZeldaBlocks(234, 0, Material.rock).setBlockName("Light Blue Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor6 = new BlockZeldaBlocks(235, 0, Material.rock).setBlockName("Light Green Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor7 = new BlockZeldaBlocks(236, 0, Material.rock).setBlockName("White Floor").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor8 = new BlockZeldaBlocks(237, 0, Material.rock).setBlockName("Blue and Red Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor9 = new BlockZeldaBlocks(238, 0, Material.rock).setBlockName("Blue Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor10 = new BlockZeldaBlocks(239, 0, Material.rock).setBlockName("Gold and Blue Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor11 = new BlockZeldaBlocks(240, 0, Material.rock).setBlockName("Gold and Red Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor12 = new BlockZeldaBlocks(241, 0, Material.rock).setBlockName("Green and Red Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor13 = new BlockZeldaBlocks(242, 0, Material.rock).setBlockName("Light Blue and Blue Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor14 = new BlockZeldaBlocks(243, 0, Material.rock).setBlockName("Green and Blue Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor15 = new BlockZeldaBlocks(244, 0, Material.rock).setBlockName("Green and Red Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor16 = new BlockZeldaBlocks(245, 0, Material.rock).setBlockName("Red Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor17 = new BlockZeldaBlocks(246, 0, Material.rock).setBlockName("White and Light Blue Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonFloor18 = new BlockZeldaBlocks(247, 0, Material.rock).setBlockName("White Sand").setStepSound(Block.soundGravelFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall1 = new BlockZeldaBlocks(248, 0, Material.rock).setBlockName("Blue Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall2 = new BlockZeldaBlocks(249, 0, Material.rock).setBlockName("Gold Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall3 = new BlockZeldaBlocks(250, 0, Material.rock).setBlockName("Green Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall4 = new BlockZeldaBlocks(251, 0, Material.rock).setBlockName("Light Blue Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall5 = new BlockZeldaBlocks(252, 0, Material.rock).setBlockName("Light Green Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall6 = new BlockZeldaBlocks(253, 0, Material.rock).setBlockName("Secret Room Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonWall7 = new BlockZeldaBlocks(254, 0, Material.rock).setBlockName("White Brick").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue1 = new Block(255, 1, Material.rock).setBlockName("Blue Statue Left").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue2 = new Block(229, 2, Material.rock).setBlockName("Blue Statue right").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue3 = new BlockZeldaBlocks(228, 0, Material.rock).setBlockName("Red Statue on Blue Left").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue4 = new BlockZeldaBlocks(227, 0, Material.rock).setBlockName("Red Statue on Blue Right").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue5 = new BlockZeldaBlocks(226, 0, Material.rock).setBlockName("Blue Statue on Gold Left").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue6 = new BlockZeldaBlocks(225, 0, Material.rock).setBlockName("Blue Statue on Gold Right").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue7 = new BlockZeldaBlocks(224, 0, Material.rock).setBlockName("Gold Statue Left").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static final Block DungeonStatue8= new Block(223, 0, Material.rock).setBlockName("Gold Statue Right").setStepSound(Block.soundStoneFootstep).setBlockUnbreakable().setResistance(6000000F);
public static int renderID; {
renderID = ModLoader.getUniqueBlockModelID(this, true);
}
@Override
public String getVersion() {
return "1.0";
}
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j)
{
if(j == renderID)
{
RenderEngine renderengine = ModLoader.getMinecraftInstance().renderEngine;
Tessellator tessellator = Tessellator.instance;
renderengine.bindTexture(renderengine.getTexture("/hyrule.png"));
block.setBlockBoundsForItemRender();
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
}
}
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l)
{
if(l != renderID)
{
return false;
}
RenderEngine renderengine = ModLoader.getMinecraftInstance().renderEngine;
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
renderengine.bindTexture(renderengine.getTexture("/hyrule.png"));
RenderBlocks.cfgGrassFix = false;
boolean bool = false;
if(l == renderID)
{
bool = renderblocks.renderStandardBlock(block, i, j, k);
}
RenderBlocks.cfgGrassFix = true;
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
return bool;
}
@Override
public void load() {
ModLoader.registerBlock(DungeonFloor1);
ModLoader.registerBlock(DungeonFloor2);
ModLoader.registerBlock(DungeonFloor3);
ModLoader.registerBlock(DungeonFloor4);
ModLoader.registerBlock(DungeonFloor5);
ModLoader.registerBlock(DungeonFloor6);
ModLoader.registerBlock(DungeonFloor7);
ModLoader.registerBlock(DungeonFloor8);
ModLoader.registerBlock(DungeonFloor9);
ModLoader.registerBlock(DungeonFloor10);
ModLoader.registerBlock(DungeonFloor11);
ModLoader.registerBlock(DungeonFloor12);
ModLoader.registerBlock(DungeonFloor13 );
ModLoader.registerBlock(DungeonFloor14 );
ModLoader.registerBlock(DungeonFloor15 );
ModLoader.registerBlock(DungeonFloor16 );
ModLoader.registerBlock(DungeonFloor17 );
ModLoader.registerBlock(DungeonFloor18 );
ModLoader.registerBlock(DungeonWall1 );
ModLoader.registerBlock(DungeonWall2 );
ModLoader.registerBlock(DungeonWall3 );
ModLoader.registerBlock(DungeonWall4 );
ModLoader.registerBlock(DungeonWall5 );
ModLoader.registerBlock(DungeonWall6 );
ModLoader.registerBlock(DungeonWall7 );
ModLoader.registerBlock(DungeonStatue1 );
ModLoader.registerBlock(DungeonStatue2 );
ModLoader.registerBlock(DungeonStatue3 );
ModLoader.registerBlock(DungeonStatue4 );
ModLoader.registerBlock(DungeonStatue5 );
ModLoader.registerBlock(DungeonStatue6 );
ModLoader.registerBlock(DungeonStatue7 );
ModLoader.registerBlock(DungeonStatue8);
ModLoader.addName(DungeonFloor1, "Black Floor");
ModLoader.addName(DungeonFloor2, "Blue Floor");
ModLoader.addName(DungeonFloor3, "Gold Floor");
ModLoader.addName(DungeonFloor4, "Green Floor");
ModLoader.addName(DungeonFloor5, "Light Blue Floor");
ModLoader.addName(DungeonFloor6, "Light Green Floor");
ModLoader.addName(DungeonFloor7, "White Floor");
ModLoader.addName(DungeonFloor8, "Blue and Red Sand");
ModLoader.addName(DungeonFloor9, "Blue Sand");
ModLoader.addName(DungeonFloor10, "Gold and Blue Sand");
ModLoader.addName(DungeonFloor11, "Gold and Red Sand");
ModLoader.addName(DungeonFloor12, "Green and Red Sand");
ModLoader.addName(DungeonFloor13, "Light Blue and Blue Sand");
ModLoader.addName(DungeonFloor14, "Light Green and Blue Sand");
ModLoader.addName(DungeonFloor15, "Light Green and Red Sand");
ModLoader.addName(DungeonFloor16, "Red Sand");
ModLoader.addName(DungeonFloor17, "White and Light Blue Sand");
ModLoader.addName(DungeonFloor18, "White Sand");
ModLoader.addName(DungeonWall1, "Blue Brick");
ModLoader.addName(DungeonWall2, "Gold Brick");
ModLoader.addName(DungeonWall3, "Green Brick");
ModLoader.addName(DungeonWall4, "Light Blue Brick");
ModLoader.addName(DungeonWall5, "Light Green Brick");
ModLoader.addName(DungeonWall6, "Secret Room Brick");
ModLoader.addName(DungeonWall7, "White Brick");
ModLoader.addName(DungeonStatue1, "Blue Statue Left");
ModLoader.addName(DungeonStatue2, "Blue Statue right");
ModLoader.addName(DungeonStatue3, "Red Statue on Blue Left");
ModLoader.addName(DungeonStatue4, "Red Statue on Blue Right");
ModLoader.addName(DungeonStatue5, "Blue Statue on Gold Left");
ModLoader.addName(DungeonStatue6, "Blue Statue on Gold Right");
ModLoader.addName(DungeonStatue7, "Gold Statue Left");
ModLoader.addName(DungeonStatue8, "Gold Statue Right");
DungeonFloor1 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFBlk.png");
DungeonFloor2 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFBlu.png");
DungeonFloor3 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFGld.png");
DungeonFloor4 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFGrn.png");
DungeonFloor5 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFLtBlu.png");
DungeonFloor6 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFLtGrn.png");
DungeonFloor7 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFWht.png");
DungeonFloor8 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFBluRdSand.png");
DungeonFloor9 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFBluSand.png");
DungeonFloor10 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFGldBluSand.png");
DungeonFloor11 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFGldRdSand.png");
DungeonFloor12 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFGrnRdSand.png");
DungeonFloor13 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFLtBluBluSand.png");
DungeonFloor14 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFLtGrnBluSand.png");
DungeonFloor15 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFLtGrnRdSand.png");
DungeonFloor16 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFRdSand.png");
DungeonFloor17 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFWhtLtBluSand.png");
DungeonFloor18 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDFWhtSand.png");
DungeonWall1 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWBluBrk.png");
DungeonWall2 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWGldBrk.png");
DungeonWall3 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWGrnBrk.png");
DungeonWall4 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWLtBluBrk.png");
DungeonWall5 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWLtGrnBrk.png");
DungeonWall6 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWSecWhtBrk.png");
DungeonWall7 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDWWhtBrk.png");
DungeonStatue3 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDSBluRdLeft.png");
DungeonStatue4 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDSBluRdRight.png");
DungeonStatue5 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDSGldBluLeft.png");
DungeonStatue6 .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "FQDSGldBluRight.png");
ModLoader.addRecipe(new ItemStack(DungeonFloor1, 64), new Object[] { " D ", " D ", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor2, 64), new Object[] { " D ", " D ", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor3, 64), new Object[] { " D ", " D", " D ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor4, 64), new Object[] { " D ", " D", " D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor5, 64), new Object[] { " D ", " D", "DD ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor6, 64), new Object[] { " D ", " D", " DD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor7, 64), new Object[] { " D ", " D", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor8, 64), new Object[] { " D ", " D", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor9, 64), new Object[] { " D", " D", " D ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor10, 64), new Object[] { " D", " D", " D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor11, 64), new Object[] { " D", " D", "DD ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor12, 64), new Object[] { " D", " D", " DD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor13, 64), new Object[] { " D", " D", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor14, 64), new Object[] { " D", " D", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor15, 64), new Object[] { " D", " D ", " D ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor16, 64), new Object[] { " D", " D ", " D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor17, 64), new Object[] { " D", " D ", "DD ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonFloor18, 64), new Object[] { " D", " D ", " DD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall1, 64), new Object[] { " D", " D ", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall2, 64), new Object[] { " D", " D ", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall3, 64), new Object[] { " D", "D D", " D ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall4, 64), new Object[] { " D", "D D", " D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall5, 64), new Object[] { " D", "D D", "DD ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall6, 64), new Object[] { " D", "D D", " DD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonWall7, 64), new Object[] { " D", "D D", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue1, 64), new Object[] { " D", "D D", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue2, 64), new Object[] { " D", " DD", " D ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue3, 64), new Object[] { " D", " DD", " D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue4, 64), new Object[] { " D", " DD", "DD ", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue5, 64), new Object[] { " D", " DD", " DD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue6, 64), new Object[] { " D", " DD", "D D", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue7, 64), new Object[] { " D", " DD", "DDD", 'D', Block.dirt });
ModLoader.addRecipe(new ItemStack(DungeonStatue8, 64), new Object[] { " D", "DDD", " D ", 'D', Block.dirt });
}
}
I am sure I am just missing something stupid. It runs fine but the textures from my version of the terrain.png file don't show up on the blocks. Am I referencing the file incorrectly? here is my code
*snip*
any help anyone can offer would be great. Thanks!
You need to put
int getRenderType() {
return mod_LegendOfZelda.renderID;
}
into BlockZeldaBlocks, not into mod_LegendOfZelda.
Also, you shouldn't use ModLoader.addOverride here, put the images directly into the new terrain.png and put their locations instead of the addOverride calls.
Cool, thanks man!
Although it's unlikely to wind up in my mod_ class as I've got way too much functionality in my mod to put things in there (my mod weighs it at close to 30 different blocks and 20 different items with a handful of extra entities thrown in for good measure).
I tend to have a number of various utility classes that handle this kind of common functionality to keep things a little more tidy :smile.gif:
It's no problem. I've used this in PremiumWood to make the mod so compatible with everything else, since it adds only a few item and block sprites.
This was discussed on the first (and a little bit at the beginning of the second) page of this topic. If you're still having trouble with it after reading through the topic, PM me for more specific help.
Now I can update my mods. I will credit you! :3
I tried to use this method, and successfully recompiled, but when I go into my inventory and craft one of my blocks, the texture that is binded is from the original terrain.png.
I believe that I successfully did everything the op tells me to, but I feel there's something missing still that I don't know because my entire knowledge of Java has come from 1 month of modding minecraft (to moderate success).
Is it something with the lines of this type?
Because that's assigning 10 from terrain.png, as are all the others.
Or should this line in RenderInvBlocks be different?
Or this one in RenderWorldBlocks?
Or most likely it's something caused by
which I don't really understand where to put, or what "this" or "true" are
EDIT: Also, I don't even know where to start for having my block file use a front or top texture from my terrain-type-file?
Minecraft technology - the logical way - the only way.
"java.lang.Exception: No more empty item sprite indices left!"
problem?
(the blocks one also?)
"truth is a pathless land" - Jiddu Krishnamurti
However I do fear the FPS impacts... Having a full texture file for a mod is a little "heavy", especially for mods that do not really need that many extra sprites anyway. scokeev9, do you think it would be doable to have a system like your ItemSpritesAPI for item and block sprites that uses override like ModLoader, but instead of sticking with the default texture file would be able to automatically switch to a new one when there are no sprites left? That way there would be no new texture file used for users with only one or two mods that don't add too many sprites, and for people with "big" mods like your PremiumWood, there would most likely be only one new texture file, not one per mod. It would be even greater if there was a way to indicate how important a sprite is so that those marked important would have priority when it comes to getting on the "main" texture file :wink.gif:
Otherwise, I wanted to ask, how did you check the FPS impact of using this system for "common" textures? Intuitively I would have though that whether a sprite is visible on only one block or on one thousand would not matter - only it not being visible at all most of the time would help.
You are welcome to PM-me, but I'm unable to reply to everyone. Vous pouvez m'envoyer un MP, mais je ne peux pas répondre à tous. आप मुझसे संपर्क कर सकते हैं, लेकिन मैं हर मेल का जवाब नहीं दे सकता.
I tried it, failed
Heres the code I used on the block
With all other codes on the OP inside the mod_ file.
RenderWorldBlock is now renderWorldBlock
RenderInvBlock is now renderInvBlock
Just rename the methods in you mod_* file and it should work.
any help anyone can offer would be great. Thanks!
You need to put
into BlockZeldaBlocks, not into mod_LegendOfZelda.
Also, you shouldn't use ModLoader.addOverride here, put the images directly into the new terrain.png and put their locations instead of the addOverride calls.