• Récent
  • Mots-clés
  • Populaire
  • Utilisateurs
  • Groupes
  • S'inscrire
  • Se connecter
  • S'inscrire
  • Se connecter
  • Recherche
  • Récent
  • Mots-clés
  • Populaire
  • Utilisateurs
  • Groupes

Résolu Texture Sapling inexistantes

1.7.x
1.7.x
9
29
5.9k
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.
  • K
    Kushhh dernière édition par 19 juil. 2014, 17:33

    j’peux te filer mon github ?

    1 réponse Dernière réponse Répondre Citer 0
    • Superloup10
      Superloup10 Modérateurs dernière édition par 19 juil. 2014, 17:53

      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
        Kushhh dernière édition par 19 juil. 2014, 18:23

        sympa …

        1 réponse Dernière réponse Répondre Citer 0
        • Diangle
          Diangle dernière édition par 19 juil. 2014, 18:28

          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
            Kushhh dernière édition par 19 juil. 2014, 19:55

            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
              Überfap dernière édition par 20 juil. 2014, 12:42

              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
              • RedRelay
                RedRelay Moddeurs confirmés dernière édition par 20 juil. 2014, 14:39

                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
                • Diangle
                  Diangle dernière édition par 20 juil. 2014, 14:59

                  @‘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
                    Kushhh dernière édition par 20 juil. 2014, 17:36

                    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
                    • 2 / 2
                    29 sur 29
                    • Premier message
                      29/29
                      Dernier message
                    Design by Woryk
                    Contact / Mentions Légales

                    MINECRAFT FORGE FRANCE © 2018

                    Powered by NodeBB