Résolu Créations de plantations.
-
7 comme le blé. et je voudrais aussi que la poudre d’os ne soit pas utilisable sur ma culture si possible.
-
package fr.scarex.st17.block; import java.util.Random; import net.minecraft.block.BlockCrops; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; import fr.scarex.st17.ST17; public class BlackCarrot extends BlockCrops { public static final String name = "black_carrot"; private IIcon[] textures; public BlackCarrot() { setBlockName(name); setBlockTextureName(ST17.MODID + ":" + name); setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerBlock(this, name); } @Override public IIcon getIcon(int side, int meta) { if (meta < 0 || meta > 7) { meta = 7; } return this.textures[meta]; } @Override protected Item func_149866_i() { return Items.diamond; } @Override protected Item func_149865_P() { return Items.apple; } @Override public void registerBlockIcons(IIconRegister p_149651_1_) { this.textures = new IIcon[8]; for (int i = 0; i < this.textures.length; ++i) { this.textures* = p_149651_1_.registerIcon(ST17.MODID + ":" + this.getTextureName() + "_stage_" + i); } } @Override public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { return false; } @Override public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { return false; } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int meta, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (!world.isRemote) { player.addChatMessage(new ChatComponentText("Metadata : " + world.getBlockMetadata(x, y, z))); player.addChatMessage(new ChatComponentText("Texture : " + this.getIcon(0, world.getBlockMetadata(x, y, z)).getIconName())); } return true; } }
-
Merci