Modding FR

nostre

Aventurier
13 Novembre 2010
424
5
0
30
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

Ouais pourquoi pas... mais ça risque pas de rendre tous les blocs de pierre incassable dans cet exemple ? Genre je sélectionne un bloc et tous les blocs du même type deviennent incassables !
EDIT: Frenchdeath : As- tu suivi les tutos de nostres ? Disponible au début de ce topic.
Avec ça tu devrais avoir aucun problème à décompiler et recompiler non ?
 
Shuyin76 -> Oui ça rend tout les blocs d'un même type incassable...Mais je voit pas d'autre solution.
FrenchDeath -> Tu bloque a quel niveau ?
 
bas j'ai meme pas les fichier class et sa fait longtemp que j'ai abandoner sa
mais si tu peut m'aider voila le mod que j'ai creé avec des tuto anglai
Code:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Random;

public class mod_DIDiamand extends BaseMod
{
  public static int dIDiamandid = 3000;
  public static int dIDiamandswordid = 3001;
  public static int dIDiamandpickid = 3002;
  public static int dIDiamandshovelid = 3003;
  public static int dIDiamandaxeid = 3004;
  public static int dIDiamandblockid = 101;
  public static int dIDiamandhelmid = 3006;
  public static int dIDiamandchestid = 3007;
  public static int dIDiamandlegsid = 3008;
  public static int dIDiamandbootsid = 3009;
  public static int dIDiamandoreid = 100;
  public static File file;
  public static File file2;
  private static boolean set = Set();
  public static final qk dIDiamandore = new BlockDIDiamand(dIDiamandoreid, 0).c(8.0F).a(qk.h).a("dIDiamandIngot ore");
  public static final qk dIDiamandblock = new BlockDIDiamand(dIDiamandblockid, 0).c(12.0F).b(200.0F).a(qk.h).a("dIDiamond block");
  public static final ex dIDiamandIngot = new ex(dIDiamandid).a(14, 7).a("dIDiamandidIngot");
  public static final ex dIDiamandpick = new aj(dIDiamandpickid, az.dIDiamand).a("dIDiamandpick");
  public static final ex dIDiamandshovel = new rk(dIDiamandshovelid, az.dIDiamand).a("dIDiamandshovel");
  public static final ex dIDiamandaxe = new ox(dIDiamandaxeid, az.dIDiamand).a("dIDiamandaxe");
  public static final ex dIDiamandsword = new mm(dIDiamandswordid, az.dIDiamand).a("dIDiamandsword");
  public static final ex dIDiamandhelm = new ri(dIDiamandhelmid, 4, ModLoader.AddArmor("dIDiamandarmor"), 0).a("dIDiamand Helm");
  public static final ex dIDiamandchest = new ri(dIDiamandchestid, 4, ModLoader.AddArmor("dIDiamandarmor"), 1).a("dIDiamandIngot Chestplate");
  public static final ex dIDiamandlegs = new ri(dIDiamandlegsid, 4, ModLoader.AddArmor("dIDiamandarmor"), 2).a("dIDiamand Platelegs");
  public static final ex dIDiamandboots = new ri(dIDiamandbootsid, 4, ModLoader.AddArmor("dIDiamandarmor"), 3).a("dIDiamand Boots");
  public static int dIDiamandoredrop = dIDiamandore.bk;
  public static int dIDiamandblockdrop = dIDiamandblock.bk;

  public String Version()
  {
    return "Beta 1.3_01";
  }

