Modding FR

nostre

Aventurier
13 Novembre 2010
424
5
0
31
subject_mods_32.png

Minecraft est un jeu en plein développement,aussi bien du coté de chez Mojang que de celui de la communauté, qui ne cesse de développer toujours plus de mods et de extures packs.

Cependant, pour toute personne voulant tenter le modding de Minecraft,il faudra passer par les tutoriaux du forum officiel,où le français n'est pas vraiment courant.
De plus,si la personne en question ne connait pas un minimum certaines bases de code,sa devient vite un enfer de se lancer dans le domaines...

C'est pourquoi,devant l'absence total de tutoriel français sur le sujet,et afin d'encourager de nouveaux modder français,j'ai décidé de créer le 1er Tutoriel de Modding Minecraft FR.

Le but n'est pas seulement de créer un tutoriel en français,j'esseye de faire en sorte qu'il sois le plus accessible possible pour toutes personnes, compréhensible même pour des non initiés a toutes formes de codes (ou presque).

tutorial.gif


changelog.png
ChangeLog:
changelog.png

*27-02-11: Mise a jour des tutos I et III pour MCP 29a et ModLoader Beta 1.3_01v4.
*27-02-11: Correction d'une erreur dans le tuto II,merci a Woreck de me l'avoir fait remarquer !
*11-04-11: Mise a jour complète pour Minecraft Beta 1.4_01,MCP211 et ModLoader B1.4_01 v1.
*27-04-2011: Mise a jour pour Minecraft B1.5_01,MCP v2.12 et ModLoader v3 B1.5_01.
*30-04-2011: Correction d'une erreur avec les recettes,et mise a disposition des fichiers mod_MyMod.java et BlockMyBloc.java.
exclamation.gif
*29-05-11: Mise a jour pour Minecraft B1.6.5,MCP v3.3 et ModLoader v1 B1.6.5.


! Les liens suivants sont morts !

tuto.png

green-download-arrow-grey-line.png
Tutorial Modding FR - Téléchargement:
green-download-arrow-grey-line.png

asus_download_arrow004.gif
Tuto I - Téléchargement et installation
asus_download_arrow004.gif
Tuto II - Création d'un mod simple,ajout de nouveaux blocs
asus_download_arrow004.gif
Tuto III - Compilation et tests
asus_download_arrow004.gif
Tuto IV - Quelques petits trucs a savoir avant de continuer
asus_download_arrow004.gif
Tuto - Création de nouveaux objets
asus_download_arrow004.gif
Tuto - Ajouter des blocs et objets pour le four
asus_download_arrow004.gif
Tuto - Blocs – Autres possibilités
asus_download_arrow004.gif
Tuto - Autres possibilités - objets
asus_download_arrow004.gif
Sources du mod du Tuto II

Nouveaux fichiers ajoutés suite aux liens morts à la fin du message.
Il manque juste les "Sources du mod du Tuto II".
Je précise que ce sont les fichiers d'origine, le code est parfois obsolète !
 

Fichiers joints

lorsque je lance decompile.bat , ca met : WindowError: Error 5 acc?s refus
`temp`
(voir pièce jointe).

aidez moi S.V.P,
Merci d'avance.

[attachment=937]
 
bonjour j'aimerais bien qu'on m'explique comment decompiler car j'ai bon mettre les .class dans jars/minecraft/bin/minecraft.jar pui decompiler ensuite je vais dans src/minecraft/net/minecraft/src mais je ne trouve pas les dossier
 
normalement tu es sensé les trouver obligatoirement refait cleanup prend un minecraft.jar "neuf" ^^ supprime le dossier META-INF met modloader et tes ficheirs .class et sa devrais marcher
 
val166 a dit:
comment sa "sa marche qu'une seule fois "??

laisse tomber maintenant après avoir fait sa deux erreurs se sont installer dans enumtool voila le enumtool et voila les erreurs

Code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode 

package net.minecraft.src;


