Hamster_Furtif
Members-
Posts
100 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Hamster_Furtif
-
Hey guys ! I got a problem with my crops : package com.hamsterfurtif.elisancecraft.blocks; import com.hamsterfurtif.elisancecraft.ElisanceCraftMOD; import com.hamsterfurtif.elisancecraft.lib.References; import net.minecraft.block.Block; import net.minecraft.block.BlockCrops; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.World; @SuppressWarnings("unused") public class BlockMais extends BlockCrops { private IIcon[] field_149868_a; private static final String __OBFID = "CL_00000212"; /** * Gets the block's texture. Args: side, meta */ @Override public IIcon getIcon(int p_149691_1_, int p_149691_2_) { if (p_149691_2_ < 7) { if (p_149691_2_ == 6) { p_149691_2_ = 5; } return this.field_149868_a[p_149691_2_ >> 1]; } else { return this.field_149868_a[3]; } } @Override public boolean canBlockStay (World world, int posX, int posY, int posZ) { Block dessous = world.getBlock(posX, posY - 1, posZ); Block dessus = world.getBlock(posX, posY + 1, posZ); int met = world.getBlockMetadata(posX, posY, posZ); if (dessous == Blocks.farmland ) { return true; } else { return false; } } protected Item func_149866_P() { return ElisanceCraftMOD.mais_epis; } protected Item func_149865_i() { return ElisanceCraftMOD.mais_epis; } @Override public void registerBlockIcons(IIconRegister p_149651_1_) { this.field_149868_a = new IIcon[4]; for (int var2 = 0; var2 < this.field_149868_a.length; ++var2) { this.field_149868_a[var2] = p_149651_1_.registerIcon(References.MODID + ":pousse_mais" + "_stage_" + var2); } } public void onBlockAdded(World world, int posX, int posY, int posZ) { world.setBlock(posX, posY +1, posZ, ElisanceCraftMOD.mais_pousse_top); } public int getRenderType() { return 2; } public Item getItem(World world, int posX, int posY, int posZ) { return ElisanceCraftMOD.mais_epis; } } The problem is that when I use this: public int getRenderType() { return 2; } The textures stay the same, at the first stage.
-
[1.7.2][Forge]Register a custom armor render
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
By the way, I still don't understand what to do with my render. -
[1.7.2][Forge]Register a custom armor render
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Wow, this is some heavy stuff. Are you sure there is no easier way ? -
[1.7.2][Forge]Register a custom armor render
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Well, how I am supposed to use it ? -
[1.7.2][Forge]Register a custom armor render
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Up ! -
Hi everyone ! I'd like to register this armor render: How I am supposed to do that ? I looked in RenderingRegistry but there is nothing I could use.
-
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
So, here's what I've done : But it's not working. It's more or like the same as the vanilla obe : -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Oh ! My mistake. So here's the exact code I used in vanilla, and it's working : But the cotton is still not dyeable. So I looked in vanilla codes and saw this : So, what should I do ? Should I create a new class that extends RecipesArmorDyes ? Or should I create a new class that implements IRecipie, and with the same content ? -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
This is what I did, and it's not working ! -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
I want it to work not only with Leather but also with Cotton ! But it doesn't work, and I don't know why. -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Well, I think yes. I want to redefine superclass's method for my new class, so I have to Override. Isn't it the right thing to do ? -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
I checked what @Override does, but what does it have to do with this method ? Should I override or not ? And, what is wrong with my reasoning ? -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
I suppressed the @Override. -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
All the previous message was made to answer your question : <<Do you actually know what the error message means ?>> At the beginning of mine : <<I suppose the method does not always return an int>> Because I think that it want me to add a return statement to be sure the method will always return an Int. And if it want to be sure that the method always return an int, it's because it currently doesn't. This is the point of my previous message. If you're talking about the override thing, I just left it when I was doing a few test, that's all. I just suppressed it. About var3 : I did not created all this, I copied it from the original code : The vanilla version works very fine btw, so I don't know why I doesn't with Forge. And this is where var3 comes from. NBTTagCompound var3 = var2.getCompoundTag("display"); -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Well, I suppose the method does not always return an int ? And I guess It's because var3 isn't null, so the issue is in this part : (var3.hasKey("color", 3) ? var3.getInteger("color") : 16777215) or in this one : NBTTagCompound var3 = var2.getCompoundTag("display"); If it is in the first part, it's because var3.hasKey("color", 3) is not true, and then the function returns var3.getInteger("color") which is not an int. So, the problem here is var3 ? -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Well, I understood this : If the armor is not made of cotton, then the function will return -1, If the armor is made of cotton : var2 equals the Armor's TagCoumpound (And to be honest, I don't really know what it means. I think it's if the armor is colored or not, and if it is, what color.) If this Armor's TagCoumpound is null, th function will return the color 16777215. Else, var3 = var2.getCompoundTag("display"); and the function returns : if var3 is null the function returns 10511680 if var3 isn't null AND var3.hasKey("color", 3) is true, the function returns var3.getInteger("color") if var3 isn't null AND var3.hasKey("color", 3) if false, the function returns 16777215 Is all this right ? -
[1.7.2]Function func_150297_b & generation
Hamster_Furtif replied to Hamster_Furtif's topic in Modder Support
Well, I used hasKey, but the function didn't work. It asked for a(nother) return statement at the end. What I a supposed to do ? About the generation, here's all I've done: All the generation tutorials are about ores... -
Hi everyone ! In my mod, I created a new flower, the cotton. You can use it to make an "armor" that you can dye later. When I created the mod with MCP, it was very easy, I used the func_150297_b. But now I use forge, It doesn't work. So, here is my forge class, the func_150297_b are in red: My second question is about flower Generation. It's about the cotton flower. I would like it to spawn in savanna biomes only, and I searched a lot but found nothing, so, if someone could explain me how to do, it would be great .