Craft Custom + box loot complet



  • Bonjour à tous

    oui je sais que j'ai déjà 2 sujet que je dois absolument finir 
    (familiar,et pour les enchant)

    Alors oui je sais que pour la table de craft j'ai déjà posté dans le magnifique tuto de Aymeric 🙂
    Mais 6 pages juste pour mes problèmes je trouve sa un peu abusé ^^

    Donc pour la table de craft custom

    j'été bloqué sur ma table de craft qui ne marché pas cette à dire
    que quand je fais clique droit sur celle si cela ne fait rien (cela fait toutes les classes que j'ai fait sauf la méthode draw dans la classe gui)

    block
    http://pastebin.com/Sf0nqhKU

    container
    http://pastebin.com/f56x4Dpv

    slot
    http://pastebin.com/UkB2QqJS

    gui
    http://pastebin.com/dwnczS5P

    TutorielCraftingManager
    http://pastebin.com/VEX2JJ9m

    TutorielShapedRecipes
    http://pastebin.com/s8CMrHc8

    TutorielShapelessRecipe
    http://pastebin.com/pf7jZtXg

    Donc voila

    Pour le block je vais m'expliqué car je au faite voilà j'ai décidé de crée un block que quand tu le casse tu à des groupe de loot mais pas

    des loots comme les blocks de base mais que sa donne directement dans l'inventaire et que au faite vous allez rien comprendre à ce que je dit

    Donc j'aimerais faire un block qui quand on le casse sa nous donne un type de loot (donc plusieurs loots) mais plusieurs je m'explique 
    PlayerA casse le block =
    tableau de loot A
    PlayerA casse re le block =
    tableau de loot C
    Donc en gros sa va faire aléatoire 
    Et après j'aimerais que sa le donne directement dans l'inventaire bref

    j’espère m'avoir fait compris ^^
    ma classe

    package ed.enderdeath.mod.Block;
    
    import java.util.Random;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import ed.enderdeath.mod.common.enderdeath;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.monster.EntityWitch;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.World;
    
    public class Box extends Block {
    private IIcon top;
    private static final Item[] dropA = new Item[] { Items.glowstone_dust, Items.sugar, Items.redstone,
    Items.spider_eye, Items.glass_bottle, Items.gunpowder, Items.stick, Items.stick };
    private static final Item[] dropB = new Item[] { Items.apple, Items.arrow, Items.blaze_rod, Items.bow,
    Items.chest_minecart, Items.glass_bottle, Items.minecart, Items.record_far };
    
    private static Item[] drop;
    private EntityPlayer player;
    
    public Box() {
    
    super(Material.rock);
    
    this.setBlockName("Box");
    this.setCreativeTab(CreativeTabs.tabBlock);
    
    }
    
    @Override
    public void breakBlock(World world, int x, int y, int z, Block block, int pos) {
    if (world.canMineBlock(player, x, y, z)) {
    Random rand = new Random();
    
    }
    
    }
    
    @SideOnly(Side.CLIENT)
    public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_,
    Random p_149734_5_) {
    for (int l = 0; l < 5; ++l) {
    double d6 = (double) ((float) p_149734_2_ + p_149734_5_.nextFloat());
    double d1 = (double) ((float) p_149734_3_ + p_149734_5_.nextFloat());
    d6 = (double) ((float) p_149734_4_ + p_149734_5_.nextFloat());
    double d3 = 0.0D;
    double d4 = 0.0D;
    double d5 = 0.0D;
    int i1 = p_149734_5_.nextInt(2) * 2 - 1;
    int j1 = p_149734_5_.nextInt(2) * 2 - 1;
    d3 = ((double) p_149734_5_.nextFloat() - 0.5D) * 0.2D;
    d4 = ((double) p_149734_5_.nextFloat() - 0.5D) * 0.2D;
    d5 = ((double) p_149734_5_.nextFloat() - 0.5D) * 0.2D;
    double d2 = (double) p_149734_4_ + 0.5D + 0.25D * (double) j1;
    d5 = (double) (p_149734_5_.nextFloat() * 1.0F * (float) j1);
    double d0 = (double) p_149734_2_ + 0.5D + 0.25D * (double) i1;
    d3 = (double) (p_149734_5_.nextFloat() * 1.0F * (float) i1);
    p_149734_1_.spawnParticle("enchantmenttable", d0, d1, d2, d3, d4, d5);
    }
    }
    
    public void registerBlockIcons(IIconRegister iiconRegister) {
    this.blockIcon = iiconRegister.registerIcon(enderdeath.MODID + ":Box");
    this.top = iiconRegister.registerIcon(enderdeath.MODID + ":Box_top");
    
    }
    
    public IIcon getIcon(int side, int metadata) {
    
    if (side == 1)
    return this.top;
    
    else if (side == 0)
    return this.top;
    
    return this.blockIcon;
    
    }
    }
    


  • Si ton post n'est pas résolu (je suis pas sûr vu la balise) :

    Pour le premier problème de table de craft : envoi les logs

    Pour le deuxième : tu bloques où ?



  • @'SCAREX':

    Si ton post n'est pas résolu (je suis pas sûr vu la balise) :

    Pour le premier problème de table de craft : envoi les logs

    Pour le deuxième : tu bloques où ?

    Fail de balise xD

    logs

    [19:37:49] [main/INFO] [GradleStart]: Extra: []
    [19:37:49] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Eric/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
    [19:37:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
    [19:37:49] [main/INFO] [FML]: Forge Mod Loader version 7.99.36.1558 for Minecraft 1.7.10 loading
    [19:37:49] [main/INFO] [FML]: Java is Java HotSpot(TM) Client VM, version 1.8.0_91, running on Windows 10:x86:10.0, installed at C:\Program Files (x86)\Java\jre1.8.0_91
    [19:37:49] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    [19:37:49] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
    [19:37:49] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
    [19:37:49] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
    [19:37:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [19:37:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [19:37:50] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
    [19:37:52] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
    [19:37:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [19:37:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [19:37:53] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [19:37:53] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
    [19:37:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
    [19:37:53] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
    [19:37:56] [main/INFO]: Setting user: Player749
    [19:37:58] [Client thread/INFO]: LWJGL Version: 2.9.1
    [19:38:02] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
    // Don't do that.
    
    Time: 10/07/16 19:38
    Description: Loading screen debug info
    
    This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (x86) version 10.0
    Java Version: 1.8.0_91, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 971166160 bytes (926 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 358.91' Renderer: 'GeForce GTX 745/PCIe/SSE2'
    [19:38:02] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
    [19:38:02] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1558 Initialized
    [19:38:02] [Client thread/INFO] [FML]: Replaced 183 ore recipies
    [19:38:02] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
    [19:38:02] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
    [19:38:02] [Client thread/INFO] [FML]: Searching C:\Users\Eric\Desktop\EnderMod\eclipse\mods for mods
    [19:38:18] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
    [19:38:18] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, enderdeath] at CLIENT
    [19:38:18] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, enderdeath] at SERVER
    [19:38:20] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:leo01418
    [19:38:20] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
    [19:38:20] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
    [19:38:20] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
    [19:38:20] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
    [19:38:20] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
    [19:38:20] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.common.enderdeath:preInit:501]: preInit
    [19:38:21] [Client thread/INFO] [FML]: Applying holder lookups
    [19:38:21] [Client thread/INFO] [FML]: Holder lookups applied
    [19:38:21] [Client thread/INFO] [FML]: Injecting itemstacks
    [19:38:21] [Client thread/INFO] [FML]: Itemstack injection complete
    [19:38:21] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:21] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [19:38:21] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [19:38:21] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [19:38:22] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [19:38:22] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:22] [Sound Library Loader/INFO]: Sound engine started
    [19:38:33] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas
    [19:38:33] [Client thread/INFO]: Created: 16x16 textures/items-atlas
    [19:38:33] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.proxy.ClientProxy:registerRender:56]: client
    [19:38:34] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.common.enderdeath:init:1883]: init
    [19:38:34] [Client thread/INFO] [FML]: Injecting itemstacks
    [19:38:34] [Client thread/INFO] [FML]: Itemstack injection complete
    [19:38:34] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
    [19:38:34] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:leo01418
    [19:38:34] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
    [19:38:35] [Client thread/INFO]: Created: 512x512 textures/items-atlas
    [19:38:35] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:35] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
    [19:38:35] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     Author: Paul Lamb, www.paulscode.com
    [19:38:35] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:35] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:35] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [19:38:35] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [19:38:35] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [19:38:35] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [19:38:35] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [19:38:35] [Sound Library Loader/INFO]: Sound engine started
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN minecraft
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –------------------------------------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:   domain minecraft is missing 1 texture
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     domain minecraft has 3 locations:
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       unknown resourcepack type net.minecraft.client.resources.DefaultResourcePack : Default
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       mod FML resources at C:\Users\Eric\.gradle\caches\minecraft\net\minecraftforge\forge\1.7.10-10.13.4.1558-1.7.10\forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       mod Forge resources at C:\Users\Eric\.gradle\caches\minecraft\net\minecraftforge\forge\1.7.10-10.13.4.1558-1.7.10\forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain minecraft are:
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/blocks/MISSING_ICON_BLOCK_183_null.png
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain minecraft
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN enderdeath
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –------------------------------------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:   domain enderdeath is missing 4 textures
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     domain enderdeath has 1 location:
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       mod enderdeath resources at C:\Users\Eric\Desktop\EnderMod\bin
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain enderdeath are:
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/blocks/SlowBlock.png
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/InvisibleBlock.png
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/WoodAxe.png
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/bow_pull0.png
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain enderdeath
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [19:38:40] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    [19:40:38] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
    [19:40:38] [Server thread/INFO]: Generating keypair
    [19:40:39] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
    [19:40:39] [Server thread/INFO] [FML]: Applying holder lookups
    [19:40:39] [Server thread/INFO] [FML]: Holder lookups applied
    [19:40:39] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@12ed1fa)
    [19:40:39] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@12ed1fa)
    [19:40:39] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@12ed1fa)
    [19:40:39] [Server thread/INFO]: Preparing start region for level 0
    [19:40:40] [Server thread/INFO]: Changing view distance to 8, from 10
    [19:40:40] [Netty Client IO #0/INFO] [FML]: Server protocol version 2
    [19:40:40] [Netty IO #1/INFO] [FML]: Client protocol version 2
    [19:40:40] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@7.10.99.99,Forge@10.13.4.1558,enderdeath@1.0,mcp@9.05
    [19:40:40] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
    [19:40:40] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
    [19:40:40] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
    [19:40:40] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
    [19:40:40] [Server thread/INFO]: Player749[local:E:f17fa0b8] logged in with entity id 343 at (536.5, 4.0, 127.5)
    [19:40:40] [Server thread/INFO]: Player749 joined the game
    [19:40:48] [Server thread/INFO]: Player749 has just earned the achievement [Taking Inventory]
    [19:40:48] [Client thread/INFO]: [CHAT] Player749 has just earned the achievement [Taking Inventory]
    [19:41:07] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [19:41:07] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [19:41:07] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [19:41:07] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [19:41:07] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [19:41:08] [Server thread/INFO]: Saving and pausing game…
    [19:41:08] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
    [19:41:08] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
    [19:41:08] [Server thread/INFO]: Saving chunks for level 'New World'/The End
    
    

    pour le block
    Je suis bloqué pour le faire sélectionné le tableau en random



  • Pour le premier problème envoi le GuiHandler.

    Pour le deuxième problème : tu as des méthodes pour faire ça dans minecraft pour générer les coffres de formons etc.



  • package ed.enderdeath.mod.common;
    
    import cpw.mods.fml.common.network.IGuiHandler;
    import ed.enderdeath.mod.AnvilDragon.ContainerDragonAnvil;
    import ed.enderdeath.mod.AnvilDragon.GuiAnvilDragon;
    import ed.enderdeath.mod.BaieMachine.ContainerMachineTuto;
    import ed.enderdeath.mod.BaieMachine.GuiMachineTuto;
    import ed.enderdeath.mod.BaieMachine.TileEntityMachineTuto;
    import ed.enderdeath.mod.Extractor.ContainerAlloyer;
    import ed.enderdeath.mod.Extractor.GuiAlloyer;
    import ed.enderdeath.mod.Extractor.TileEntityAlloyer;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.world.World;
    
    public class GuiHandler implements IGuiHandler
    {
    public static final int guiCraftingTableID = 3;
    
    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    TileEntity tile = world.getTileEntity(x, y, z);
    if(tile instanceof TileEntityAlloyer)
    {
    return new ContainerAlloyer((TileEntityAlloyer)tile, player.inventory);
    }
    
     if(tile instanceof TileEntityMachineTuto)
           {
            return new ContainerMachineTuto((TileEntityMachineTuto)tile, player.inventory);
           }
    
     if(ID == guiCraftingTableID)
     {
    
     return new ContainerDragonAnvil(player.inventory, world, x, y, z);
     }
    return null;
    }
    
    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    
    TileEntity tile = world.getTileEntity(x, y, z);
    if(tile instanceof TileEntityAlloyer)
    {
    return new GuiAlloyer((TileEntityAlloyer)tile, player.inventory);
    }
     if(tile instanceof TileEntityMachineTuto)
           {
            return new GuiMachineTuto((TileEntityMachineTuto)tile, player.inventory);
           }
     if(ID == guiCraftingTableID)
     {
    
     return new GuiAnvilDragon(player.inventory, world, x,y,z);
     }
    return null;
    }
    
    }
    
    

    tient 😉



  • Fais du debug en ajoutant des System.out.println dans la fonction onBlockActivated avant l'ouverture du gui, dans le GuiHandler et dans le Gui



  • Je l'avait fait tout se passé bien  🙂

    Sérieusement je vois pas ou est le problème



  • "avait" -> mets en un peu partout et regarde les logs



  • Excuse moi des fautes 😉

    Donc j'en ai mis

    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:21]: Test onBlockActivated
    [00:41:52] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:21]: Test onBlockActivated
    [00:41:52] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [00:41:52] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.ContainerDragonAnvil:<init>:39]: Test container
    [00:41:52] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.DragonSlotCrafting:<init>:35]: Test slot
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.ContainerDragonAnvil:<init>:39]: Test container
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.DragonSlotCrafting:<init>:35]: Test slot
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.GuiAnvilDragon:<init>:27]: Test gui
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.TutorielCraftingManager:<init>:32]: Test manager
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.TutorielShapelessRecipe:<init>:27]: Test shapeless
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.TutorielShapedRecipes:<init>:45]: Test shaped
    [00:41:52] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.TutorielShapedRecipes:<init>:45]: Test shaped
    

    Merci de ton aide ;)</init></init></init></init></init></init></init></init></init>



  • Petite question : le problème est bien que tu n'arrives pas à ouvrir le Gui ?



  • @'leo01418':

    j'été bloqué sur ma table de craft qui ne marché pas cette à dire
    que quand je fais clique droit sur celle si cela ne fait rien (cela fait toutes les classes que j'ai fait sauf la méthode draw dans la classe gui)

    Oui il ne se passe rien au moment du clique droit, comme je n'en sais rien, au table de craft car c'est l'un de mes prochain tuto, je regarde déjà les problème 🙂



  • @'SCAREX':

    Petite question : le problème est bien que tu n'arrives pas à ouvrir le Gui ?

    Oui le gui ne s'ouvre pas



  • Alors pourquoi mettre des logs dans les recettes ?



  • Je ne sais points xD



  • @'SCAREX':

    Fais du debug en ajoutant des System.out.println dans la fonction onBlockActivated avant l'ouverture du gui, dans le GuiHandler et dans le Gui



  • @'SCAREX':

    @'SCAREX':

    Fais du debug en ajoutant des System.out.println dans la fonction onBlockActivated avant l'ouverture du gui, dans le GuiHandler et dans le Gui

    Ha Oui Excuse j'avais pas bien lu  :-3 
    Donc au final je l'ai mis juste pour eux et cela me fait sa (j'en aussi mis dans la fonction draw du gui)

    [23:50:27] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:21]: Test onBlockActivated
    [23:50:27] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:21]: Test onBlockActivated
    [23:50:27] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.BlockAnvilDragon:onBlockActivated:24]: je suis dans la condition world.IsRemote
    [23:50:27] [Server thread/INFO] [STDOUT]: [ed.enderdeath.mod.common.GuiHandler:getServerGuiElement:36]: Test getServerGuiElement
    [23:50:27] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.common.GuiHandler:getClientGuiElement:57]: Test getClientGuiElement
    [23:50:27] [Client thread/INFO] [STDOUT]: [ed.enderdeath.mod.AnvilDragon.GuiAnvilDragon:<init>:27]: Test gui
    

    Donc au final il exécute pas c'est code la(dis le moi si je me trompe 😉 )

    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) 
    { 
    System.out.println("Test gui1");
    fontRendererObj.drawString(I18n.format("container.crafting_table"), 100, 5, 0xFFFFFF); //On dessine le "titre" du gui, le I18n.format va traduire le texte donné, n'oubliez pas de l'ajouter dans votre fichier de langues !
    }
    
    /**
    * Fonction pour dessiner l'arrière plan
    */
    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
    System.out.println("Test gui2");
    mc.getTextureManager().bindTexture(texture); //On bind la texture
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); //Et on la dessine
    }
    ```</init>


  • C'est étrange, envoi le gui complet



  • tient x)

    package ed.enderdeath.mod.AnvilDragon;
    
    import java.util.HashMap;
    
    import org.lwjgl.opengl.GL11;
    
    import ed.enderdeath.mod.Extractor.ContainerAlloyer;
    import ed.enderdeath.mod.Extractor.GuiAlloyer;
    import ed.enderdeath.mod.Extractor.TileEntityAlloyer;
    import ed.enderdeath.mod.common.enderdeath;
    import net.minecraft.client.gui.Gui;
    import net.minecraft.client.gui.inventory.GuiContainer;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.util.ResourceLocation;
    import net.minecraft.world.World;
    
    public class GuiAnvilDragon extends GuiContainer
    {
    private static final ResourceLocation texture = new ResourceLocation(enderdeath.MODID,"textures/gui/container/GuiAlloyer.png");
    public GuiAnvilDragon(InventoryPlayer invPlayer, World world, int x,int y,int z) 
    {
    super(new ContainerDragonAnvil(invPlayer, world,x,y,z));
    this.xSize = 176; //La largeur du gui en pixels (supprimez-le pour laisser celle par défaut)
    this.ySize = 188; //La hauteur du gui en pixels (supprimez-le pour laisser celle par défaut)
    System.out.println("Test gui");
    }
    
    /**
    * Fonction pour dessiner le premier plan
    */
    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) 
    { 
    System.out.println("Test gui1");
    fontRendererObj.drawString(I18n.format("container.crafting_table"), 100, 5, 0xFFFFFF); //On dessine le "titre" du gui, le I18n.format va traduire le texte donné, n'oubliez pas de l'ajouter dans votre fichier de langues !
    }
    
    /**
    * Fonction pour dessiner l'arrière plan
    */
    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
    System.out.println("Test gui2");
    mc.getTextureManager().bindTexture(texture); //On bind la texture
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); //Et on la dessine
    }
    }
    
    


  • Envoi : classe du block, classe du gui handler