  private static boolean Set()
  {
    if (isWindows())
    {
      localObject = System.getenv("AppData");
      file = new File((String)localObject + "\\.minecraft\\bin\\DIDiamandBlockIDs.properties");
      file2 = new File((String)localObject + "\\.minecraft\\bin\\DIDiamandItem.properties");
    } else if (isMac())
    {
      localObject = System.getProperty("user.home");
      file = new File((String)localObject + "/library/application\\ support/minecraft/bin/DIDiamandBlockIDs.properties");
      file2 = new File((String)localObject + "/library/application\\ support/minecraft/bin/DIDiamandItemIDs.properties");
    } else if (isUnix())
    {
      localObject = System.getProperty("user.home");
      file = new File((String)localObject + "/.minecraft/bin/DIDiamandBlockIDs.properties");
      file2 = new File((String)localObject + "/.minecraft/bin/DIDiamandItemIDs.properties");
    } else {
      System.out.println("sorry, your operating system can't change the ids :/");
    }
    Object localObject = new SortedProperties();
    SortedProperties localSortedProperties = new SortedProperties();
    try {
      ((SortedProperties)localObject).load(new FileInputStream(file));
      dIDiamandblockid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandblock").trim());
      dIDiamandoreid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandore").trim());
    }
    catch (FileNotFoundException localFileNotFoundException1) {
      System.out.println("couldn't find file");
      try {
        ((SortedProperties)localObject).setProperty("DIDiamandblock", "101");
        ((SortedProperties)localObject).setProperty("DIDiamandore", "100");
        String str1;
        if (isWindows())
        {
          str1 = System.getenv("AppData");
          ((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "\\.minecraft\\bin\\DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        } else if (isMac())
        {
          str1 = System.getProperty("user.home");
          ((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "/library/application support/minecraft/bin/DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        } else if (isUnix())
        {
          str1 = System.getProperty("user.home");
          ((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "/.minecraft/bin/DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        }
        else {
          System.out.println("sorry, your operating system can't change the ids :/");
        }
        try
        {
          ((SortedProperties)localObject).load(new FileInputStream(file));
          dIDiamandblockid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandblock").trim());
          dIDiamandoreid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandore").trim());
        } catch (IOException localIOException5) {
          localIOException5.printStackTrace();
        }
      }
      catch (FileNotFoundException localFileNotFoundException3) {
        localFileNotFoundException3.printStackTrace();
      }
      catch (IOException localIOException3) {
        localIOException3.printStackTrace();
      }
    }
    catch (IOException localIOException1) {
      localIOException1.printStackTrace();
    }
    try
    {
      localSortedProperties.load(new FileInputStream(file2));
      dIDiamandhelmid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandhelm").trim()) - 256;
      dIDiamandchestid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandchest").trim()) - 256;
      dIDiamandlegsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandlegs").trim()) - 256;
      dIDiamandbootsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandboots").trim()) - 256;
      dIDiamandswordid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandsword").trim()) - 256;
      dIDiamandpickid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandpick").trim()) - 256;
      dIDiamandshovelid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandshovel").trim()) - 256;
      dIDiamandaxeid = Integer.parseInt(localSortedProperties.getProperty("dIDiamanddaxe").trim()) - 256;
      dIDiamandid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandIngot").trim()) - 256;
    } catch (FileNotFoundException localFileNotFoundException2) {
      System.out.println("couldn't find file");
      try
      {
        localSortedProperties.setProperty("dIDiamandpick", "3002");
        localSortedProperties.setProperty("dIDiamandIngot", "3000");
        localSortedProperties.setProperty("dIDiamandhelm", "3006");
        localSortedProperties.setProperty("dIDiamandchest", "3007");
        localSortedProperties.setProperty("dIDiamandlegs", "3008");
        localSortedProperties.setProperty("dIDiamandboots", "3009");
        localSortedProperties.setProperty("dIDiamandsword", "3001");
        localSortedProperties.setProperty("dIDiamandaxe", "3004");
        localSortedProperties.setProperty("dIDiamandshovel", "3003");
        String str2;
        if (isWindows())
        {
          str2 = System.getenv("AppData");
          localSortedProperties.store(new FileOutputStream(new File(str2 + "\\.minecraft\\bin\\DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        } else if (isMac())
        {
          str2 = System.getProperty("user.home");
          localSortedProperties.store(new FileOutputStream(new File(str2 + "/library/application support/minecraft/bin/DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        } else if (isUnix())
        {
          str2 = System.getProperty("user.home");
          localSortedProperties.store(new FileOutputStream(new File(str2 + "/.minecraft/bin/DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
        } else {
          System.out.println("sorry, your operating system can't change the ids :/");
        }
        try
        {
          localSortedProperties.load(new FileInputStream(file2));
          dIDiamandhelmid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandhelm").trim()) - 256;
          dIDiamandchestid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandchest").trim()) - 256;
          dIDiamandlegsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandlegs").trim()) - 256;
          dIDiamandbootsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandboots").trim()) - 256;
          dIDiamandswordid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandsword").trim()) - 256;
          dIDiamandpickid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandpick").trim()) - 256;
          dIDiamandshovelid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandshovel").trim()) - 256;
          dIDiamandaxeid = Integer.parseInt(localSortedProperties.getProperty("dIDiamanddaxe").trim()) - 256;
          dIDiamandid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandIngot").trim()) - 256;
        }
        catch (IOException localIOException6) {
          localIOException6.printStackTrace();
        }
      } catch (FileNotFoundException localFileNotFoundException4) {
        localFileNotFoundException4.printStackTrace();
      }
      catch (IOException localIOException4) {
        localIOException4.printStackTrace();
      }
    }
    catch (IOException localIOException2) {
      localIOException2.printStackTrace();
    }
    return true;
  }

  public void AddRecipes(fr paramfr)
  {
    paramfr.a(new gz(dIDiamandpick, 1), new Object[] { "###", " X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });

    paramfr.a(new gz(dIDiamandshovel, 1), new Object[] { " # ", " X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });

    paramfr.a(new gz(dIDiamandaxe, 1), new Object[] { "## ", "#X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });

    paramfr.a(new gz(dIDiamandsword, 1), new Object[] { "# ", " # ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });

    paramfr.a(new gz(dIDiamandchest, 1), new Object[] { "# #", "###", "###", Character.valueOf('#'), dIDiamandIngot });

    paramfr.a(new gz(dIDiamandboots, 1), new Object[] { "# #", "# #", Character.valueOf('#'), dIDiamandIngot });

    paramfr.a(new gz(dIDiamandlegs, 1), new Object[] { "###", "# #", "# #", Character.valueOf('#'), dIDiamandIngot });

    paramfr.a(new gz(dIDiamandhelm, 1), new Object[] { "###", "# #", Character.valueOf('#'), dIDiamandIngot });
  }

  public void GenerateSurface(dt paramdt, Random paramRandom, int paramInt1, int paramInt2)
  {
    for (int i = 0; i < 10; i++)
    {
      int j = paramInt1 + paramRandom.nextInt(16);
      int k = paramRandom.nextInt(10);
      int m = paramInt2 + paramRandom.nextInt(16);
      new eb(dIDiamandore.bk, 1).a(paramdt, paramRandom, j, k, m);
    }
  }

  public void GenerateNether(dt paramdt, Random paramRandom, int paramInt1, int paramInt2)
  {
    int i = paramRandom.nextInt(2) + 1;
    for (int j = 0; j < i; j++)
    {
      int k = paramInt1 + paramRandom.nextInt(16);
      int m = paramRandom.nextInt(64);
      int n = paramInt2 + paramRandom.nextInt(16);
      new eb(dIDiamandore.bk, 1).a(paramdt, paramRandom, k, m, n);
    }
  }

  public static boolean isWindows()
  {
    String str = System.getProperty("os.name").toLowerCase();
    return str.indexOf("win") >= 0;
  }
  public static boolean isMac() {
    String str = System.getProperty("os.name").toLowerCase();
    return str.indexOf("mac") >= 0;
  }
  public static boolean isUnix() {
    String str = System.getProperty("os.name").toLowerCase();
    return (str.indexOf("nix") >= 0) || (str.indexOf("nux") >= 0);
  }

  public mod_DIDiamand() {
    ModLoader.RegisterBlock(dIDiamandblock);
    ModLoader.RegisterBlock(dIDiamandore);
    dIDiamandore.bj = ModLoader.addOverride("/terrain.png", "/Minerpack/dIDiamandOre.png");
    dIDiamandblock.bj = ModLoader.addOverride("/terrain.png", "/Minerpack/dIDiamandblock.png");
    dIDiamandpick.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandPick.png");
    dIDiamandaxe.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandAxe.png");
    dIDiamandshovel.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandShovel.png");
    dIDiamandIngot.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandIngot.png");
    dIDiamandsword.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandSword.png");
    dIDiamandhelm.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandhelm.png");
    dIDiamandchest.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandchest.png");
    dIDiamandlegs.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandlegs.png");
    dIDiamandboots.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandboots.png");
    ModLoader.AddName(dIDiamandhelm, "DIDiamand Helm");
    ModLoader.AddName(dIDiamandchest, "DIDiamand Chestplate");
    ModLoader.AddName(dIDiamandlegs, "DIDiamand Platelegs");
    ModLoader.AddName(dIDiamandboots, "DIDiamand Boots");
    ModLoader.AddName(dIDiamandore, "DIDiamand Ore");
    ModLoader.AddName(dIDiamandblock, "DIDiamand Block");
    ModLoader.AddName(dIDiamandaxe, "DIDiamand Axe");
    ModLoader.AddName(dIDiamandpick, "DIDiamand Pickaxe");
    ModLoader.AddName(dIDiamandsword, "DIDiamand Sword");
    ModLoader.AddName(dIDiamandIngot, "DIDiamand Ingot");
    ModLoader.AddName(dIDiamandshovel, "DIDiamand Shovel");
    ModLoader.AddSmelting(dIDiamandore.bk, new gz(dIDiamandIngot));
  }

  public static void main(String[] paramArrayOfString)
  {
  }
}
j'ai les fichier qui faut mais quand je demare sa me fait sa
[video=youtube]http://www.youtube.com/watch?v=wEsabMj-Yec&feature=channel_video_title[/video]

DSL du Double post mais j'ai reaysayer mais EPIC FAIL
tout ce passe bien j'ai les fichier class je met mon PNG dans minecraft ainsi que mes fichier class mais quand je fait la redcipe rien ne ce passe

Code:
package net.minecraft.src;
public class mod_arrowBox extends BaseMod
{
public mod_arrowBox()
{
ArrowBox = (new arrowBox(99)).setIconIndex(ModLoader.addOverride("/gui/items.png","mod/arrowBox.png")).setItemName("arrowBox");
ModLoader.AddName(ArrowBox, "Arrows Box");
}
public String Version()
{
return "1.3_01";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(ArrowBox, 64), new Object[] {"###","###","###",Character.valueOf('#'), Item.arrow});
}
public static Item ArrowBox;
}
et
Code:
package net.minecraft.src;
public class arrowBox extends Item
{
public arrowBox(int i)
{
super(i);
maxStackSize = 64;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
super.onItemRightClick(itemstack, world, entityplayer);
return new ItemStack(Item.arrow, 64);
}
}
aide moi STP
 
Merci pour les tutos !
Ils sont très clair.

Je voulais me mettre au modding ayant quelques idées de mods mais je ne connais pas java et ca m'a décidé à m'y mettre !

Continue comme ca ^^
 
Sympa les tutoriels, mais je voudrais savoir quelque chose, est-il possible de faire la même chose sur un serveur, à savoir ajouter de nouveaux blocks, de nouveaux items entierement personalisé ?
 
FrenchDeath a dit:
tout ce passe bien j'ai les fichier class je met mon PNG dans minecraft ainsi que mes fichier class mais quand je fait la redcipe rien ne ce passe

Code:
package net.minecraft.src;
public class mod_arrowBox extends BaseMod
{
public mod_arrowBox()
{
ArrowBox = (new arrowBox(99)).setIconIndex(ModLoader.addOverride("/gui/items.png","mod/arrowBox.png")).setItemName("arrowBox");
ModLoader.AddName(ArrowBox, "Arrows Box");
}
public String Version()
{
return "1.3_01";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(ArrowBox, 64), new Object[] {"###","###","###",Character.valueOf('#'), Item.arrow});
}
public static Item ArrowBox;
}


Tu as oublié un / à cette ligne :
Code:
ArrowBox = (new arrowBox(99)).setIconIndex(ModLoader.addOverride("/gui/items.png","mod/arrowBox.png")).setItemName("arrowBox");
ModLoader.AddName(ArrowBox, "Arrows Box");

A mettre devant le mod/arrowBox.png, comme ceci :
Code:
ArrowBox = (new arrowBox(99)).setIconIndex(ModLoader.addOverride("/gui/items.png","/mod/arrowBox.png")).setItemName("arrowBox");
ModLoader.AddName(ArrowBox, "Arrows Box");

Maintenant, je ne sais pas si ça va changer beaucoup les choses, mais met le toujours on sait jamais ;)

Par contre, je ne comprend pas trop ton problème ? Essaye d'être plus précis et d'écrire correctement tes phrases (ponctuation, majuscule et compagnie, ça serait déjà un bon début :) ).
Je dis pas ça pour t'embêter, mais te lire n'est pas très agréable à ça ne t'aide pas à te faire comprendre (en plus que le forum ne gère pas les tabulations, ça rend le code vraiment indigeste à lire...).
 
A winterdeath : Biensur tu peux modder et modifier ton propre serveur privé ! tu fais comme un mod normal mais tu modifie les fichiers du serveur quoi. Ce qu'il faut c'est que tous les joueurs de ton serveur aient les mêmes mods que toi d'installés.
 
Juste une question, ou est ce que je peux trouver touts les noms ?
Par exemple pour crée mon premier bloc j'aimerais utiliser du fer, or je ne sais pas quel nom je dois mettre pour le fer... est-ce que je peux mettre l'id ?