Créer un bloc type four (machine)
-
Bonjour j’ai encore un bug et je m’en remet a vous, ma barre de progression ne s’affiche pas et mes recettes ne s’enregistrent pas:
la classe du CommonProxy:
:::
package fr.modchelou.common; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import fr.modchelou.ChelouPrincipal; import fr.modchelou.blocks.ModBlocks; import fr.modchelou.items.ModItems; import fr.modchelou.recipes.ModRecipes; import fr.modchelou.tiles.ModTiles; public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { } public void init(FMLInitializationEvent event) { ModTiles.init(); ModBlocks.init(); ModItems.init(); ModRecipes.init(); NetworkRegistry.INSTANCE.registerGuiHandler(ChelouPrincipal.instance, new GuiHandler()); } public void postInit(FMLPostInitializationEvent event) { } public void registerRenders() { } }:::
La classe Principale:
:::
package fr.modchelou; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fr.modchelou.blocks.ModBlocks; import fr.modchelou.common.CommonProxy; import fr.modchelou.common.GuiHandler; import fr.modchelou.items.ModItems; import fr.modchelou.recipes.ModRecipes; import fr.modchelou.tiles.ModTiles; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @Mod(modid = Ref.MOD_ID, name = Ref.MOD_NAME, version = Ref.VERSION) public class ChelouPrincipal { @Instance(Ref.MOD_ID) public static ChelouPrincipal instance; @SidedProxy(clientSide = Ref.CLIENT_PROXY, serverSide = Ref.SERVER_PROXY) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } }:::
La classe du GUI:
:::
package fr.modchelou.client.gui; import org.lwjgl.opengl.GL11; import fr.modchelou.Ref; import fr.modchelou.common.gui.ContainerEuropiumMachine; import fr.modchelou.tiles.TileEntityEuropiumMachine; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.util.ResourceLocation; public class GuiEuropiumMachine extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("chelou:textures/gui/guiEuropiumMachine.png"); private TileEntityEuropiumMachine tileEuropiumMachine; private IInventory playerInv; public GuiEuropiumMachine(TileEntityEuropiumMachine tile, InventoryPlayer inventory) { super(new ContainerEuropiumMachine(tile, inventory)); this.tileEuropiumMachine = tile; this.playerInv = inventory; this.allowUserInput = false; this.ySize = 340; this.xSize = 200; } @Override protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(texture); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); if(this.tileEuropiumMachine.isBurning()) { int i = this.tileEuropiumMachine.getCookProgress(); this.drawTexturedModalRect(k + 110, l, 199, 122, 14, 14); } } }:::
La classe d’init des recettes:
:::
package fr.modchelou.recipes; import fr.modchelou.items.ModItems; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; public class ModRecipes { public static void init() { europiumMachineRecipes(); } private static void europiumMachineRecipes() { EuropiumMachineRecipes.getManager().add(Items.leather, Items.leather, Blocks.chest, Items.leather, Items.leather, new ItemStack(ModItems.backpack, 1)); EuropiumMachineRecipes.getManager().add(Items.diamond, Items.diamond, Items.diamond, Items.diamond, Items.diamond, new ItemStack(Blocks.diamond_block, 1)); } }:::
La classe des Recettes:
:::
package fr.modchelou.recipes; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import fr.modchelou.items.ModItems; import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class EuropiumMachineRecipes { private static final EuropiumMachineRecipes instance = new EuropiumMachineRecipes(); private static final EuropiumMachineRecipes smeltingBase = new EuropiumMachineRecipes(); private Map <itemstack[], itemstack="">smeltingList = new HashMap(); public void addRecipe(ItemStack stack1, ItemStack stack2, ItemStack stack3, ItemStack stack4, ItemStack stack5, ItemStack stack) { ItemStack[] stackList = new ItemStack[]{stack1, stack2, }; this.smeltingList.put(stackList, stack4); } public void add(Item item1, Block item2, Item item3, Block item4, Item item5, ItemStack stack) { this.addRecipe(new ItemStack(item1), new ItemStack(item2), new ItemStack(item3), new ItemStack(item4), new ItemStack(item5), stack); } public void add(Item item1, Item item2, Item item3, Item item4, Item item5, ItemStack stack) { this.addRecipe(new ItemStack(item1), new ItemStack(item2), new ItemStack(item3), new ItemStack(item4), new ItemStack(item5), stack); } public void add(Block item1, Block item2, Item item3, Block item4, Block item5, ItemStack stack) { this.addRecipe(new ItemStack(item1), new ItemStack(item2), new ItemStack(item3), new ItemStack(item4), new ItemStack(item5), stack); } public void add(Item item1, Block item2, Block item3, Block item4, Block item5, ItemStack stack) { this.addRecipe(new ItemStack(item1), new ItemStack(item2), new ItemStack(item3), new ItemStack(item4), new ItemStack(item5), stack); } public void add(Item item1, Item item2, Block item3, Item item4, Item item5, ItemStack stack) { this.addRecipe(new ItemStack(item1), new ItemStack(item2), new ItemStack(item3), new ItemStack(item4), new ItemStack(item5), stack); } public ItemStack getSmeltingResult(ItemStack[] stack) { Iterator iterator = this.smeltingList.entrySet().iterator(); Entry entry; do { if (!iterator.hasNext()) { return null; } entry = (Entry)iterator.next(); } while (!this.isSameKey(stack, (ItemStack[])entry.getKey())); return (ItemStack)entry.getValue(); } private boolean isSameKey(ItemStack[] stackList, ItemStack[] stackList2) { boolean isSame = false; for(int i=0; i<=2; i++) { if(stackList*.getItem() == stackList2*.getItem()) { isSame = true; } else { return false; } } return isSame; } public Map <itemstack[], itemstack="">getSmeltingList() { return this.smeltingList; } public static EuropiumMachineRecipes smelting() { return smeltingBase; } public static EuropiumMachineRecipes getManager() { return instance; } }:::
Et enin la texture de mon gui(progressbar comprise)
http://www.noelshack.com/2016-18-1462518704-guieuropiummachine.png
si jamais vous avez besoin de l’image envoyez moi un mp et je vous donnerais un lien dropbox</itemstack[],></itemstack[],>
-
Tes recettes ne s’enregistrent pas ? Quand tu met tous les items qu’il faut elle ne se lance pas ? Montre ton tileentity, c’est possible que ce soit lui la cause du problème.
-
ok,
La classe du TileEntity:
:::
package fr.modchelou.tiles; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fr.modchelou.recipes.EuropiumMachineRecipes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; public class TileEntityEuropiumMachine extends TileEntity implements IInventory { private ItemStack[] contents = new ItemStack[6]; private int workingTime = 0; private int TimeNeeded = 200; @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.contents = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("Slot") & 255; if (j >= 0 && j < this.contents.length) { this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } this.workingTime = compound.getShort("workingTime"); this.TimeNeeded = compound.getShort("TimeNeeded"); } @Override public int getSizeInventory() { return this.contents.length; } @Override public ItemStack getStackInSlot(int slotIndex) { return this.contents[slotIndex]; } @Override public ItemStack decrStackSize(int slotIndex, int amount) { if (this.contents[slotIndex] != null) { ItemStack itemstack; if (this.contents[slotIndex].stackSize <= amount) { itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; this.markDirty(); return itemstack; } else { itemstack = this.contents[slotIndex].splitStack(amount); if (this.contents[slotIndex].stackSize == 0) { this.contents[slotIndex] = null; } this.markDirty(); return itemstack; } } else { return null; } } @Override public ItemStack getStackInSlotOnClosing(int slotIndex) { if (this.contents[slotIndex] != null) { ItemStack itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; return itemstack; } else { return null; } } @Override public void setInventorySlotContents(int slotIndex, ItemStack stack) { this.contents[slotIndex] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } this.markDirty(); } @Override public String getInventoryName() { return "tile.EuropiumMachine"; } @Override public boolean hasCustomInventoryName() { return false; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; } @Override public void openInventory() { } @Override public void closeInventory() { } @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return slot == 3 ? false : true; } public boolean isBurning() { return this.workingTime > 0; } private boolean canSmelt() { if (this.contents[0] == null || this.contents[1] == null || this.contents[2] == null || this.contents[3] == null || this.contents[4] == null || this.contents[5] == null) { return false; } else { ItemStack itemstack = EuropiumMachineRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0], this.contents[1], this.contents[2], this.contents[3], this.contents[4], this.contents[5]}); //Il y a une erreur ici, c'est normal, on y vient après (c'est pour les recettes) if (itemstack == null) return false; if (this.contents[5] == null) return true; if (!this.contents[5].isItemEqual(itemstack)) return false; int result = contents[5].stackSize + itemstack.stackSize; return result <= getInventoryStackLimit() && result <= this.contents[5].getMaxStackSize(); } } public void updateEntity() { if(this.isBurning() && this.canSmelt()) { ++this.workingTime; } if(this.canSmelt() && !this.isBurning()) { this.workingTime = 1; } if(this.canSmelt() && this.workingTime == this.TimeNeeded) { this.smeltItem(); this.workingTime = 0; } if(!this.canSmelt()) { this.workingTime= 0; } } public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = EuropiumMachineRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0], this.contents[1], this.contents[2], this.contents[3], this.contents[4], this.contents[5]}); //On récupère l'output de la recette if (this.contents[5] == null) { this.contents[5] = itemstack.copy(); } else if (this.contents[5].getItem() == itemstack.getItem()) { this.contents[5].stackSize += itemstack.stackSize; } –this.contents[0].stackSize; –this.contents[1].stackSize; –this.contents[2].stackSize; –this.contents[3].stackSize; –this.contents[4].stackSize; if (this.contents[0].stackSize <= 0) { this.contents[0] = null; } if (this.contents[1].stackSize <= 0) { this.contents[1] = null; } if (this.contents[2].stackSize <= 0) { this.contents[2] = null; } if (this.contents[3].stackSize <= 0) { this.contents[3] = null; } if (this.contents[4].stackSize <= 0) { this.contents[4] = null; } } } @SideOnly(Side.CLIENT) public int getCookProgress() { return this.workingTime * 16 / this.TimeNeeded; } }:::
Et voila ma classe du tileEntity
-
“//Il y a une erreur ici, c’est normal, on y vient après (c’est pour les recettes)” bah il vaut mieux voir ça maintenant, parce que logiquement, si tes recettes marchent pas, c’est normal que la barre de progression ne monte pas, donc je regarde.
EDIT : c’est quoi l’erreur ? -
@‘AymericRed’:
“//Il y a une erreur ici, c’est normal, on y vient après (c’est pour les recettes)” bah il vaut mieux voir ça maintenant, parce que logiquement, si tes recettes marchent pas, c’est normal que la barre de progression ne monte pas, donc je regarde.
EDIT : c’est quoi l’erreur ?"//Il y a une erreur ici, c’est normal, on y vient après (c’est pour les recettes)"vient du Ctrl-C/Ctrl-V du tuto (peu de temps)
et l’erreur vient du fait que quand je met mes items pour la recette, il ne se passe rien!!!
Aidez-moi svp -
Dans la fonction public void smeltItem()
Juste avant if(this.canSmelt()) …
Ajoutes :
System.out.println(this.canSmelt()));
et regardes dans la console s’il affiche true ou false.
S’il affiche false il y a un problème avec la fonction canSmelt
S’il affiche true le problème est surement dans smeltItem
S’il n’affiche rien, ta fonction smeltItem n’est jamais appelé. -
@‘robin4002’:
Dans la fonction public void smeltItem()
Juste avant if(this.canSmelt()) …
Ajoutes :
System.out.println(this.canSmelt()));
et regardes dans la console s’il affiche true ou false.
S’il affiche false il y a un problème avec la fonction canSmelt
S’il affiche true le problème est surement dans smeltItem
S’il n’affiche rien, ta fonction smeltItem n’est jamais appelé.Il n’affiche rien et en supplément je crash!!
donc j’en déduis que ma fonction smeltItem n’est pas appelée mais comment l’appeler et surtout où???
Merci d’avance pour m’avoir aidé!!
-
Pourtant tu as bien la fonction updateEntity.
Tu peux envoyer le rapport de crash ? -
j’ai deux crash reports:
Le 1[exposant]er[/exposant]:
:::
–-- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 07/05/16 11:58 Description: Ticking block entity java.lang.ArrayIndexOutOfBoundsException: 2 at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) -- Block entity being ticked -- Details: Name: chelou:EuropiumMachineTileEntity // fr.modchelou.tiles.TileEntityEuropiumMachine Block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Block data value: 0 / 0x0 / 0b0000 Block location: World: (960,4,864), Chunk: (at 0,0,0 in 60,54; contains blocks 960,0,864 to 975,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Actual block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Actual block data value: 0 / 0x0 / 0b0000 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) -- Affected level -- Details: Level name: New World All players: 1 total; [EntityPlayerMP['Player292'/540, l='New World', x=961,00, y=5,00, z=862,45]] Chunk stats: ServerChunkCache: 625 Drop: 0 Level seed: -5452522370674857934 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (955,4,877), Chunk: (at 11,0,13 in 59,54; contains blocks 944,0,864 to 959,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Level time: 62548 game time, 62548 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 104448 (now: false), thunder time: 1030 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 891242040 bytes (849 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAAAAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAAAAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAAAAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAAAAAAA chelou{beta 0.0.1} [Mod CHELOU] (bin) GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player292'/540, l='New World', x=961,00, y=5,00, z=862,45]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge':::
et le 2[exposant]ème[/exposant]:
:::–-- Minecraft Crash Report ---- // Ooh. Shiny. Time: 07/05/16 11:58 Description: Ticking block entity java.lang.ArrayIndexOutOfBoundsException: 2 at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2097) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) at net.minecraft.client.Minecraft.run(Minecraft.java:962) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) -- Block entity being ticked -- Details: Name: chelou:EuropiumMachineTileEntity // fr.modchelou.tiles.TileEntityEuropiumMachine Block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Block data value: 0 / 0x0 / 0b0000 Block location: World: (960,4,864), Chunk: (at 0,0,0 in 60,54; contains blocks 960,0,864 to 975,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Actual block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Actual block data value: 0 / 0x0 / 0b0000 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2160) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player292'/540, l='MpServer', x=961,00, y=6,62, z=862,45]] Chunk stats: MultiplayerChunkCache: 225, 225 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (955,4,877), Chunk: (at 11,0,13 in 59,54; contains blocks 944,0,864 to 959,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Level time: 62545 game time, 62545 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 74 total; [EntityHorse['Cheval'/384, l='MpServer', x=882,00, y=4,00, z=830,13], EntityPig['Cochon'/386, l='MpServer', x=882,44, y=4,00, z=817,84], EntityPig['Cochon'/388, l='MpServer', x=892,50, y=4,00, z=836,97], EntityCow['Vache'/389, l='MpServer', x=886,22, y=4,00, z=833,69], EntityPig['Cochon'/390, l='MpServer', x=895,84, y=4,00, z=855,25], EntityChicken['Poule'/391, l='MpServer', x=889,53, y=4,00, z=850,47], EntityHorse['Cheval'/392, l='MpServer', x=884,38, y=4,00, z=848,84], EntityPig['Cochon'/393, l='MpServer', x=882,13, y=4,00, z=862,88], EntityChicken['Poule'/394, l='MpServer', x=883,56, y=4,00, z=871,41], EntityChicken['Poule'/396, l='MpServer', x=886,38, y=4,00, z=893,59], EntityPig['Cochon'/401, l='MpServer', x=899,91, y=4,00, z=799,94], EntitySheep['Mouton'/402, l='MpServer', x=908,50, y=4,00, z=786,25], EntityPig['Cochon'/403, l='MpServer', x=904,19, y=4,00, z=811,16], EntityPig['Cochon'/404, l='MpServer', x=908,97, y=4,00, z=824,06], EntityChicken['Poule'/405, l='MpServer', x=897,53, y=4,00, z=836,47], EntityChicken['Poule'/406, l='MpServer', x=908,13, y=4,00, z=862,78], EntityChicken['Poule'/407, l='MpServer', x=908,47, y=4,00, z=864,47], EntityCow['Vache'/408, l='MpServer', x=897,88, y=4,00, z=905,94], EntityChicken['Poule'/410, l='MpServer', x=914,56, y=4,00, z=810,56], EntityPig['Cochon'/411, l='MpServer', x=922,13, y=4,00, z=811,97], EntityChicken['Poule'/412, l='MpServer', x=927,47, y=4,00, z=817,41], EntityClientPlayerMP['Player292'/540, l='MpServer', x=961,00, y=6,62, z=862,45], EntityHorse['Cheval'/413, l='MpServer', x=916,09, y=4,00, z=816,97], EntityPig['Cochon'/414, l='MpServer', x=927,75, y=4,00, z=835,44], EntityChicken['Poule'/415, l='MpServer', x=926,47, y=4,00, z=837,53], EntitySheep['Mouton'/416, l='MpServer', x=921,25, y=4,00, z=852,63], EntityChicken['Poule'/417, l='MpServer', x=920,59, y=4,00, z=849,44], EntityChicken['Poule'/418, l='MpServer', x=922,66, y=4,00, z=848,47], EntityPig['Cochon'/419, l='MpServer', x=919,94, y=4,00, z=883,88], EntityChicken['Poule'/420, l='MpServer', x=928,41, y=4,00, z=795,41], EntityChicken['Poule'/421, l='MpServer', x=935,59, y=4,00, z=807,63], EntityChicken['Poule'/422, l='MpServer', x=938,47, y=4,00, z=809,63], EntityPig['Cochon'/423, l='MpServer', x=929,09, y=4,00, z=886,22], EntityChicken['Poule'/424, l='MpServer', x=929,59, y=4,00, z=902,34], EntityChicken['Poule'/426, l='MpServer', x=951,53, y=4,00, z=932,47], EntityPig['Cochon'/434, l='MpServer', x=971,53, y=4,00, z=796,81], EntityPig['Cochon'/435, l='MpServer', x=961,88, y=4,00, z=788,97], EntitySheep['Mouton'/436, l='MpServer', x=953,19, y=4,00, z=798,81], EntityPig['Cochon'/437, l='MpServer', x=961,16, y=4,00, z=924,41], EntityPig['Cochon'/438, l='MpServer', x=974,38, y=4,00, z=941,81], EntitySheep['Mouton'/439, l='MpServer', x=962,16, y=4,00, z=937,94], EntityChicken['Poule'/441, l='MpServer', x=966,41, y=4,00, z=929,41], EntitySheep['Mouton'/449, l='MpServer', x=982,84, y=4,00, z=817,72], EntitySheep['Mouton'/450, l='MpServer', x=985,38, y=4,00, z=839,75], EntitySheep['Mouton'/451, l='MpServer', x=977,09, y=4,00, z=861,16], EntitySheep['Mouton'/452, l='MpServer', x=978,81, y=4,00, z=911,47], EntityChicken['Poule'/453, l='MpServer', x=980,72, y=4,00, z=923,38], EntitySheep['Mouton'/454, l='MpServer', x=972,13, y=4,00, z=912,94], EntityChicken['Poule'/455, l='MpServer', x=985,53, y=4,00, z=939,47], EntitySheep['Mouton'/456, l='MpServer', x=986,78, y=4,00, z=942,69], EntityPig['Cochon'/457, l='MpServer', x=983,13, y=4,00, z=928,94], EntityPig['Cochon'/467, l='MpServer', x=1001,66, y=4,00, z=790,19], EntityCow['Vache'/468, l='MpServer', x=999,72, y=4,00, z=785,69], EntitySheep['Mouton'/469, l='MpServer', x=996,13, y=4,00, z=825,91], EntitySheep['Mouton'/470, l='MpServer', x=1002,13, y=4,00, z=839,78], EntityCow['Vache'/471, l='MpServer', x=993,34, y=4,00, z=837,78], EntityCow['Vache'/472, l='MpServer', x=1006,06, y=4,00, z=838,31], EntityCow['Vache'/473, l='MpServer', x=1000,19, y=4,00, z=833,78], EntitySheep['Mouton'/474, l='MpServer', x=997,84, y=4,00, z=862,69], EntitySheep['Mouton'/475, l='MpServer', x=996,78, y=4,00, z=856,22], EntitySheep['Mouton'/476, l='MpServer', x=1005,13, y=4,00, z=878,09], EntitySheep['Mouton'/477, l='MpServer', x=1002,63, y=4,00, z=938,84], EntityCow['Vache'/483, l='MpServer', x=1016,75, y=4,00, z=833,22], EntitySheep['Mouton'/484, l='MpServer', x=1009,06, y=4,00, z=846,03], EntitySheep['Mouton'/485, l='MpServer', x=1023,09, y=4,00, z=928,84], EntitySheep['Mouton'/486, l='MpServer', x=1020,47, y=4,00, z=928,41], EntitySheep['Mouton'/496, l='MpServer', x=1033,88, y=4,00, z=793,75], EntityChicken['Poule'/497, l='MpServer', x=1030,59, y=4,00, z=804,41], EntityChicken['Poule'/498, l='MpServer', x=1026,56, y=4,00, z=879,47], EntityChicken['Poule'/499, l='MpServer', x=1026,56, y=4,00, z=876,59], EntityChicken['Poule'/507, l='MpServer', x=1037,63, y=4,00, z=907,53], EntityHorse['Cheval'/381, l='MpServer', x=893,50, y=4,00, z=804,06], EntityChicken['Poule'/382, l='MpServer', x=884,44, y=4,00, z=806,53], EntityChicken['Poule'/383, l='MpServer', x=891,53, y=4,00, z=803,59]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566) at net.minecraft.client.Minecraft.run(Minecraft.java:984) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 892860208 bytes (851 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAAAAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAAAAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAAAAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAAAAAAA chelou{beta 0.0.1} [Mod CHELOU] (bin) GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 10.18.15.4248' Renderer: 'Intel(R) HD Graphics' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: Intel(R) HD Graphics GL version 4.3.0 - Build 10.18.15.4248, Intel GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [OneCraft-1.8.zip] Current Language: Français (France) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1):::
Voila!!!
-
Il y a un problème à la fonction isSameKey, au for, le tableau de stacks à pas la bonne taille.
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
merci mais comment devrais-je l’adapter??
-
l’erreur ne vient pas de la je crash toujours:
le 1[exposant]er[/exposant]
:::
–-- Minecraft Crash Report ---- // Daisy, daisy... Time: 07/05/16 12:39 Description: Ticking block entity java.lang.ArrayIndexOutOfBoundsException: 2 at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) -- Block entity being ticked -- Details: Name: chelou:EuropiumMachineTileEntity // fr.modchelou.tiles.TileEntityEuropiumMachine Block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Block data value: 0 / 0x0 / 0b0000 Block location: World: (960,4,864), Chunk: (at 0,0,0 in 60,54; contains blocks 960,0,864 to 975,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Actual block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Actual block data value: 0 / 0x0 / 0b0000 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) -- Affected level -- Details: Level name: New World All players: 1 total; [EntityPlayerMP['Player452'/200, l='New World', x=964,36, y=4,00, z=865,38]] Chunk stats: ServerChunkCache: 271 Drop: 0 Level seed: -5452522370674857934 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (955,4,877), Chunk: (at 11,0,13 in 59,54; contains blocks 944,0,864 to 959,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Level time: 64257 game time, 64257 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 102739 (now: false), thunder time: 8325 (now: true) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 855397680 bytes (815 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 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: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA chelou{beta 0.0.1} [Mod CHELOU] (bin) GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player452'/200, l='New World', x=964,36, y=4,00, z=865,38]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge':::
et le 2[exposant]ème[/exposant]
–-- Minecraft Crash Report ---- // Don't do that. Time: 07/05/16 12:39 Description: Ticking block entity java.lang.ArrayIndexOutOfBoundsException: 2 at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) at net.minecraft.world.World.updateEntities(World.java:2160) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2097) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) at net.minecraft.client.Minecraft.run(Minecraft.java:962) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at fr.modchelou.recipes.EuropiumMachineRecipes.isSameKey(EuropiumMachineRecipes.java:80) at fr.modchelou.recipes.EuropiumMachineRecipes.getSmeltingResult(EuropiumMachineRecipes.java:68) at fr.modchelou.tiles.TileEntityEuropiumMachine.canSmelt(TileEntityEuropiumMachine.java:166) at fr.modchelou.tiles.TileEntityEuropiumMachine.updateEntity(TileEntityEuropiumMachine.java:181) -- Block entity being ticked -- Details: Name: chelou:EuropiumMachineTileEntity // fr.modchelou.tiles.TileEntityEuropiumMachine Block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Block data value: 0 / 0x0 / 0b0000 Block location: World: (960,4,864), Chunk: (at 0,0,0 in 60,54; contains blocks 960,0,864 to 975,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Actual block type: ID #165 (tile.EuropiumMachine // fr.modchelou.blocks.BlockEuropiumMachine) Actual block data value: 0 / 0x0 / 0b0000 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2160) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player452'/200, l='MpServer', x=964,36, y=5,62, z=865,38]] Chunk stats: MultiplayerChunkCache: 225, 225 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: World: (955,4,877), Chunk: (at 11,0,13 in 59,54; contains blocks 944,0,864 to 959,255,879), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023) Level time: 64254 game time, 64254 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 75 total; [EntitySheep['Mouton'/129, l='MpServer', x=996,13, y=4,00, z=825,91], EntitySheep['Mouton'/130, l='MpServer', x=1002,13, y=4,00, z=839,78], EntityCow['Vache'/131, l='MpServer', x=993,34, y=4,00, z=837,78], EntityCow['Vache'/132, l='MpServer', x=1006,06, y=4,00, z=838,31], EntityCow['Vache'/133, l='MpServer', x=1000,19, y=4,00, z=833,78], EntitySheep['Mouton'/134, l='MpServer', x=997,84, y=4,00, z=862,69], EntitySheep['Mouton'/135, l='MpServer', x=996,78, y=4,00, z=856,22], EntitySheep['Mouton'/136, l='MpServer', x=1005,13, y=4,00, z=878,09], EntitySheep['Mouton'/137, l='MpServer', x=996,22, y=4,00, z=937,66], EntitySheep['Mouton'/143, l='MpServer', x=1009,06, y=4,00, z=846,03], EntityCow['Vache'/144, l='MpServer', x=1016,75, y=4,00, z=833,22], EntitySheep['Mouton'/145, l='MpServer', x=1028,91, y=4,00, z=921,91], EntitySheep['Mouton'/146, l='MpServer', x=1023,09, y=4,00, z=928,84], EntitySheep['Mouton'/156, l='MpServer', x=1033,88, y=4,00, z=793,75], EntityChicken['Poule'/157, l='MpServer', x=1035,41, y=4,00, z=803,53], EntityChicken['Poule'/158, l='MpServer', x=1026,56, y=4,00, z=879,47], EntityChicken['Poule'/159, l='MpServer', x=1026,56, y=4,00, z=876,59], EntityChicken['Poule'/160, l='MpServer', x=1037,63, y=4,00, z=907,53], EntityHorse['Cheval'/41, l='MpServer', x=893,50, y=4,00, z=804,06], EntityChicken['Poule'/42, l='MpServer', x=884,44, y=4,00, z=806,53], EntityChicken['Poule'/43, l='MpServer', x=891,53, y=4,00, z=803,59], EntityPig['Cochon'/171, l='MpServer', x=1043,97, y=4,00, z=929,03], EntityPig['Cochon'/44, l='MpServer', x=885,97, y=4,00, z=808,97], EntityPig['Cochon'/48, l='MpServer', x=892,50, y=4,00, z=836,97], EntityCow['Vache'/49, l='MpServer', x=886,22, y=4,00, z=833,69], EntityPig['Cochon'/50, l='MpServer', x=895,84, y=4,00, z=855,25], EntityChicken['Poule'/51, l='MpServer', x=895,38, y=4,00, z=843,63], EntityHorse['Cheval'/52, l='MpServer', x=884,38, y=4,00, z=848,84], EntityChicken['Poule'/55, l='MpServer', x=886,38, y=4,00, z=893,59], EntityCow['Vache'/56, l='MpServer', x=884,72, y=4,00, z=896,75], EntityPig['Cochon'/61, l='MpServer', x=899,91, y=4,00, z=799,94], EntitySheep['Mouton'/62, l='MpServer', x=908,50, y=4,00, z=786,25], EntityPig['Cochon'/63, l='MpServer', x=904,19, y=4,00, z=811,16], EntityPig['Cochon'/64, l='MpServer', x=908,97, y=4,00, z=824,06], EntityChicken['Poule'/65, l='MpServer', x=897,53, y=4,00, z=836,47], EntityChicken['Poule'/66, l='MpServer', x=908,13, y=4,00, z=862,78], EntityChicken['Poule'/67, l='MpServer', x=913,44, y=4,00, z=873,41], EntityCow['Vache'/68, l='MpServer', x=897,88, y=4,00, z=905,94], EntityChicken['Poule'/70, l='MpServer', x=914,56, y=4,00, z=810,56], EntityPig['Cochon'/71, l='MpServer', x=922,13, y=4,00, z=811,97], EntityChicken['Poule'/72, l='MpServer', x=927,47, y=4,00, z=817,41], EntityClientPlayerMP['Player452'/200, l='MpServer', x=964,36, y=5,62, z=865,38], EntityHorse['Cheval'/73, l='MpServer', x=916,09, y=4,00, z=816,97], EntityPig['Cochon'/74, l='MpServer', x=927,75, y=4,00, z=835,44], EntityChicken['Poule'/75, l='MpServer', x=926,47, y=4,00, z=837,53], EntitySheep['Mouton'/76, l='MpServer', x=921,25, y=4,00, z=852,63], EntityChicken['Poule'/77, l='MpServer', x=923,41, y=4,00, z=853,41], EntityChicken['Poule'/78, l='MpServer', x=922,66, y=4,00, z=848,47], EntityPig['Cochon'/79, l='MpServer', x=919,94, y=4,00, z=883,88], EntityChicken['Poule'/80, l='MpServer', x=928,41, y=4,00, z=795,41], EntityChicken['Poule'/81, l='MpServer', x=935,59, y=4,00, z=807,63], EntityChicken['Poule'/82, l='MpServer', x=938,47, y=4,00, z=809,63], EntityPig['Cochon'/83, l='MpServer', x=932,22, y=4,00, z=893,84], EntityChicken['Poule'/84, l='MpServer', x=925,59, y=4,00, z=895,66], EntitySheep['Mouton'/87, l='MpServer', x=943,97, y=4,00, z=789,94], EntityChicken['Poule'/88, l='MpServer', x=951,53, y=4,00, z=932,47], EntityPig['Cochon'/89, l='MpServer', x=948,75, y=4,00, z=943,06], EntityPig['Cochon'/96, l='MpServer', x=971,53, y=4,00, z=796,81], EntityPig['Cochon'/97, l='MpServer', x=961,88, y=4,00, z=788,97], EntityPig['Cochon'/98, l='MpServer', x=961,16, y=4,00, z=924,41], EntitySheep['Mouton'/99, l='MpServer', x=972,13, y=4,00, z=912,94], EntityPig['Cochon'/100, l='MpServer', x=974,38, y=4,00, z=941,81], EntitySheep['Mouton'/101, l='MpServer', x=962,16, y=4,00, z=937,94], EntityChicken['Poule'/102, l='MpServer', x=966,41, y=4,00, z=929,41], EntitySheep['Mouton'/110, l='MpServer', x=982,84, y=4,00, z=817,72], EntitySheep['Mouton'/111, l='MpServer', x=985,38, y=4,00, z=839,75], EntitySheep['Mouton'/112, l='MpServer', x=965,63, y=4,00, z=859,19], EntitySheep['Mouton'/113, l='MpServer', x=978,81, y=4,00, z=911,47], EntityChicken['Poule'/114, l='MpServer', x=980,72, y=4,00, z=923,38], EntityChicken['Poule'/115, l='MpServer', x=985,25, y=4,00, z=939,19], EntitySheep['Mouton'/116, l='MpServer', x=987,22, y=4,00, z=942,19], EntityPig['Cochon'/117, l='MpServer', x=983,13, y=4,00, z=928,94], EntityPig['Cochon'/118, l='MpServer', x=981,81, y=4,00, z=943,13], EntitySheep['Mouton'/121, l='MpServer', x=986,50, y=4,00, z=939,22], EntityPig['Cochon'/127, l='MpServer', x=1001,66, y=4,00, z=790,19]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566) at net.minecraft.client.Minecraft.run(Minecraft.java:984) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 856792728 bytes (817 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 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: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA chelou{beta 0.0.1} [Mod CHELOU] (bin) GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 10.18.15.4248' Renderer: 'Intel(R) HD Graphics' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: Intel(R) HD Graphics GL version 4.3.0 - Build 10.18.15.4248, Intel GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [OneCraft-1.8.zip] Current Language: Français (France) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)Voila je vous ai renvoyé les crash reports si ca peut vous aider!!
-
Le problème est toujours le même.
Un ArrayIndexOutOfBoundsException ce n’est pas compliqué à corriger. -
je sais pas comment faire y a t-il un tuto sur le site qui explique comment le corriger ou pouvez-vous m’aider???
-
Google -> ArrayIndexOutOfBoundsException
Un peu d’autonomie …
C’est de la programmation Java. Faut connaitre les bases pour pouvoir coder. -
Tkt je connais un peu les bases c’est juste que je débute et mon problème est fix!!!
-
Super TUTO!
-
Plop les gens,
J’ai fais deux machines à 3slots grâce à ce tuto bien réalisé.Mais maintenant que j’essaie de faire une machine à un slot et une pourvu de deux slots, j’ai un crash identique dans les deux cas:
–-- Minecraft Crash Report ---- // I blame Dinnerbone. Time: 22/06/16 17:41 Description: Ticking memory connection java.lang.ArrayIndexOutOfBoundsException: 3 at fr.powergame.modpg2.client.TileEntitySechoir.getStackInSlot(TileEntitySechoir.java:38) at net.minecraft.inventory.Slot.getStack(Slot.java:88) at net.minecraft.inventory.Container.getInventory(Container.java:67) at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:53) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:88) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501) at fr.powergame.modpg2.common.BlockSechoir.onBlockActivated(BlockSechoir.java:46) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at fr.powergame.modpg2.client.TileEntitySechoir.getStackInSlot(TileEntitySechoir.java:38) at net.minecraft.inventory.Slot.getStack(Slot.java:88) at net.minecraft.inventory.Container.getInventory(Container.java:67) at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:53) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:88) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501) at fr.powergame.modpg2.common.BlockSechoir.onBlockActivated(BlockSechoir.java:46) at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409) at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@13f82374 Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)Du coup voici la classe du tileEntity pour la machine mono-slot, les tableaux etc, ça me passe encore au dessus =/
package fr.powergame.modpg2.client; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fr.powergame.modpg2.common.AlambicRecipes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntitySechoir extends TileEntity implements IInventory { private byte direction; private ItemStack[] contents = new ItemStack[3]; private int workingTime = 0; private int workingTimeNeeded = 200; @SideOnly(Side.CLIENT) public int getCookProgress() { return this.workingTime * 41 / this.workingTimeNeeded; } @Override public int getSizeInventory() { return this.contents.length; } @Override public ItemStack getStackInSlot(int slotIndex) { return this.contents[slotIndex]; } public ItemStack decrStackSize(int slotIndex, int amount) { if (this.contents[slotIndex] != null) { ItemStack itemstack; if (this.contents[slotIndex].stackSize <= amount) { itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; this.markDirty(); return itemstack; } else { itemstack = this.contents[slotIndex].splitStack(amount); if (this.contents[slotIndex].stackSize == 0) { this.contents[slotIndex] = null; } this.markDirty(); return itemstack; } } else { return null; } } @Override public ItemStack getStackInSlotOnClosing(int slotIndex) { if (this.contents[slotIndex] != null) { ItemStack itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; return itemstack; } else { return null; } } @Override public void setInventorySlotContents(int slotIndex, ItemStack stack) { this.contents[slotIndex] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } this.markDirty(); } @Override public String getInventoryName() { return "tile.Sechoir"; } @Override public boolean hasCustomInventoryName() { return false; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; } @Override public void openInventory() { } @Override public void closeInventory() { } @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return slot == 1 ? false : true; } public boolean isBurning() { return this.workingTime > 0; } private boolean canSmelt() { if (this.contents[0] == null) { return false; } else { ItemStack itemstack = AlambicRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0]}); if (itemstack == null) return false; if (this.contents[1] == null) return true; if (!this.contents[1].isItemEqual(itemstack)) return false; int result = contents[1].stackSize + itemstack.stackSize; return result <= getInventoryStackLimit() && result <= this.contents[1].getMaxStackSize(); } } public void updateEntity() { if(this.isBurning() && this.canSmelt()) { ++this.workingTime; } if(this.canSmelt() && !this.isBurning()) { this.workingTime = 1; } if(this.canSmelt() && this.workingTime == this.workingTimeNeeded) { this.smeltItem(); this.workingTime = 0; } if(!this.canSmelt()) { this.workingTime= 0; } } public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = AlambicRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0]}); if (this.contents[1] == null) { this.contents[1] = itemstack.copy(); } else if (this.contents[1].getItem() == itemstack.getItem()) { this.contents[1].stackSize += itemstack.stackSize; } –this.contents[0].stackSize; if (this.contents[0].stackSize <= 0) { this.contents[0] = null; } } } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.contents.length; ++i) { if (this.contents* != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); this.contents*.writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Items", nbttaglist); compound.setShort("workingTime",(short)this.workingTime); compound.setShort("workingTimeNeeded", (short)this.workingTimeNeeded); compound.setByte("Direction", this.direction); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.contents = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("Slot") & 255; if (j >= 0 && j < this.contents.length) { this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } this.workingTime = compound.getShort("workingTime"); this.workingTimeNeeded = compound.getShort("workingTimeNeeded"); this.direction = compound.getByte("Direction"); } public byte getDirection() { return direction; } public void setDirection(byte direction) { this.direction = direction; this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); } public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound); } public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { this.readFromNBT(pkt.func_148857_g()); this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord); } }Qu’est ce que j’ai oublié de modifier pour parvenir à un bloc fonctionnel, svp?
-
private ItemStack[] contents = new ItemStack[3]; -> à changer en fonction du nombre de slots et il faut aussi modifier le Container
-
J’ai mis à 2, ça crash aussi. (Le trois est un fail, j’ai fais des tests et j’ai laissé cette valeur pour voir un peu de mon côté mais bon)
Edit: Voici le container
package fr.powergame.modpg2.common; import fr.powergame.modpg2.client.TileEntitySechoir; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class SechoirContainer extends Container { private TileEntitySechoir tileSechoir; public SechoirContainer(TileEntitySechoir tile, InventoryPlayer inventory) { this.tileSechoir = tile; this.addSlotToContainer(new Slot(tile, 1, 89, 29)); this.addSlotToContainer(new SechoirSlotResult(tile, 3, 89, 89)); this.bindPlayerInventory(inventory); } @Override public boolean canInteractWith(EntityPlayer player) { return this.tileSechoir.isUseableByPlayer(player); } private void bindPlayerInventory(InventoryPlayer inventory) { int i; for(i = 0; i < 3; ++i) { for(int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 17 + j * 18, 125 + i * 18)); } } for(i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(inventory, i, 17 + i * 18, 183)); } } public ItemStack transferStackInSlot(EntityPlayer player, int quantity) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(quantity); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (quantity < this.tileSechoir.getSizeInventory()) { if (!this.mergeItemStack(itemstack1, this.tileSechoir.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } } else if (!this.mergeItemStack(itemstack1, 0, this.tileSechoir.getSizeInventory(), false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack)null); } else { slot.onSlotChanged(); } } return itemstack; } public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); this.tileSechoir.closeInventory(); } }