Problème GUI
-
Cela ne fonctionne pas non plus :/
-
Dans ton block, à l’endroit où Touvre le gui, t’a mis ton block au lieu de l’instance du mod
-
ça change rien

Quand je clic-droit j’ai bien l’animation du bras du joueur qui clic-droit mais j’ai pas de GUI qui s’ouvre. -
Il faut que tu implemente l’interface ITileEnityProvider, ou que tu mettes extends BlockContainer, car sinon, même si t’a mis hasTileEnity() True, la fonction createNewEntity n’est pas appelée.
-
Dans la class du Block?
-
public class TonBloc extends Block implements ITileEntityProvider -
BrokenSwing t’a répondu
-
:::
[10:54:15] [main/INFO] [GradleStart]: Extra: []
[10:54:15] [main/INFO] [GradleStart]: Password found, attempting login
[10:54:15] [main/INFO]: Logging in with username & password
[10:54:18] [main/INFO] [GradleStart]: Login Succesful!
[10:54:18] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Family/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --userType, mojang, --accessToken, {REDACTED}, --version, 1.7.10, --uuid,***********************, --username, SpyMan, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[10:54:18] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[10:54:18] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[10:54:18] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:54:18] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[10:54:18] [main/INFO] [FML]: Forge Mod Loader version 7.99.40.1614 for Minecraft 1.7.10 loading
[10:54:18] [main/INFO] [FML]: Java is Java HotSpot
64-Bit Server VM, version 1.8.0_66, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jdk1.8.0_66\jre
[10:54:18] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[10:54:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:54:19] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
[10:54:19] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[10:54:19] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:54:19] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[10:54:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:54:19] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:54:19] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:54:19] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:54:19] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[10:54:24] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[10:54:24] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:54:24] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[10:54:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:54:25] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
[10:54:25] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
[10:54:25] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[10:54:27] [main/INFO]: Setting user: SpyMan
[10:54:30] [Client thread/INFO]: LWJGL Version: 2.9.1
[10:54:31] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
// I bet Cylons wouldn’t have this problem.Time: 27/02/16 10:54
Description: Loading screen debug infoThis 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 7 (amd64) version 6.1
Java Version: 1.8.0_66, Oracle Corporation
Java VM Version: Java HotSpot
64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 943100528 bytes (899 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:
GL info: ’ Vendor: ‘Intel’ Version: ‘2.1.0 - Build 8.15.10.2302’ Renderer: ‘Mobile Intel
4 Series Express Chipset Family’
[10:54:32] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[10:54:32] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1614 Initialized
[10:54:32] [Client thread/INFO] [FML]: Replaced 183 ore recipies
[10:54:32] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[10:54:33] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[10:54:33] [Client thread/INFO] [FML]: Searching C:\Users\Family\Desktop\Java Modding\NewMechanicalCraft\eclipse\mods for mods
[10:54:51] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[10:54:52] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mechanicalcraft] at CLIENT
[10:54:52] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mechanicalcraft] at SERVER
[10:54:53] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:MechanicalCraft_beta
[10:54:53] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[10:54:53] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
[10:54:53] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[10:54:53] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[10:54:53] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[10:54:53] [Client thread/INFO] [FML]: Applying holder lookups
[10:54:53] [Client thread/INFO] [FML]: Holder lookups applied
[10:54:53] [Client thread/INFO] [FML]: Injecting itemstacks
[10:54:53] [Client thread/INFO] [FML]: Itemstack injection complete
[10:54:54] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:54:54] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
[10:54:55] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
[10:54:55] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[10:54:57] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
[10:54:57] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:54:57] [Sound Library Loader/INFO]: Sound engine started
[10:55:00] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas
[10:55:00] [Client thread/INFO]: Created: 16x16 textures/items-atlas
[10:55:00] [Client thread/INFO] [FML]: Injecting itemstacks
[10:55:00] [Client thread/INFO] [FML]: Itemstack injection complete
[10:55:00] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[10:55:00] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:MechanicalCraft_beta
[10:55:02] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[10:55:02] [Client thread/INFO]: Created: 512x256 textures/items-atlas
[10:55:02] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:55:02] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
[10:55:03] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]: Author: Paul Lamb, www.paulscode.com
[10:55:03] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:55:03] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:55:03] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
[10:55:03] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
[10:55:03] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[10:55:03] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
[10:55:03] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[10:55:03] [Sound Library Loader/INFO]: Sound engine started
[10:55:11] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
[10:55:11] [Server thread/INFO]: Generating keypair
[10:55:12] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[10:55:13] [Server thread/INFO] [FML]: Applying holder lookups
[10:55:13] [Server thread/INFO] [FML]: Holder lookups applied
[10:55:13] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@725e80c6)
[10:55:14] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@725e80c6)
[10:55:14] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@725e80c6)
[10:55:14] [Server thread/INFO]: Preparing start region for level 0
[10:55:15] [Server thread/INFO]: Preparing spawn area: 46%
[10:55:17] [Server thread/INFO]: Changing view distance to 2, from 10
[10:55:19] [Netty Client IO #0/INFO] [FML]: Server protocol version 2
[10:55:19] [Netty IO #1/INFO] [FML]: Client protocol version 2
[10:55:19] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@7.10.99.99,Forge@10.13.4.1614,mcp@9.05,mechanicalcraft@1.0.0
[10:55:19] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
[10:55:19] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
[10:55:19] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[10:55:19] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
[10:55:20] [Server thread/INFO]: SpyMan[local:E:dac59dea] logged in with entity id 197 at (-547.2541826537, 4.0, -1237.5136427791615)
[10:55:20] [Server thread/INFO]: SpyMan joined the game
[10:55:23] [Server thread/WARN]: Can’t keep up! Did the system time change, or is the server overloaded? Running 6120ms behind, skipping 122 tick(s)
[10:55:34] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking memory connection
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[IntegratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Caused by: java.lang.ClassCastException: com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.TileEntityAlloyer cannot be cast to net.minecraft.inventory.IInventory
at com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.ContainerAlloyer.<init>(ContainerAlloyer.java:17) ~[ContainerAlloyer.class:?]
at com.google.SpyMan.Mechanicalcraft.common.GuiHandler.getServerGuiElement(GuiHandler.java:19) ~[GuiHandler.class:?]
at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:243) ~[NetworkRegistry.class:?]
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75) ~[FMLNetworkHandler.class:?]
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501) ~[EntityPlayer.class:?]
at com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.Alloyer.onBlockActivated(Alloyer.java:138) ~[Alloyer.class:?]
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409) ~[ItemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
… 5 more
[10:55:34] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Family\Desktop\Java Modding\NewMechanicalCraft\eclipse.\crash-reports\crash-2016-02-27_10.55.34-server.txt
[10:55:34] [Server thread/INFO]: Stopping server
[10:55:34] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
// I feel sad now
Time: 27/02/16 10:55
Description: Ticking memory connectionjava.lang.ClassCastException: com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.TileEntityAlloyer cannot be cast to net.minecraft.inventory.IInventory
at com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.ContainerAlloyer.<init>(ContainerAlloyer.java:17)
at com.google.SpyMan.Mechanicalcraft.common.GuiHandler.getServerGuiElement(GuiHandler.java:19)
at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:243)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501)
at com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.Alloyer.onBlockActivated(Alloyer.java:138)
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 com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.ContainerAlloyer.<init>(ContainerAlloyer.java:17)
at com.google.SpyMan.Mechanicalcraft.common.GuiHandler.getServerGuiElement(GuiHandler.java:19)
at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:243)
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75)
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501)
at com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.Alloyer.onBlockActivated(Alloyer.java:138)
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@19be8785
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)– System Details –
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_66, Oracle Corporation
Java VM Version: Java HotSpot
64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 936439104 bytes (893 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.1614 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.1614-1.7.10.jar)
UCHIJAAAA Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar)
UCHIJAAAA mechanicalcraft{1.0.0} [MechanicalCraft_beta] (NewMechanicalCraft)
GL info:ERRORRuntimeException: 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[‘SpyMan’/197, l=‘New World’, x=-547,25, y=4,00, z=-1237,51]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to ‘fml,forge’
[10:55:34] [Server thread/INFO]: Saving players
[10:55:34] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-02-27_10.55.34-server.txt
[10:55:34] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
[10:55:34] [Server thread/INFO]: Saving worlds
[10:55:34] [Server thread/INFO]: Saving chunks for level ‘New World’/Overworld
[10:55:35] [Server thread/INFO]: Saving chunks for level ‘New World’/Nether
[10:55:35] [Server thread/INFO]: Saving chunks for level ‘New World’/The End
[10:55:36] [Server thread/INFO] [FML]: Unloading dimension 0
[10:55:36] [Server thread/INFO] [FML]: Unloading dimension -1
[10:55:36] [Server thread/INFO] [FML]: Unloading dimension 1
[10:55:36] [Server thread/INFO] [FML]: Applying holder lookups
[10:55:36] [Server thread/INFO] [FML]: Holder lookups applied
[10:55:36] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
[10:55:36] [Client thread/INFO] [FML]: Server terminated.
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot
64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future releaseProcess finished with exit code -1</init></init></init>
:::
-
Holy sh*t qu’est ce que ça ? Fait plutôt un lien vers un pastebin
Ensuite : Caused by: java.lang.ClassCastException: com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer.TileEntityAlloyer cannot be cast to net.minecraft.inventory.IInventory
Il faut que tu implémente l’interface IIventory à ton tileentity -
OMG ! ça marche enfin ! MERCI
PS : ça faisait 2/3 mois que je cherchais la solution a ce problème -
J’ai un autre petit soucis le craft ne se lance pas dans la machine
-
Envoie la classe de ton TileEntity et la classe de ta recette s’il te plaît (flemme de download ton src)
EDIT : Je vais le télécharger finalement -
Lol
:::[font=Consolas**package **]com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer%(#aaa9a7)[;
]
**import **java.util.HashMap%(#aaa9a7)[;
]**import **java.util.Iterator%(#aaa9a7)[;
]**import **java.util.Map%(#aaa9a7)[;
]**import **java.util.Map.Entry%(#aaa9a7)[;
]
**import **net.minecraft.block.Block%(#aaa9a7)[;
]**import **net.minecraft.init.Blocks%(#aaa9a7)[;
]**import **net.minecraft.init.Items%(#aaa9a7)[;
]**import **net.minecraft.item.Item%(#aaa9a7)[;
]**import **net.minecraft.item.ItemStack%(#aaa9a7)[;
]
**public class **%(#345f99)[AlloyerRecipes
]{
**private static final **AlloyerRecipes **smeltingBase **= **new **%(#afb8c5)AlloyerRecipes%(#aaa9a7)[;
] **private **Map **smeltingList **= **new **%(#afb8c5)HashMap%(#aaa9a7)[;
]
**public **%(#afb8c5)AlloyerRecipes
{
this.addRecipe(Items.apple, Items.apple, Items.arrow, **new **%(#afb8c5)ItemStack)%(#aaa9a7)[;
] }**public void **addRecipe(ItemStack stack1, ItemStack stack2, ItemStack stack3, ItemStack stack4)
{
ItemStack[] **stackList **= **new **ItemStack[] {stack1, stack2, stack3}%(#aaa9a7)[;
] this.smeltingList.put(stackList, stack4)%(#aaa9a7)[;
] }**public void **addRecipe(Item item1, Item item2, Item item3, ItemStack stack)
{
this.addRecipe(**new **%(#afb8c5)ItemStack, **new **%(#afb8c5)ItemStack, **new **%(#afb8c5)ItemStack, stack)%(#aaa9a7)[;
] }**public void **addRecipe(Block block1, Item item2, Item item3, ItemStack stack)
{
this.addRecipe(Item.%(#afb8c5)getItemFromBlock, item2, item3, stack)%(#aaa9a7)[;
] }**public void **addRecipe(Block block1, Block block2, Item item3, ItemStack stack)
{
this.addRecipe(Item.%(#afb8c5)getItemFromBlock, Item.%(#afb8c5)getItemFromBlock, item3, stack)%(#aaa9a7)[;
] }**public void **addRecipe(Block block1, Block block2, Block block3, ItemStack stack)
{
this.addRecipe(Item.%(#afb8c5)getItemFromBlock, Item.%(#afb8c5)getItemFromBlock, Item.%(#afb8c5)getItemFromBlock, stack)%(#aaa9a7)[;
] }**public **ItemStack getSmeltingResult(ItemStack[] stack)
{
Iterator **iterator **= this.smeltingList.%(#afb8c5)entrySet.%(#afb8c5)iterator%(#aaa9a7)[;
] Entry entry%(#aaa9a7)[;
]
%(#0187df)[**do
**] {
%(#0187df)if
{
return null%(#aaa9a7)[;
] }
**entry **%(#aaa9a7)= iterator.%(#afb8c5)next%(#aaa9a7)[;
] }
while(!this.isSameKey(stack%(#aaa9a7), entry.%(#afb8c5)getKey))%(#aaa9a7)[;
]
%(#0187df)**return **entry.%(#afb8c5)getValue%(#aaa9a7)[;
] }**private boolean **isSameKey(ItemStack[] stackList, ItemStack[] stackList2)
{
**boolean ****isSame **= false%(#aaa9a7)[;
] for(**int ****i **= 0; **i **<= 2; i++)
{
if(stackList[i].%(#afb8c5)getItem == stackList2[i].%(#afb8c5)getItem)
{
**isSame **= true%(#aaa9a7)[;
] }
%(#0187df)[**else
**] {
return false%(#aaa9a7)[;
] }
}
**return **isSame%(#aaa9a7)[;
] }**public **Map %(#afb8c5)getSmeltingList
{
return this.smeltingList%(#aaa9a7)[;
] }**public static **AlloyerRecipes %(#afb8c5)smelting
{
**return **smeltingBase%(#aaa9a7)[;
] }
}:::
:::[font=Consolas**package **]com.google.SpyMan.Mechanicalcraft.common.BlockAlloyer%(#aaa9a7)[;
]
**import **net.minecraft.entity.player.EntityPlayer%(#aaa9a7)[;
]**import **net.minecraft.inventory.IInventory%(#aaa9a7)[;
]**import **net.minecraft.item.ItemStack%(#aaa9a7)[;
]**import **net.minecraft.nbt.NBTTagCompound%(#aaa9a7)[;
]**import **net.minecraft.nbt.NBTTagList%(#aaa9a7)[;
]**import **net.minecraft.tileentity.TileEntity%(#aaa9a7)[;
]
**public class **TileEntityAlloyer **extends **TileEntity **implements **%(#345f99)[IInventory
]{
**private byte **direction%(#aaa9a7)[;
] **public byte **%(#afb8c5)getDirection
{
**return **direction%(#aaa9a7)[;
] }**public void **setDirection(**byte **direction)
{
this.**direction **= direction%(#aaa9a7)[;
] this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord)%(#aaa9a7)[;
] }
**private **ItemStack[] **contents **= **new **ItemStack[4]%(#aaa9a7)[;
] **private int ****workingTime **= 0%(#aaa9a7)[;
] **private int ***workingTimeNeeded = 0%(#aaa9a7)[;
]
%(#278c3c)[@Override
***] **public void **writeToNBT(NBTTagCompound compound)
{
super.%(#afb8c5)writeToNBT%(#aaa9a7)[;
] NBTTagList **nbttaglist **= **new **%(#afb8c5)NBTTagList%(#aaa9a7)[;
] compound.setByte(“Direction”, this.direction)%(#aaa9a7)[;
] for(**int ****i **= 0; **i **< this.contents.length; ++i)
{
if(this.contents[i] != null)
{
NBTTagCompound **nbttagcompound1 **= **new **%(#afb8c5)NBTTagCompound%(#aaa9a7)[;
] nbttagcompound1.setByte(“Slot”%(#aaa9a7), i)%(#aaa9a7)[;
] this.contents[i].%(#afb8c5)writeToNBT%(#aaa9a7)[;
] nbttaglist.%(#afb8c5)appendTag%(#aaa9a7)[;
]
}
}
compound.setTag(“Items”, nbttaglist)%(#aaa9a7)[;
] compound.setShort(“workingTime”%(#aaa9a7), this.workingTime)%(#aaa9a7)[;
] compound.setShort(“workingTimeNeeded”%(#aaa9a7), this.workingTimeNeeded)%(#aaa9a7)[;
] }%(#278c3c)[***@Override
***] **public void **readFromNBT(NBTTagCompound compound)
{
super.%(#afb8c5)readFromNBT%(#aaa9a7)[;
] this.**direction **= compound.%(#afb8c5)getByte%(#aaa9a7)[;
] NBTTagList **nbttaglist **= compound.getTagList(“Items”, 10)%(#aaa9a7)[;
] this.**contents **= **new **ItemStack[this.%(#afb8c5)getSizeInventory]%(#aaa9a7)[;
]
for(**int ****i **= 0; **i **< nbttaglist.%(#afb8c5)tagCount; ++i)
{
NBTTagCompound **nbttagcompound1 **= nbttaglist.%(#afb8c5)getCompoundTagAt%(#aaa9a7)[;
] **int ****j **= nbttagcompound1.%(#afb8c5)getByte & 255%(#aaa9a7)[;
]
if(**j **>= 0 && **j **< this.contents.length)
{
this.contents[j] = ItemStack.%(#afb8c5)loadItemStackFromNBT%(#aaa9a7)[;
] }
}
this.**workingTime **= compound.%(#afb8c5)getShort%(#aaa9a7)[;
] this.**workingTimeNeeded **= compound.%(#afb8c5)getShort%(#aaa9a7)[;
] }**public int **%(#afb8c5)getSizeInventory
{
return this.contents.length%(#aaa9a7)[;
] }**public **ItemStack getStackInSlot(**int **slotIndex)
{
return this.contents[slotIndex]%(#aaa9a7)[;
] }**public **ItemStack decrStackSize(**int **slotIndex, **int **amount)
{
if(this.contents[slotIndex] != null)
{
ItemStack itemstack%(#aaa9a7)[;
]
if(this.contents[slotIndex].**stackSize **<= amount)
{
**itemstack **= this.contents[slotIndex]%(#aaa9a7)[;
] this.contents[slotIndex] = null%(#aaa9a7)[;
] this.%(#afb8c5)markDirty%(#aaa9a7)[;
] **return **itemstack%(#aaa9a7)[;
] }
%(#0187df)[**else
**] {
**itemstack **= this.contents[slotIndex].%(#afb8c5)splitStack%(#aaa9a7)[;
]
if(this.contents[slotIndex].**stackSize **== 0)
{
this.contents[slotIndex] = null%(#aaa9a7)[;
] }
this.%(#afb8c5)markDirty%(#aaa9a7)[;
] **return **itemstack%(#aaa9a7)[;
] }
}
%(#0187df)[**else
**] {
return null%(#aaa9a7)[;
] }
}**public **ItemStack getStackInSlotOnClosing(**int **slotIndex)
{
if(this.contents[slotIndex] != null)
{
ItemStack **itemstack **= this.contents[slotIndex]%(#aaa9a7)[;
] this.contents[slotIndex] = null%(#aaa9a7)[;
] **return **itemstack%(#aaa9a7)[;
] }
%(#0187df)[**else
**] {
return null%(#aaa9a7)[;
] }
}**public void **setInventorySlotContents(**int **slotIndex, ItemStack stack)
{
this.contents[slotIndex] = stack%(#aaa9a7)[;
]
if(*stack *!= **null **&& stack.**stackSize **> this.%(#afb8c5)getInventoryStackLimit)
{
stack.**stackSize **= this.%(#afb8c5)getInventoryStackLimit%(#aaa9a7)[;
] }
this.%(#afb8c5)markDirty%(#aaa9a7)[;
] }**public **String %(#afb8c5)getInventoryName
{
**return **“tile.Alloyer”%(#aaa9a7)[;
] }**public boolean **%(#afb8c5)hasCustomInventoryName
{
return false%(#aaa9a7)[;
] }**public int **%(#afb8c5)getInventoryStackLimit
{
**return **64%(#aaa9a7)[;
] }**public boolean **isUseableByPlayer(EntityPlayer player)
{
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != **this **? **false **: player.getDistanceSq((double)this.**xCoord **+ 0.5D%(#aaa9a7), this.**yCoord **+ 0.5D%(#aaa9a7), this.**zCoord **+ 0.5D) <= 64.0D%(#aaa9a7)[;
] }**public void **%(#afb8c5)openInventory
{}
**public void **%(#afb8c5)closeInventory
{}
**public boolean **isItemValidForSlot(**int **slot, ItemStack stack)
{
**return ***slot *== 3 ? **false **: true%(#aaa9a7)[;
] }**public boolean **%(#afb8c5)isBurning
{
return this.**workingTime **> 0%(#aaa9a7)[;
] }**private boolean **%(#afb8c5)canSmelt
{
if(this.contents[0] == **null **|| this.contents[1] == **null **|| this.contents[2] == null)
{
return false%(#aaa9a7)[;
] }
%(#0187df)[**else
**] {
ItemStack **itemstack **= AlloyerRecipes.%(#afb8c5)smelting.getSmeltingResult(**new **ItemStack[] {this.contents[0], this.contents[1], this.contents[2]})%(#aaa9a7)[;
] if(**itemstack **== null)
return false%(#aaa9a7)[;
] if(this.contents[3] == null)
return true%(#aaa9a7)[;
] %(#0187df)if
return false%(#aaa9a7)[;
] **int ****result **= contents[3].**stackSize **+ itemstack.stackSize%(#aaa9a7)[;
] **return ****result **<= %(#afb8c5)getInventoryStackLimit && **result **<= this.contents[3].%(#afb8c5)getMaxStackSize%(#aaa9a7)[;
] }
}**public void **%(#afb8c5)updateEntity
{
if(this.%(#afb8c5)isBurning && this.%(#afb8c5)canSmelt)
{
++this.workingTime%(#aaa9a7)[;
] }
if(this.%(#afb8c5)canSmelt && !this.%(#afb8c5)isBurning)
{
this.**workingTime **= 1%(#aaa9a7)[;
] }
if(this.%(#afb8c5)canSmelt && this.**workingTime **== this.workingTimeNeeded)
{
this.%(#afb8c5)smeltItem%(#aaa9a7)[;
] this.**workingTime **= 0%(#aaa9a7)[;
] }
%(#0187df)if
{
this.**workingTime **= 0%(#aaa9a7)[;
] }
}**public void **%(#afb8c5)smeltItem
{
%(#0187df)if
{
ItemStack **itemstack **= AlloyerRecipes.%(#afb8c5)smelting.getSmeltingResult(**new **ItemStack[] {this.contents[0], this.contents[1], this.contents[2]})%(#aaa9a7)[;
] if(this.contents[3] == null)
{
this.contents[3] = itemstack.%(#afb8c5)copy%(#aaa9a7)[;
] }
else if(this.contents[3].%(#afb8c5)getItem == itemstack.%(#afb8c5)getItem)
{
this.contents[3].**stackSize **+= itemstack.stackSize%(#aaa9a7)[;
] }–this.contents[0].stackSize%(#aaa9a7)[;
] –this.contents[1].stackSize%(#aaa9a7)[;
] –this.contents[2].stackSize%(#aaa9a7)[;
]
if(this.contents[0].**stackSize **<= 0)
{
this.contents[0] = null%(#aaa9a7)[;
] }
if(this.contents[1].**stackSize **<= 0)
{
this.contents[1] = null%(#aaa9a7)[;
] }
if(this.contents[2].**stackSize **<= 0)
{
this.contents[2] = null%(#aaa9a7)[;
] }
}
}
}:::
-
Ta méthode isBurning return workingTime > 0 or pour que cette condition soit remplie, il faut que isBurning return true, donc workingTime ne peut pas augmenter
-
Comme ceci ?
[font=Consolas**public boolean **]%(#afb8c5)isBurning
{
return true%(#aaa9a7)[;
]} -
Ah non, j’avais pas vu qq chose, le problème vient d’autre part ^^
Essaye de vérifier si les id de tes slots sont bien cnfigurés (dans le Container) et si tu place les items dans les bons slots.
-
J’ai déjà verifié les slots
-
private int workingTimeNeeded = 0;C’est ça qui pose un problème il faut que la valeur soit > 0 et pour + de sécurité met ça comme fonction updateEntity() :
public void updateEntity() { if(this.isBurning() && this.canSmelt()) { ++this.workingTime; //System.out.println(workingTime + "/" + workingTimeNeeded); C'est ici que j'ai vu le problème } if(this.canSmelt() && !this.isBurning()) { this.workingTime = 1; } if(this.canSmelt() && this.workingTime >= this.workingTimeNeeded) //Au lieu de == mettre >= au cas où { this.smeltItem(); this.workingTime = 0; } if(!this.canSmelt()) { this.workingTime = 0; } }EDIT : et change pas ta fonction isBurning(), surtout pas, il faut laisser ```java
return this.workingTime > 0;EDIT 2: En fait pour informer la fonction isBurning n'est pas vraiment utile pour le fonctionnement, elle est + utile pour le rendu quand on veut par exemple rendre une texture différente selon si il est en pleine cuissson ou non (comme le four de minecraft), du coup la fonction updateEntity pourrai ressembler à ça : ```java public void updateEntity() { if(this.canSmelt()) { ++this.workingTime; } if(this.workingTime >= this.workingTimeNeeded) { this.smeltItem(); this.workingTime = 0; } if(!this.canSmelt()) { this.workingTime = 0; } } -
D’accord, mais ma machine est un four avec trois slots en entré (un pour le charbon, et les 2 autres pour le craft) et un dernier pour le résultat du craft
Comment je peut faire un slot pour le combustible ?
et aussi appliqué la texture des flammes et les flèche de progression comme le four de minecraft ? -
Pour la barre de progression : http://www.minecraftforgefrance.fr/showthread.php?tid=2017#bonus
Et pour le slot du carburant (c’est en 1.8 mais c’est l’idée qu’il faut reprendre pas tout le code) : http://www.minecraftforgefrance.fr/showthread.php?tid=2716#