public enum EnumToolMaterial
{
    WOOD("WOOD", 0, 0, 59, 2.0F, 0),
    STONE("STONE", 1, 1, 131, 4F, 1),
    IRON("IRON", 2, 2, 250, 6F, 2),
    EMERALD("EMERALD", 3, 3, 1561, 8F, 3),
    GOLD("GOLD", 4, 0, 32, 12F, 0),
	MACHALITE("MACHALITE", 4, 3, 250, 50F, 1),
	DRAGONITE("DRAGONITE", 10, 10, 500, 5F, 2),
	CARBALITE("CARBALITE", 4, 6, 5000, 10F, 5),
	ELTALITE("ELTALITE", 4, 9, 32, 2.0F, 10),
	PURE("PURE", 10, 10, 5000, 50F, 10);
/*
    public static EnumToolMaterial[] values()
    {
        return (EnumToolMaterial[])$VALUES.clone();
    }

    public static EnumToolMaterial valueOf(String s)
    {
        return (EnumToolMaterial)Enum.valueOf(net.minecraft.src.EnumToolMaterial.class, s);
    }

    private EnumToolMaterial(String s, int i, String s1, int j, int k, int l, float f, 
            int i1)
    {
        super(s, i);
        harvestLevel = k;
        maxUses = l;
        efficiencyOnProperMaterial = f;
        damageVsEntity = i1;
    }

    public int getMaxUses()
    {
        return maxUses;
    }

    public float getEfficiencyOnProperMaterial()
    {
        return efficiencyOnProperMaterial;
    }

    public int getDamageVsEntity()
    {
        return damageVsEntity;
    }

    public int getHarvestLevel()
    {
        return harvestLevel;
    }

    public static final EnumToolMaterial WOOD;
    public static final EnumToolMaterial STONE;
    public static final EnumToolMaterial IRON;
    public static final EnumToolMaterial EMERALD;
    public static final EnumToolMaterial GOLD;
    public static final EnumToolMaterial MACHALITE;
    public static final EnumToolMaterial DRAGONITE;
    public static final EnumToolMaterial CARBALITE;
    public static final EnumToolMaterial ELTALITE;
    public static final EnumToolMaterial PURE;
    private final int harvestLevel;
    private final int maxUses;
    private final float efficiencyOnProperMaterial;
    private final int damageVsEntity;
    private static final EnumToolMaterial $VALUES[]; /* synthetic field */

    static 
    {
        WOOD = new EnumToolMaterial("WOOD", 0, "WOOD", 0, 0, 59, 2.0F, 0);
        STONE = new EnumToolMaterial("STONE", 1, "STONE", 1, 1, 131, 4F, 1);
        IRON = new EnumToolMaterial("IRON", 2, "IRON", 2, 2, 250, 6F, 2);
        EMERALD = new EnumToolMaterial("EMERALD", 3, "EMERALD", 3, 3, 1561, 8F, 3);
        GOLD = new EnumToolMaterial("GOLD", 4, "GOLD", 4, 0, 32, 12F, 0);
        MACHALITE = new EnumToolMaterial("MACHALITE", 5, "MACHALITE", 4, 3, 250, 50F, 1);
        DRAGONITE = new EnumToolMaterial("DRAGONITE", 6, "DRAGONITE", 10, 10, 500, 5F, 2);
        CARBALITE = new EnumToolMaterial("CARBALITE", 7, "CARBALITE", 4, 6, 5000, 10F, 5);
        ELTALITE = new EnumToolMaterial("ELTALITE", 8, "ELTALITE", 4, 9, 32, 2.0F, 10);
        PURE = new EnumToolMaterial("PURE", 9, "PURE", 10, 10, 5000, 50F, 10);
        $VALUES = (new EnumToolMaterial[] {
            WOOD, STONE, IRON, EMERALD, GOLD, MACHALITE, DRAGONITE, CARBALITE, ELTALITE, PURE
        });
    }
	*/
}

et les erreurs

Code:
== MCP v4.1 ==
> Recompiling client...
javac.exe -g -verbose -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jin
put.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d
 bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minec
raft\isom\*.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java fai
led.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\EnumToolMaterial.java:93: illegal start of type
*/
^

