MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Texture Sapling inexistantes

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.x
    29 Messages 9 Publieurs 6.6k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • kevin_68K Hors-ligne
      kevin_68 Moddeurs confirmés
      dernière édition par

      Vérifie le nom de la texture dans le dossier textures/blocks/
      ça doit être “sapling_aeza.png”


      Mettez à jours vers la dernière version stable (1.8.9 voir même…

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R Hors-ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        Bon alors :
        private static final String __OBFID = “CL_00000305”;
        ça tu l’enlève, ça va créer des problèmes d’obfucations.

        Enlève aussi :
        @SideOnly(Side.CLIENT)
        private IIcon field_150201_a;

        @SideOnly(Side.CLIENT)
        public void registerBlockIcons(IIconRegister p_149651_1_)
        {
        p_149651_1_.registerIcon(this.textureName);

        }
        Et à la place de :
        @SideOnly(Side.CLIENT)
        public IIcon getIcon(int p_149691_1_, int p_149691_2_)
        { //p_149691_1_ != 1 && p_149691_1_ != 0 ? this.blockIcon :
        return this.field_150201_a;
        }
        Mets :
        @SideOnly(Side.CLIENT)
        public IIcon getIcon(int side, int medata)
        {
        return this.blockIcon;
        }
        Et ensuite dans le constructeur mets :
        .setTextureName(“modid:nom de ta texture”);

        1 réponse Dernière réponse Répondre Citer 0
        • K Hors-ligne
          Kushhh
          dernière édition par

          bon je vois pas d’ou viens le problème, le nom de la texture est bon, j’ai fait les modif que robin m’as conseillée mais toujours ces P****** de carré noir et roses …

          1 réponse Dernière réponse Répondre Citer 0
          • DiangleD Hors-ligne
            Diangle
            dernière édition par

            tu peux m’envoyer ton code (src) par MP ?

            1 réponse Dernière réponse Répondre Citer 0
            • K Hors-ligne
              Kushhh
              dernière édition par

              j’peux te filer mon github ?

              1 réponse Dernière réponse Répondre Citer 0
              • Superloup10S Hors-ligne
                Superloup10 Modérateurs
                dernière édition par

                Je te mets un 0/20 en respect de la convention JAVA.
                Retourne voir les tutoriels du forum + retourne apprendre les bases de Java

                Si vous souhaitez me faire un don, il vous suffit de cliquer sur le bouton situé en dessous.

                Je suis un membre apprécié et joueur, j'ai déjà obtenu 17 points de réputation.

                1 réponse Dernière réponse Répondre Citer 0
                • K Hors-ligne
                  Kushhh
                  dernière édition par

                  sympa …

                  1 réponse Dernière réponse Répondre Citer 0
                  • DiangleD Hors-ligne
                    Diangle
                    dernière édition par

                    STP, je ne vais rien faire avec un code plein d’erreur donc corrige tous et donne moi le github une fois mis a jours. Tu as des truc de la 1.6 dans un code 1.7 !

                    1 réponse Dernière réponse Répondre Citer 0
                    • K Hors-ligne
                      Kushhh
                      dernière édition par

                      Mon code est mal organisé, je sais mais, c’est exactement le meme que les autres sapling (vanilla ) sauf que j’ai retiré les meta datas


                      j’ai tout arrangé (normalement)
                      BlockAezaSapling :

                      package net.KSH.mod.WO.Blocks;
                      
                      import java.util.List;
                      import java.util.Random;
                      
                      import net.KSH.mod.Main;
                      import net.KSH.mod.WO.aezaria.WorldGenerators.WorldGenAezaNormalTree;
                      import net.KSH.mod.WO.aezaria.WorldGenerators.WorldGenAezaPurpleTree;
                      import net.minecraft.block.Block;
                      import net.minecraft.block.BlockBush;
                      import net.minecraft.block.IGrowable;
                      import net.minecraft.block.material.Material;
                      import net.minecraft.client.renderer.texture.IIconRegister;
                      import net.minecraft.creativetab.CreativeTabs;
                      import net.minecraft.init.Blocks;
                      import net.minecraft.item.Item;
                      import net.minecraft.item.ItemStack;
                      import net.minecraft.util.IIcon;
                      import net.minecraft.util.MathHelper;
                      import net.minecraft.world.World;
                      import net.minecraft.world.gen.feature.WorldGenBigTree;
                      import net.minecraft.world.gen.feature.WorldGenCanopyTree;
                      import net.minecraft.world.gen.feature.WorldGenForest;
                      import net.minecraft.world.gen.feature.WorldGenMegaJungle;
                      import net.minecraft.world.gen.feature.WorldGenMegaPineTree;
                      import net.minecraft.world.gen.feature.WorldGenSavannaTree;
                      import net.minecraft.world.gen.feature.WorldGenTaiga2;
                      import net.minecraft.world.gen.feature.WorldGenTrees;
                      import net.minecraft.world.gen.feature.WorldGenerator;
                      import cpw.mods.fml.relauncher.Side;
                      import cpw.mods.fml.relauncher.SideOnly;
                      
                      public class BlockAezaSapling extends CustomBlockBush implements IGrowable
                      {
                      /**
                      * Constructeur
                      */
                      protected BlockAezaSapling()
                      {
                      super(Material.plants);
                      float f = 0.4F;
                      this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
                      this.setCreativeTab(Main.WO);
                      this.setTickRandomly(true);
                      this.setBlockName("aezasapling");
                      this.setBlockTextureName("worldorigins:sapling");
                      }
                      /**
                      * Ticking
                      */
                      public void updateTick(World world, int PosX, int PosY, int PosZ, Random random)
                      {
                      if (!world.isRemote)
                      {
                      super.updateTick(world, PosX, PosY, PosZ, random);
                      
                      if (world.getBlockLightValue(PosX, PosY + 1, PosZ) >= 9 && random.nextInt(7) == 0)
                      {
                      this.func_149879_c(world, PosX, PosY, PosZ, random);
                      }
                      }
                      }
                      /**
                      * Texture
                      */
                      
                      @SideOnly(Side.CLIENT)
                      public void registerBlockIcons(IIconRegister IIconRegisterer)
                      {
                      IIconRegisterer.registerIcon(this.textureName);
                      
                      }
                      @SideOnly(Side.CLIENT)
                      public IIcon getIcon(int p_149691_1_, int p_149691_2_)
                      {
                      return this.blockIcon;
                      }
                      /**
                      * Generating
                      */
                      
                      public void func_149879_c(World world, int PosX, int PosY, int PosZ, Random random)
                      {
                      
                      this.func_149878_d(world, PosX, PosY, PosZ, random);
                      
                      }
                      
                      public void func_149878_d(World world, int PosX, int PosY, int PosZ, Random random)
                      {
                      if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, random, PosX, PosY, PosZ)) return;
                      int l = world.getBlockMetadata(PosX, PosY, PosZ) & 7;
                      Object object = random.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
                      boolean flag = false;
                      object = new WorldGenAezaNormalTree(true);
                      ((WorldGenerator)object).generate(world, random, PosX, PosY, PosZ);
                      
                      }
                      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 true;
                      }
                      
                      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 (double)p_149852_1_.rand.nextFloat() < 0.45D;
                      }
                      
                      public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_)
                      {
                      this.func_149879_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_);
                      }
                      
                      }
                      

                      et CutomBlockBush

                      package net.KSH.mod.WO.Blocks;
                      
                      import static net.minecraftforge.common.EnumPlantType.Cave;
                      import static net.minecraftforge.common.EnumPlantType.Crop;
                      import static net.minecraftforge.common.EnumPlantType.Desert;
                      import static net.minecraftforge.common.EnumPlantType.Nether;
                      import static net.minecraftforge.common.EnumPlantType.Plains;
                      import static net.minecraftforge.common.EnumPlantType.Water;
                      
                      import java.util.Random;
                      
                      import net.minecraft.block.Block;
                      import net.minecraft.block.material.Material;
                      import net.minecraft.creativetab.CreativeTabs;
                      import net.minecraft.init.Blocks;
                      import net.minecraft.util.AxisAlignedBB;
                      import net.minecraft.world.IBlockAccess;
                      import net.minecraft.world.World;
                      import net.minecraftforge.common.EnumPlantType;
                      import net.minecraftforge.common.IPlantable;
                      import net.minecraftforge.common.util.ForgeDirection;
                      
                      public class CustomBlockBush extends Block implements IPlantable
                      {
                      /**
                      * Constructeur
                      */
                      protected CustomBlockBush(Material p_i45395_1_)
                      {
                      super(p_i45395_1_);
                      this.setTickRandomly(true);
                      float f = 0.2F;
                      this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f);
                      this.setCreativeTab(CreativeTabs.tabDecorations);
                      }
                      
                      /**
                      * Check si le block peux etre placé en X Y Z
                      */
                      public boolean canPlaceBlockAt(World world, int PosX, int PosY, int PosZ)
                      {
                      return super.canPlaceBlockAt(world, PosX, PosY, PosZ) && this.canBlockStay(world, PosX, PosY, PosZ);
                      }
                      
                      /**
                      * Definis sur quel block peux etre placé la plante
                      */
                      protected boolean canPlaceBlockOn(Block block)
                      {
                      return block == BlockList.aezagrass || block == BlockList.aezadirt;
                      }
                      
                      /**
                      * Changement d'état d'un block a proximité
                      */
                      public void onNeighborBlockChange(World world, int PosX, int PosY, int PosZ, Block block)
                      {
                      super.onNeighborBlockChange(world, PosX, PosY, PosZ, block);
                      this.checkAndDropBlock(world, PosX, PosY, PosZ);
                      }
                      
                      /**
                      * Ticking
                      */
                      public void updateTick(World world, int PosX, int PosY, int PosZ, Random random)
                      {
                      this.checkAndDropBlock(world, PosX, PosY, PosZ);
                      }
                      
                      /**
                      * teste si le block peux rester, sinon on le drop en tant qu'item
                      */
                      protected void checkAndDropBlock(World world, int PosX, int PosY, int PosZ)
                      {
                      if (!this.canBlockStay(world, PosX, PosY, PosZ))
                      {
                      this.dropBlockAsItem(world, PosX, PosY, PosZ, world.getBlockMetadata(PosX, PosY, PosZ), 0);
                      world.setBlock( PosX, PosY, PosZ, getBlockById(0), 0, 2);
                      }
                      }
                      
                      /**
                      * comme canBlockStayAt mais, s'execute tout le temps
                      */
                      public boolean canBlockStay(World world, int PosX, int PosY, int PosZ)
                      {
                      return world.getBlock(PosX, PosY -1, PosZ).canSustainPlant(world, PosX, PosY-1, PosZ, ForgeDirection.UP, this);
                      }
                      
                      /**
                      * Hitbox
                      */
                      public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
                      {
                      return null;
                      }
                      
                      /**
                      * block non opaque (!= 1m cube)
                      */
                      public boolean isOpaqueCube()
                      {
                      return false;
                      }
                      
                      /**
                      * rendu normal ou pas (non)
                      */
                      public boolean renderAsNormalBlock()
                      {
                      return false;
                      }
                      
                      /**
                      * type du render
                      */
                      public int getRenderType()
                      {
                      return 1;
                      }
                      /**
                      * retourne le type de plante (plaine = sapling)
                      */
                      @Override
                      public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
                      {
                      
                      return Plains;
                      }
                      /**
                      * retourne la plante (this)
                      */
                      @Override
                      public Block getPlant(IBlockAccess world, int x, int y, int z)
                      {
                      return this;
                      }
                      /**
                      * MetaDonnées
                      */
                      @Override
                      public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
                      {
                      return world.getBlockMetadata(x, y, z);
                      }
                      }
                      
                      1 réponse Dernière réponse Répondre Citer 0
                      • ÜberfapÜ Hors-ligne
                        Überfap
                        dernière édition par

                        this.setBlockTextureName(“worldorigins:sapling”);

                        Ce devrait être aezasapling, non ?

                        Si je t'ai aidé, n'hésites pas à mettre un point de réputation positif !
                        Si tu m'as aidé, je n'hésiterais pas à t'en donner à mon tour !

                        1 réponse Dernière réponse Répondre Citer 0
                        • RedRelayR Hors-ligne
                          RedRelay Moddeurs confirmés
                          dernière édition par

                          Croit moi Kushhh, tu y gagnerai plus a prendre en compte la remarque de Superloup10 plutôt que de la prendre comme une attaque personnelle.
                          La clareté du code c’est la base.

                          –------------------------------------------------------------------------------------
                          Si tu trouves mon intervention pertinente, n'hésite pas a m…

                          1 réponse Dernière réponse Répondre Citer 0
                          • DiangleD Hors-ligne
                            Diangle
                            dernière édition par

                            @‘Blackout’:

                            Croit moi Kushhh, tu y gagnerai plus a prendre en compte la remarque de Superloup10 plutôt que de la prendre comme une attaque personnelle.
                            La clareté du code c’est la base.

                            Si tu doit bosser en équipe et que tu code comme un pied tu vas te faire viré.

                            1 réponse Dernière réponse Répondre Citer 0
                            • K Hors-ligne
                              Kushhh
                              dernière édition par

                              je déteste coder en équipe 😞
                              sans doute pour ça que je code pas du tout clairement … bref j’vais revoir les bases du java mais ce p*tain de problème
                              mais sinon la texture fonctionne quand je l’applique sur un block Plein

                              1 réponse Dernière réponse Répondre Citer 0
                              • 1
                              • 2
                              • 1 / 2
                              • Premier message
                                Dernier message
                              Design by Woryk
                              ContactMentions Légales

                              MINECRAFT FORGE FRANCE © 2024

                              Powered by NodeBB