Jump to content

gooball60

Members
  • Posts

    11
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

gooball60's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I guess that clears things up. Thanks everyone. Derp.
  2. I am confused. I have never really worked with metadata. Sorry
  3. But how would I return the metadata in the same method as getPlantType? (Once again, new modder here)
  4. Yes, but I don't want ALL of my saplings to grow on sand, only a specific one. Wouldn't you have to specify which sapling in the getPlantType method?
  5. Well, since my saplings use metadata, how would I do this? (I'm still learning - forgive me)
  6. This guy's tutorials are REALLY helpful:
  7. I made a sapling, and I'm trying to get it to be placeable on only sand. I have the tree class set to only grow on sand, but now I need the sapling to be placeable on sand. My sapling class uses metadata, so I'm not sure how to do this. Any ideas?
  8. Fixed! I watched this video: and that cleared up most of the issues. However they still decay when I place them on any block besides logs. I want them to be like vanilla leaves; player placed leaves do not decay at all. Help.
  9. Ok, so I changed this: public static final String[][] names = new String[][] {{"AppleBlossomLeaves", "AppleBlossomLeavesOpaque"}, {"PalmLeaves", "PalmLeavesOpaque"}}; To this: public static final String[][] names = new String[][] {{"AppleBlossomLeaves", "PalmLeaves"}, {"AppleBlossomLeavesOpaque", "PalmLeavesOpaque"}}; And everthing seems to be working fine, even the graphics. Only one problem, The palm leaf texture shows up on the icon, but not on the block itself, the block has the same texture as the apple blossom. Also, the leaves still decay when I place them. I know they aren't supposed to decay when placed by a player, they only decay when they are on a tree and someone mines the trunk away. Now what?
  10. That didn't seem to help any, thanks anyway.
  11. Hello, I have been having issues with leaves lately. So far, I have two leaf types - palm and apple blossom. The problem is that there is only one type in the game. On top of that, it also displays the opaque version in the creative tab. They also decay eventually even when I place them on my own. I have not tested them with trees yet, so I'm sure even more problems will arise then. Oh yeah, the leaves don't change to the opaque texture when set to fast graphics. I know this is a lot in one post, but I have had these problems for weeks, and I'm getting desperate. My leaf block: package net.goocraft.mod.biome.features; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.goocraft.mod.GooCraft; import net.minecraft.block.BlockLeaves; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class GooCraftLeaf extends BlockLeaves { public static final String[][] names = new String[][] {{"AppleBlossomLeaves", "AppleBlossomLeavesOpaque"}, {"PalmLeaves", "PalmLeavesOpaque"}}; public static final String[] types = new String[] {"AppleBlossom", "Palm"}; protected IIcon[][] icon = new IIcon[2][]; public GooCraftLeaf() { this.setCreativeTab(CreativeTabs.tabDecorations); this.setHardness(0.2F); this.setLightOpacity(1); this.setStepSound(soundTypeGrass); this.setTickRandomly(true); } protected void dropBlockAsItemWithChance(World par1, int par2, int par3, int par4, int par5, int par6) { if ((par5 & 3) == 0 && par1.rand.nextInt(par6) == 0) { this.dropBlockAsItem(par1, par2, par3, par4, new ItemStack(Items.apple, 1, 0)); } } protected int func_150123_b(int par1) { int j = super.func_150123_b(par1); if ((par1 & 3) == 3) { j = 40; } return j; } @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { par3.add(new ItemStack(par1, 1, 0)); par3.add(new ItemStack(par1, 1, 1)); } protected ItemStack createStackedBlock(int par1) { return new ItemStack(this, 1, par1 & 3); } public boolean isOpaqueCube() { return false; } @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int par2) { this.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); return (par2 & 3) == 1 ? this.icon[this.field_150127_b][1] : ((par2 & 3) == 3 ? this.icon[this.field_150127_b][3] : ((par2 & 3) == 2 ? this.icon[this.field_150127_b][2] : this.icon[this.field_150127_b][0])); } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister par1) { for (int i = 0; i < names.length; ++i) { this.icon[i] = new IIcon[names[i].length]; for (int j = 0; j < names[i].length; ++j) { this.icon[i][j] = par1.registerIcon(GooCraft.modid + ":" + names[i][j]); } } } public String[] func_150125_e() { return types; } } And the item code: package net.goocraft.mod.items; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class ItemGooCraftLeaves extends ItemBlock { private final static String[] names = {"AppleBlossom", "Palm"}; public ItemGooCraftLeaves(Block id) { super(id); setHasSubtypes(true); } @Override public int getMetadata (int damageValue) { return damageValue; } @Override public String getUnlocalizedName(ItemStack itemstack) { return getUnlocalizedName() + "." + names[itemstack.getItemDamage()]; } } Any help is appreciated.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.