Probleme cable en redstone custom



  • J'ai un gros probleme lorsque je fait mon cable en redstone, tous s epasse bien le probleme est au niveau texture.
    Pour les animation quand la redstone est dans un angle au lieu de sa il me sort un bloc solide.

    Voici le code de la classe du cable :

    
    package fr.mrliop.techmod.blocks;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import fr.mrliop.techmod.TechMod;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockRedstoneWire;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.client.renderer.texture.ITextureObject;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.IBlockAccess;
    
    public class BlockElecWire extends Block {
    
    @SideOnly(Side.CLIENT)
    private IIcon top;
    @SideOnly(Side.CLIENT)
    private IIcon front;
    @SideOnly(Side.CLIENT)
    private IIcon field_150182_M;
    @SideOnly(Side.CLIENT)
    private IIcon field_150183_N;
    @SideOnly(Side.CLIENT)
    private IIcon field_150184_O;
    @SideOnly(Side.CLIENT)
    private IIcon field_150180_P;
    
    public BlockElecWire(Material material){
    super(material);
    
    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
    }
    
    @Override
    public boolean isOpaqueCube()
    {
    return false;
    }
    
    /**
    * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
    */
    @Override
    public boolean renderAsNormalBlock()
    {
    return false;
    }
    @Override
    public int getRenderType()
    {
    return 6;
    }
    
    /**
    * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
    * when first determining what to render.
    */
    @SideOnly(Side.CLIENT)
    @Override
    public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
    {
    return 0000000;
    }
    
    @Override
    public boolean canConnectRedstone(IBlockAccess iba, int i, int j, int k, int dir)
    {
    return true;
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public IIcon getIcon(int side, int p_149691_2_)
    {
    return side == 1 || side == 0 ? this.top : (side == 2 ? this.front : this.blockIcon);
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister p_149651_1_)
    {
    this.blockIcon = p_149651_1_.registerIcon(TechMod.MODID + ":" + "el");
    this.top = p_149651_1_.registerIcon(TechMod.MODID + ":" + "el");
    this.front = p_149651_1_.registerIcon(TechMod.MODID + ":" + "el");
    this.field_150182_M = p_149651_1_.registerIcon(TechMod.MODID + ":" + "elCross");
    this.field_150183_N = p_149651_1_.registerIcon(TechMod.MODID + ":" + "elLine");
    this.field_150184_O = p_149651_1_.registerIcon(TechMod.MODID + ":" + "elCross_overlay");
    this.field_150180_P = p_149651_1_.registerIcon(TechMod.MODID + ":" + "elLine_overlay");
    this.blockIcon = this.field_150182_M;
    }
    
    }
    
    


  • peut tu mettre une image? j'ai reprit tes codes pour tester mais je n'ai pas de probleme moi(a par la texture )



  • Sinon tu crées une class qui hérite de BlockRedstoneWire, et tu @override les fonctions que tu veux changer
    (càd registerBlockIcons(…) et colorMultiplier(...))



  • Attention car ton cable peut se relier a la redstone