src\minecraft\net\minecraft\src\EnumToolMaterial.java:93: ';' expected
*/
^

2 errors
==================

> Done in 1.19 seconds
> Recompiling server...
!! Can not find server sources !!
Appuyez sur une touche pour continuer...

ne me dite pas de suprimer */ sa donne 45 erreurs
 
enumtoolmatérial c'est tout un art pour pas avoir d'erreur avec se fichiers^^ prend le fichier d'origine et rajoute y se que tu as rajouter avec un bon vieux copier coller des changements que tu avait déjà effectuer tu devrais avoir 0 erreur c'est se que je faisait quand j'avias des erreur avec !
 
Bon je up mon probleme page 159 et voici le code de mon bloc :

Code:
package net.minecraft.src;

import java.util.Random;

public class BlockFarm extends Block
{

    protected BlockFarm(int i)
    {
        super(i, Material.ground);
        blockIndexInTexture = 87;
        setTickOnLoad(true);
        setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
        setLightOpacity(255);
    }

    public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
    {
        return AxisAlignedBB.getBoundingBoxFromPool(i + 0, j + 0, k + 0, i + 1, j + 1, k + 1);
    }

    public boolean isOpaqueCube()
    {
        return false;
    }

    public boolean renderAsNormalBlock()
    {
        return false;
    }

    public int getBlockTextureFromSideAndMetadata(int i, int j)
    {
        if(i == 1 && j > 0)
        {
            return blockIndexInTexture - 1;
        }
        if(i == 1)
        {
            return blockIndexInTexture;
        } else
        {
            return 2;
        }
    }

    public void updateTick(World world, int i, int j, int k, Random random)
    {
        if(random.nextInt(5) == 0)
        {
            if(isWaterNearby(world, i, j, k) || world.canBlockBeRainedOn(i, j + 1, k))
            {
                world.setBlockMetadataWithNotify(i, j, k, 7);
            } else
            {
                int l = world.getBlockMetadata(i, j, k);
                if(l > 0)
                {
                    world.setBlockMetadataWithNotify(i, j, k, l - 1);
                } else
                if(!isCropsNearby(world, i, j, k))
                {
                    world.setBlockWithNotify(i, j, k, Block.dirt.blockID);
                }
            }
        }
    }

    public void onEntityWalking(World world, int i, int j, int k, Entity entity)
    {
        if(world.rand.nextInt(4) == 0)
        {
            world.setBlockWithNotify(i, j, k, Block.dirt.blockID);
        }
    }

    private boolean isCropsNearby(World world, int i, int j, int k)
    {
        int l = 0;
        for(int i1 = i - l; i1 <= i + l; i1++)
        {
            for(int j1 = k - l; j1 <= k + l; j1++)
            {
                if(world.getBlockId(i1, j + 1, j1) == mod_MoreFood.tomate.blockID)
                {
                    return true;
                }
            }

        }

        return false;
    }

    private boolean isWaterNearby(World world, int i, int j, int k)
    {
        for(int l = i - 4; l <= i + 4; l++)
        {
            for(int i1 = j; i1 <= j + 1; i1++)
            {
                for(int j1 = k - 4; j1 <= k + 4; j1++)
                {
                    if(world.getBlockMaterial(l, i1, j1) == Material.water)
                    {
                        return true;
                    }
                }

            }

        }

        return false;
    }

    public void onNeighborBlockChange(World world, int i, int j, int k, int l)
    {
        super.onNeighborBlockChange(world, i, j, k, l);
        Material material = world.getBlockMaterial(i, j + 1, k);
        if(material.isSolid())
        {
            world.setBlockWithNotify(i, j, k, Block.dirt.blockID);
        }
        if(world.getBlockId(i, j + 1, k) != mod_MoreFood.tomate.blockID)
        {
        	int l1 = world.getBlockMetadata(i, j, k);
    		world.setBlockAndMetadata(i, j, k, Block.tilledField.blockID, l1);
        }
    }

    public int idDropped(int i, Random random)
    {
        return Block.dirt.idDropped(0, random);
    }
}

Il ressemble en grande partie à celui de BlockFarmland.