
goodmanalex
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by goodmanalex
-
[1.7.10] How change texture 'onItemRightClick'
goodmanalex replied to goodmanalex's topic in Modder Support
yes yes... but u can show me a little example please? im very noob Edit i solve it with onupdate ^^ -
[1.7.10] How change texture 'onItemRightClick'
goodmanalex replied to goodmanalex's topic in Modder Support
You can say me how? ._. -
[1.7.10] How change texture 'onItemRightClick'
goodmanalex replied to goodmanalex's topic in Modder Support
like this? public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer, int modo) Now red line is in public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Reference.MODID + ":breaker"); this.iconArray = new IIcon[breakerarray.length]; if(modo==1){ par1IconRegister.registerIcon(Reference.MODID +breakerarray[1]); } if(modo==0){ par1IconRegister.registerIcon(Reference.MODID +breakerarray[0]); } } public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (modo==1) { return iconArray[1]; } else if (modo==0) { return iconArray[0]; }else { return itemIcon; } } -
[1.7.10] How change texture 'onItemRightClick'
goodmanalex replied to goodmanalex's topic in Modder Support
I add this to my code, but i dont know how change on rightclick :SS public class breaker extends ItemPickaxe { public static final String[] breakerarray = new String[] {":breaker, breaker2"}; public int modo; public static ToolMaterial gigabreaker = EnumHelper.addToolMaterial("gigabreaker", 4, -1, 20.0F, 0.0F, 50); @SideOnly(Side.CLIENT) private IIcon[] iconArray; public breaker(String unlocalizedName, ToolMaterial material) { super(material); setUnlocalizedName("breaker"); this.setCreativeTab(colorescraftmod.colorescraftmod); setFull3D(); } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { Boolean enc=itemstack.isItemEnchanted(); if(itemstack.isItemEnchanted()){ modo=0; itemstack.setTagCompound(null); }else{ itemstack.addEnchantment(Enchantment.knockback, 50); modo=1;} return itemstack; } /////////////////////////////// @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Reference.MODID + ":breaker"); this.iconArray = new IIcon[breakerarray.length]; if(modo==1){ par1IconRegister.registerIcon(Reference.MODID +breakerarray[1]); } if(modo==0){ par1IconRegister.registerIcon(Reference.MODID +breakerarray[0]); } } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (modo==1) { return iconArray[1]; } else if (modo==0) { return iconArray[0]; }else { return itemIcon; } } ////////////////////// private static Set effectiveAgainst = Sets.newHashSet(new Block[] { Blocks.grass, Blocks.dirt, Blocks.sand, Blocks.gravel, Blocks.snow_layer, Blocks.snow, Blocks.clay, Blocks.farmland, Blocks.soul_sand, Blocks.mycelium, Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin}); @Override public float func_150893_a(ItemStack stack, Block block) { if (block.getMaterial() == Material.wood || block.getMaterial() == Material.vine || block.getMaterial() == Material.plants) return this.efficiencyOnProperMaterial; return effectiveAgainst.contains(block) ? this.efficiencyOnProperMaterial : super.func_150893_a(stack, block); } } -
I need to change the item texture to other this is mi onItemRightClick public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { Boolean enc=itemstack.isItemEnchanted(); if(itemstack.isItemEnchanted()){ itemstack.setTagCompound(null); }else{ itemstack.addEnchantment(Enchantment.knockback, 3);} return itemstack; } Could you tell me I should add code or give an example?
-
maybe someone already has something similar to what I want or can spend a tutorial
-
but this no help me because i don't know how edit the code,i don't know program anything
-
my question is on my first post...
-
only need a function for generate blocks on the surface... is only edit the last code... no make all the code i don't know program anything :C
-
yes... but you can help me? xDD
-
i use the last code for the ores generator, but i need make a replicate the same code for generate blocks on the surface and on top the grass block this is the .java package com.colorescraftmod.principal.items; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import cpw.mods.fml.common.IWorldGenerator; public class ModWorldGen implements IWorldGenerator { private WorldGenerator multiore; //Generates Multi Ore (used in Overworld) public ModWorldGen() { this.multiore = new WorldGenSingleMinable(ModItems.multiore); // this.gen_cobblestone = new WorldGenMinable(Blocks.cobblestone, 16, Blocks.end_stone); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case 0: //Overworld //this.runGenerator(this.gen_multi_ore, world, random, chunkX, chunkX, 20, 0, 64); this.runGenerator(this.multiore, world, random, chunkX, chunkZ, 1120, 0, 254); break; case -1: //Nether break; case 1: //End break; } } private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight + 1; for (int i = 0; i < chancesToSpawn; i ++) { int x = chunk_X * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z * 16 + rand.nextInt(16); generator.generate(world, rand, x, y, z); System.out.printf("Cosa generada veinti"); } } }
-
yes... if someone bothers to edit my code, I would greatly appreciate it, i dont know how make this...
-
hello! How I can edit the code to generate blocks on top grass on the surface? private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight + 1; for (int i = 0; i < chancesToSpawn; i ++) { int x = chunk_X * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z * 16 + rand.nextInt(16); generator.generate(world, rand, x, y, z); System.out.printf("Cosa generada veinti"); } } pss edit my code, many thanks!