Les fonctions qui n’ont pas metadata en paramètre (ou world, x, y, z ou iblockaccess, x, y, z) sont appliquer à tout les metadata.
Sa veux dire que ça s’est déjà dans les metadatas ?
| |
| public int quantityDropped(Random par1Random) |
| { |
| return 0; |
| } |
| |
| public int getRenderBlockPass() |
| { |
| return 0; |
| } |
| |
| public boolean isOpaqueCube() |
| { |
| return false; |
| } |
| |
Alors pour quoi mes vitres son pas transparentes… ??
| |
| package mods.block; |
| |
| import java.util.ArrayList; |
| import java.util.List; |
| import java.util.Random; |
| |
| import net.minecraft.block.Block; |
| import net.minecraft.block.material.Material; |
| import net.minecraft.client.renderer.texture.IconRegister; |
| import net.minecraft.creativetab.CreativeTabs; |
| import net.minecraft.item.ItemStack; |
| import net.minecraft.util.Icon; |
| import net.minecraft.world.World; |
| import cpw.mods.fml.relauncher.Side; |
| import cpw.mods.fml.relauncher.SideOnly; |
| |
| public class BlockVitreColorer extends Block{ |
| |
| public BlockVitreColorer(int id, Material Materials) { |
| super(id, Materials); |
| this.setCreativeTab(CreativeTabs.tabDecorations); |
| } |
| |
| public static String[] type = new String[]{"Glass-White", "Glass-Orange", "Glass-Magenta", "Glass-LightBlue", "Glass-Yellow", "Glass-Lime", "Glass-Pink", "Glass-Gray","Glass-LightGrey","Glass-Cyan","Glass-Purple","Glass-Blue","Glass-Brown","Glass-Green","Glass-Red","Glass-Black"}; |
| private Icon[] IconArray; |
| |
| public void registerIcons(IconRegister iconregister) |
| { |
| IconArray = new Icon[type.length]; |
| for(int i = 0; i < type.length; i++) |
| { |
| IconArray* = iconregister.registerIcon("mods:" + type*); |
| } |
| } |
| |
| @SideOnly(Side.CLIENT) |
| public void getSubBlocks(int id, CreativeTabs creativeTabs, List list) |
| { |
| for(int metadata = 0; metadata < type.length; metadata++) |
| { |
| list.add(new ItemStack(id, 1, metadata)); |
| } |
| } |
| |
| @SideOnly(Side.CLIENT) |
| public Icon getIcon(int side, int metadata) |
| { |
| return metadata < type.length && metadata >= 0 ? IconArray[metadata] : IconArray[0]; |
| } |
| |
| public ArrayList <itemstack>getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) |
| { |
| ArrayList <itemstack>ret = new ArrayList<itemstack>(); |
| |
| int count = quantityDropped(metadata, fortune, world.rand); |
| for(int i = 0; i < count; i++) |
| { |
| int id = idDropped(metadata, world.rand, fortune); |
| if (id > 0) |
| { |
| ret.add(new ItemStack(id, 0, damageDropped(metadata))); |
| } |
| } |
| return ret; |
| } |
| |
| } |
| |
J’ai repris les textures de la 1.7 donc il son belle et bien transparente !
dsl mais j’arrive vraiment pas a comprendre…Merci</itemstack></itemstack></itemstack>