Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mekelaina

Members
  • Joined

  • Last visited

Everything posted by Mekelaina

  1. @V0idWa1k3r After some testing, I've found that the size I give it has no effect. Rather The List<Slot> object is being capped at 46 for some reason (so 0-45), As you can see here: as it doesn't tell me the spot where the size is being limited, I've no idea what's the problem. And It's only on this container. Could the problem be that I'm trying to add more than the player's Inventory and one other IInventory? Because the code you mentioned: IItemHandler deckboxInv = new ItemStackHandler(90); Is meant to be a placeholder for the inventory of the deckbox, which is what gets placed in the center slot I circled in pink at the start of this thread. I'm so lost here, This shouldn't be this complicated
  2. @V0idWa1k3r ok, I changed the value to just a raw integer (so no variable) and it still gave me the same problem
  3. @V0idWa1k3r Ok, so I'm trying to do something similar to the way horse inventories work, but encountering an error that doesn't really make sense. When I try to open the container, its throwing index out of bound exceptions as if the size of my inventory is 46. I've no idea where it got that number from because I originally set it to 52 slots. I tried setting the size to 100 for the sake of testing but it still only uses 46? I made an item that could hold 90 items plus the player's standard inventory and hotbar and didn't get this problem. This is the error log: [16:43:00] [main/INFO] [GradleStart]: Extra: [] [16:43:01] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/ChloeRae/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [16:43:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:43:01] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:43:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [16:43:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [16:43:01] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading [16:43:01] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_201, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_201 [16:43:01] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory. [16:43:01] [main/ERROR] [FML]: Full: C:\Users\ChloeRae\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar [16:43:01] [main/ERROR] [FML]: Trimmed: c:/users/chloerae/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/ [16:43:01] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [16:43:01] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs. 2019-04-23 16:43:02,427 main WARN Disabling terminal, you're running in an unsupported environment. [16:43:02] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin [16:43:02] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin [16:43:02] [main/INFO] [FML]: Searching C:\Users\ChloeRae\Desktop\All modern minecraft modding shiz\duelcraftprogram\Duelcraft\run\.\mods for mods [16:43:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [16:43:02] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [16:43:02] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [16:43:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:43:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:43:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [16:43:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:43:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:43:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:43:04] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [16:43:04] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:43:04] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:43:05] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [16:43:05] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [16:43:05] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [16:43:05] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [16:43:05] [main/INFO] [minecraft/Minecraft]: Setting user: Player129 [16:43:08] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer: [16:43:08] [main/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4 [16:43:09] [main/INFO] [FML]: -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_201, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 269072512 bytes (256 MB) / 434110464 bytes (414 MB) up to 3810525184 bytes (3634 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 425.31' Renderer: 'GeForce GTX 1050 Ti/PCIe/SSE2' [16:43:09] [main/INFO] [FML]: MinecraftForge v14.23.5.2768 Initialized [16:43:09] [main/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients. [16:43:09] [main/INFO] [FML]: Replaced 1036 ore ingredients [16:43:10] [main/INFO] [FML]: Searching C:\Users\ChloeRae\Desktop\All modern minecraft modding shiz\duelcraftprogram\Duelcraft\run\.\mods for mods [16:43:11] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 17746484 nanos [16:43:14] [main/INFO] [FML]: Forge Mod Loader has identified 5 mods to load [16:43:14] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, duelcraft] at CLIENT [16:43:14] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, duelcraft] at SERVER [16:43:15] [main/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Duelcraft [16:43:15] [main/INFO] [FML]: Processing ObjectHolder annotations [16:43:15] [main/INFO] [FML]: Found 1168 ObjectHolder annotations [16:43:15] [main/INFO] [FML]: Identifying ItemStackHolder annotations [16:43:15] [main/INFO] [FML]: Found 0 ItemStackHolder annotations [16:43:15] [main/INFO] [FML]: Configured a dormant chunk cache size of 0 [16:43:15] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [16:43:15] [main/INFO] [STDOUT]: [com.mekelaina.duelcraft.util.handlers.CardLoadingHandler:loadCardInfo:66]: Loaded data successfully [16:43:15] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null [16:43:15] [main/WARN] [FML]: **************************************** [16:43:15] [main/WARN] [FML]: * Invalid registration attempt for an Ore Dictionary item with name oreKaibaCrystal has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this. [16:43:15] [main/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOreImpl(OreDictionary.java:660) [16:43:15] [main/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:646) [16:43:15] [main/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:645) [16:43:15] [main/WARN] [FML]: * at com.mekelaina.duelcraft.blocks.BlockOreBase.initOreDict(BlockOreBase.java:71) [16:43:15] [main/WARN] [FML]: * at com.mekelaina.duelcraft.util.handlers.RegistryHandler.onBlockRegister(RegistryHandler.java:51) [16:43:15] [main/WARN] [FML]: * at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_RegistryHandler_onBlockRegister_Register.invoke(.dynamic)... [16:43:15] [main/WARN] [FML]: **************************************** [16:43:15] [main/INFO] [FML]: Applying holder lookups [16:43:15] [main/INFO] [FML]: Holder lookups applied [16:43:15] [main/INFO] [FML]: Applying holder lookups [16:43:15] [main/INFO] [FML]: Holder lookups applied [16:43:15] [main/INFO] [FML]: Applying holder lookups [16:43:15] [main/INFO] [FML]: Holder lookups applied [16:43:15] [main/INFO] [FML]: Applying holder lookups [16:43:15] [main/INFO] [FML]: Holder lookups applied [16:43:15] [main/INFO] [FML]: Injecting itemstacks [16:43:15] [main/INFO] [FML]: Itemstack injection complete [16:43:21] [Sound Library Loader/INFO] [minecraft/SoundManager]: Starting up SoundSystem... [16:43:21] [Thread-5/INFO] [minecraft/SoundManager]: Initializing LWJGL OpenAL [16:43:21] [Thread-5/INFO] [minecraft/SoundManager]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [16:43:21] [Thread-5/INFO] [minecraft/SoundManager]: OpenAL initialized. [16:43:21] [Sound Library Loader/INFO] [minecraft/SoundManager]: Sound engine started [16:43:26] [main/WARN] [minecraft/ModelBlock]: Unable to resolve texture due to upward reference: #1 in duelcraft:models/item/deckbox [16:43:29] [main/INFO] [FML]: Max texture size: 16384 [16:43:30] [main/INFO] [minecraft/TextureMap]: Created: 1024x512 textures-atlas [16:43:31] [main/INFO] [FML]: Applying holder lookups [16:43:31] [main/INFO] [FML]: Holder lookups applied [16:43:31] [main/INFO] [FML]: Injecting itemstacks [16:43:31] [main/INFO] [FML]: Itemstack injection complete [16:43:31] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods [16:43:31] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer: [16:43:31] [main/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: The following texture errors were found. [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: ================================================== [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: DOMAIN minecraft [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: -------------------------------------------------- [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: domain minecraft is missing 2 textures [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: domain minecraft has 3 locations: [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: unknown resourcepack type net.minecraft.client.resources.DefaultResourcePack : Default [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: unknown resourcepack type net.minecraft.client.resources.LegacyV2Adapter : FMLFileResourcePack:Forge Mod Loader [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: unknown resourcepack type net.minecraft.client.resources.LegacyV2Adapter : FMLFileResourcePack:Minecraft Forge [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: ------------------------- [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: The missing resources for domain minecraft are: [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: textures/block/quartz_block_side.png [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: textures/block/quartz_pillar.png [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: ------------------------- [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: No other errors exist for domain minecraft [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: ================================================== [16:43:32] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= [16:43:32] [Realms Notification Availability checker #1/INFO] [mojang/RealmsClient]: Could not authorize you against Realms server: Invalid session id [16:43:40] [Server thread/INFO] [minecraft/IntegratedServer]: Starting integrated minecraft server version 1.12.2 [16:43:40] [Server thread/INFO] [minecraft/IntegratedServer]: Generating keypair [16:43:40] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance [16:43:41] [Server thread/INFO] [FML]: Registry Block: Found a missing id from the world duelcraft:card_table [16:43:41] [Server thread/INFO] [FML]: Applying holder lookups [16:43:41] [Server thread/INFO] [FML]: Holder lookups applied [16:43:41] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@740eda40) [16:43:41] [Server thread/INFO] [minecraft/AdvancementList]: Loaded 488 advancements [16:43:41] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@740eda40) [16:43:41] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@740eda40) [16:43:42] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for level 0 [16:43:42] [Server thread/WARN] [minecraft/WorldServer]: Keeping entity minecraft:horse that already exists with UUID 16879d4a-e028-4138-a421-a1e485891759 [16:43:42] [Server thread/INFO] [FML]: Unloading dimension -1 [16:43:42] [Server thread/INFO] [FML]: Unloading dimension 1 [16:43:42] [Server thread/INFO] [minecraft/IntegratedServer]: Changing view distance to 12, from 10 [16:43:44] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [16:43:44] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [16:43:44] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected] [16:43:44] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [16:43:44] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [16:43:44] [Server thread/INFO] [minecraft/PlayerList]: Player129[local:E:7ddde36d] logged in with entity id 75 at (-441.66149210798767, 4.0, -329.20041860417973) [16:43:44] [Server thread/INFO] [minecraft/MinecraftServer]: Player129 joined the game [16:43:45] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [16:43:45] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld [16:43:45] [pool-2-thread-1/WARN] [mojang/YggdrasilMinecraftSessionService]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@54286e0b[id=3584c7cd-614b-3687-b1ad-b239e7a37bd8,name=Player129,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) [guava-21.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:4154) [guava-21.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) [guava-21.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3181) [Minecraft.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_201] at java.lang.Thread.run(Unknown Source) [?:1.8.0_201] [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 46, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 46, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.setAll(Container.java:565) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1314) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketWindowItems.processPacket(SPacketWindowItems.java:68) ~[SPacketWindowItems.class:?] at net.minecraft.network.play.server.SPacketWindowItems.processPacket(SPacketWindowItems.java:13) ~[SPacketWindowItems.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 61, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 61, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:557) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1270) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:33) ~[SPacketSetSlot.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:11) ~[SPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 69, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 69, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:557) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1270) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:33) ~[SPacketSetSlot.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:11) ~[SPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 70, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 70, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:557) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1270) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:33) ~[SPacketSetSlot.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:11) ~[SPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 78, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 78, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:557) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1270) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:33) ~[SPacketSetSlot.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:11) ~[SPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [16:43:48] [main/FATAL] [minecraft/Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 79, Size: 46 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1177) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 79, Size: 46 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.inventory.Container.getSlot(Container.java:141) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:557) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1270) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:33) ~[SPacketSetSlot.class:?] at net.minecraft.network.play.server.SPacketSetSlot.processPacket(SPacketSetSlot.java:11) ~[SPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more and this is the container code: package com.mekelaina.duelcraft.container; import com.mekelaina.duelcraft.items.ItemCard; import com.mekelaina.duelcraft.items.ItemCardBinder; import com.mekelaina.duelcraft.items.ItemDeckbox; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.SlotItemHandler; public class ContainerBinder extends CommonContainer { private int refX; private int refY; private InventoryPlayer playerInv; IItemHandler binderInv; //private GuiBinder GuiInstance; private static final int SLOT_WIDTH = 18; private static final int XSTART_DECKBOX = 140; private static final int YSTART_DECKBOX = 32; private static final int XSTART_BINDER = XSTART_DECKBOX + 112; private static final int YSTART_BINDER = YSTART_DECKBOX; private static final int XSTART_MID = XSTART_DECKBOX + 42; private static final int YSTART_MID = YSTART_DECKBOX + 13; //private static final int numRows = 5; private ItemCardBinder binderItem; public ContainerBinder(InventoryPlayer playerInv, IItemHandler binderInv, int numSlots, Item ItemIn) { super(numSlots); this.playerInv = playerInv; this.binderInv = binderInv; this.binderItem = (ItemCardBinder) ItemIn; IItemHandler deckboxInv = new ItemStackHandler(ItemDeckbox.getInvSize()); int numRows = 5; int numColumns = 5; for(int y = 0; y < numRows; ++y) { for(int x = 0; x < numColumns; ++x) { int index = x + (y * numColumns); int xPos = XSTART_BINDER + (x * SLOT_WIDTH); int yPos = YSTART_BINDER + (y * SLOT_WIDTH); this.addSlotToContainer(new SlotItemHandler(binderInv, index, xPos, yPos) { @Override public boolean isItemValid(ItemStack stack) { if(stack.getItem() instanceof ItemCard && stack.hasTagCompound()) { return true; } return false; } }); } } this.addSlotToContainer(new SlotItemHandler(binderInv, 26, 117, 41) { @Override public boolean isItemValid(ItemStack stack) { if(stack.getItem() instanceof ItemDeckbox) { return true; } return false; } @Override public int getSlotStackLimit() { return 1; } }); /*if(binderItem.hasDeckbox()) {*/ for(int y = 0; y < numRows; ++y) { for(int x = 0; x < numColumns; ++x) { int index = x + (y * numColumns); int xPos = XSTART_DECKBOX + (x * SLOT_WIDTH); int yPos = YSTART_DECKBOX + (y * SLOT_WIDTH); this.addSlotToContainer(new SlotItemHandler(deckboxInv, index, xPos, yPos) { @Override public boolean isItemValid(ItemStack stack) { if(stack.getItem() instanceof ItemCard && stack.hasTagCompound()) { return true; } return false; } @Override public boolean isEnabled() { if(binderItem.hasDeckbox()) { return true; } return false; } }); } } //} for (int y = 0; y < 3; ++y) { for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, (x * 18) + 8, 106 + y * 18)); // x + y * 9 + 9 // 0 + 0 * 9 + 9 = 9 // 1 + 0 * 9 + 9 = 10 // 2 + 0 * 9 + 9 = 11 // 3 + 0 * 9 + 9 = 12 // 4 + 0 * 9 + 9 = 13 // 5 + 0 * 9 + 9 = 14 // 6 + 0 * 9 + 9 = 15 // 7 + 0 * 9 + 9 = 16 // 8 + 0 * 9 + 9 = 17 // 0 + 1 * 9 + 9 = 18 // 1 + 1 * 9 + 9 = 19 // 2 + 1 * 9 + 9 = 20 // 3 + 1 * 9 + 9 = 21 // 4 + 1 * 9 + 9 = 22 // 5 + 1 * 9 + 9 = 23 // 6 + 1 * 9 + 9 = 24 // 7 + 1 * 9 + 9 = 25 // 8 + 1 * 9 + 9 = 26 // ... } } // Hot bar for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(playerInv, x, (x * 18) + 8, 164)); } } public void setRefValues(int x, int y) { refX = x; refY = y; } public void setDeckboxStatus(ItemStack stack) { } } and the Common container the above extends: package com.mekelaina.duelcraft.container; import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class CommonContainer extends Container { private final int numSlots; public CommonContainer(int numSlots) { this.numSlots = numSlots; } @Override public boolean canInteractWith(EntityPlayer playerIn) { return true; } @Override @Nonnull public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = ItemStack.EMPTY; Slot slot = (Slot)this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index < numSlots) { if (!this.mergeItemStack(itemstack1, numSlots, this.inventorySlots.size(), true)) { return ItemStack.EMPTY; } } else if (!this.mergeItemStack(itemstack1, 0, numSlots, false)) { return ItemStack.EMPTY; } if (itemstack1.getCount() == 0) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } } return itemstack; } @Override protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection){ boolean flag = false; int i = startIndex; if (reverseDirection) i = endIndex - 1; if (stack.isStackable()){ while (stack.getCount() > 0 && (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex)){ Slot slot = (Slot)this.inventorySlots.get(i); ItemStack itemstack = slot.getStack(); int maxLimit = Math.min(stack.getMaxStackSize(), slot.getSlotStackLimit()); if (!itemstack.isEmpty() && areItemStacksEqual(stack, itemstack)){ int j = itemstack.getCount() + stack.getCount(); if (j <= maxLimit){ stack.setCount(0); itemstack.setCount(j); slot.onSlotChanged(); flag = true; }else if (itemstack.getCount() < maxLimit){ stack.shrink(maxLimit - itemstack.getCount()); itemstack.setCount(maxLimit); slot.onSlotChanged(); flag = true; } } if (reverseDirection){ --i; }else ++i; } } if (stack.getCount() > 0){ if (reverseDirection){ i = endIndex - 1; }else i = startIndex; while (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex){ Slot slot1 = (Slot)this.inventorySlots.get(i); ItemStack itemstack1 = slot1.getStack(); if (itemstack1.isEmpty() && slot1.isItemValid(stack)){ // Forge: Make sure to respect isItemValid in the slot. if(stack.getCount() <= slot1.getSlotStackLimit()){ slot1.putStack(stack.copy()); slot1.onSlotChanged(); stack.setCount(0); flag = true; break; }else{ itemstack1 = stack.copy(); stack.shrink(slot1.getSlotStackLimit()); itemstack1.setCount(slot1.getSlotStackLimit()); slot1.putStack(itemstack1); slot1.onSlotChanged(); flag = true; } } if (reverseDirection){ --i; }else ++i; } } return flag; } private static boolean areItemStacksEqual(ItemStack stackA, ItemStack stackB) { return stackB.getItem() == stackA.getItem() && (!stackA.getHasSubtypes() || stackA.getMetadata() == stackB.getMetadata()) && ItemStack.areItemStackTagsEqual(stackA, stackB); } }
  4. So, I have my item that stores card Items. I have part of the inventory that should only be available/interactable depending on whether a different slot has an item in it. (the inventory uses should then be the item in the determining slot). Maybe this screenshot would make things more clear, the spaces I want to enable and disable are circled in black and the special slot is circled in pink. I'd also like to change the gui background with this state change, but that comes later. How would I best go about this? Would I have to modify the capability to communicate between container and gui?
  5. @Cadiboo Ok, so it's like an interface, but can do more?
  6. I'm really confused, I was having issues trying to add my own inventory into the gui, so I decided to focus on the adding the player inventory, I copied my working code from my other item and now it duplicates my hotbar for some reason? I haven't had this problem before. After playing around with things, I figured out it translated my hotbar upward, pushing things into inappropriate item slots (building blocks into armor slots for example) and if there isn't any room left just overwrites what was there. This is my container code: package com.mekelaina.duelcraft.container; import com.mekelaina.duelcraft.card.CardCollection; import com.mekelaina.duelcraft.gui.GuiBinder; import com.mekelaina.duelcraft.items.ItemCard; import com.mekelaina.duelcraft.items.ItemDeckbox; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; public class ContainerBinder extends CommonContainer { private int refX; private int refY; private InventoryPlayer playerInv; IItemHandler binderInv; //private GuiBinder GuiInstance; private static final int SLOT_WIDTH = 18; private static final int XSTART_DECKBOX = 140; private static final int YSTART_DECKBOX = 32; private static final int XSTART_BINDER = XSTART_DECKBOX + 112; private static final int YSTART_BINDER = YSTART_DECKBOX; private static final int XSTART_MID = XSTART_DECKBOX + 42; private static final int YSTART_MID = YSTART_DECKBOX + 13; private static final int numRows = 5; public ContainerBinder(InventoryPlayer playerInv, IItemHandler binderInv, int numSlots) { super(numSlots); this.playerInv = playerInv; this.binderInv = binderInv; int numColumns = numSlots / numRows; int xPosition; int yPosition; int index = 0; //int x = 0, y = 0; /*for(int x = 0; x < 10; x++) { for( int y = 0; y < 10; y++) { if(x < 5 && y < 5) { index = x + (y * 5); xPosition = XSTART_BINDER + ((x) * SLOT_WIDTH); yPosition = YSTART_BINDER + ((y) * SLOT_WIDTH); this.addSlotToContainer(new SlotItemHandler(binderInv, index, xPosition, yPosition) { @Override public boolean isItemValid(ItemStack stack) { if(stack.getItem() instanceof ItemCard && stack.hasTagCompound()) { NBTTagCompound nbt = stack.getTagCompound(); if(nbt.hasKey("Card_ID")) { String id = nbt.getString("Card_ID"); return !CardCollection.CARD_LIST.get(id).isExtraDeck(); } return true; } return false; } }); } else { } } } */ /*x++; y++;*/ /* xPosition = XSTART_MID + 50; yPosition = YSTART_MID + 10; index = x + (y * 5); index++; this.addSlotToContainer(new SlotItemHandler(binderInv, index, xPosition, yPosition) { @Override public boolean isItemValid(ItemStack stack) { if(stack.getItem() instanceof ItemDeckbox && stack.hasTagCompound()) { NBTTagCompound nbt = stack.getTagCompound(); if(nbt.hasKey("Card_ID")) { String id = nbt.getString("Card_ID"); return !CardCollection.CARD_LIST.get(id).isExtraDeck(); } return true; } return false; } });*/ // Player inventory for (int y = 0; y < 3; ++y) { for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, (x * 18) + XSTART_DECKBOX, YSTART_DECKBOX + y * 18)); // x + y * 9 + 9 // 0 + 0 * 9 + 9 = 9 // 1 + 0 * 9 + 9 = 10 // 2 + 0 * 9 + 9 = 11 // 3 + 0 * 9 + 9 = 12 // 4 + 0 * 9 + 9 = 13 // 5 + 0 * 9 + 9 = 14 // 6 + 0 * 9 + 9 = 15 // 7 + 0 * 9 + 9 = 16 // 8 + 0 * 9 + 9 = 17 // 0 + 1 * 9 + 9 = 18 // 1 + 1 * 9 + 9 = 19 // 2 + 1 * 9 + 9 = 20 // 3 + 1 * 9 + 9 = 21 // 4 + 1 * 9 + 9 = 22 // 5 + 1 * 9 + 9 = 23 // 6 + 1 * 9 + 9 = 24 // 7 + 1 * 9 + 9 = 25 // 8 + 1 * 9 + 9 = 26 // ... } } // Hot bar for (int z = 0; z < 9; ++z) { this.addSlotToContainer(new Slot(playerInv, z, (z * 18) + XSTART_DECKBOX, YSTART_DECKBOX + 100)); } } public void setRefValues(int x, int y) { refX = x; refY = y; } }
  7. @loordgek I'm aware of the forge page, that doesn't answer my question of how they work. Like its some kind of a d v a n c e d interface, but how its actually used I've no idea from the documentation. My problem is that I don't know how to use capabilities so I don't know what I need to do in my own capability to do what it is I want. Does anyone have a more beginner friendly explanation of what capabilities are and how they're used? Like forge provides a default item handling capability that can be used for storage, in theory, that should be all I need since I'm basically just trying to access three inventories at once. How can I get my gui and my container to talk to each other? one is server side and one is client side, but I need to update the server based on what the client does, right? If the player scrolls down in the inventory menu the container has to be updated to display the items accordingly. Can a capability extend another capability? can you implement more than one capability in an item? How does that work with attaching more than one capability to an item, block, or player? The documentation doesn't get me very far because I'm an idiot whose total modding experience can be summed up as about 5 minutes through a youtube tutorial (that's hyperbole, the point is I don't know what I'm doing nor what I'm looking for.)
  8. @V0idWa1k3r ok, so how do the capabilities work? Like I'm still really confused about what they are exactly.
  9. Ok, so my problem is that My item that stores items needs to be fairly complex. It has to be able to access 3 different inventories, Its own inventory, the player's inventory, and the inventory of an item in a specified slot (this item is a specific type). The size of these inventories are larger than the guis can fit, (i was planning to use a scroll bar kinda like the creative menus) and one set of inventory slots need to be "disabled" if there isn't an item in a specific slot. this will require some form of communication between the container and the gui and I'm really not sure how to go about this with an item. If it were a block, then you could use a tile entity to handle the communication. I know this sounds kinda vague but I'm just trying to figure out the best way to accomplish what I'm going for.
  10. @V0idWa1k3r ?‍♀️ I can't believe I didn't think of that... It works now, I'm just dumb XD. Thanks to both you and @diesieben07.
  11. @V0idWa1k3r ok... I realize that mistake, and it seems to have fixed the problem of not being able to type with whatever key is set as the inventory key, but the focusing part is still broken. If I manually (in code) set it focused it works fine, but it doesn't seem to be registering the mouse clicking even with canLoseFocus being set to true.
  12. @diesieben07 Alright, I adjusted my keyTyped method to this, but the problem of focusing still persists. @Override protected void keyTyped(char typedChar, int keyCode) throws IOException { if(searchBinder.textboxKeyTyped(typedChar, keyCode)) { super.keyTyped(typedChar, keyCode); } } When I open the GUI, the text field just won't focus unless I manually set it focused in code. The vanilla code for whether it should focus (if you click on it or not) isn't working, or (more likely) is being prevented from working somehow. With the updated code, if I manually set the focus, the escape key no longer closes the GUI. the inventory key still does.
  13. So, I'm working on GUI building for my mod and I have an issue with what will become my search bar. If I don't hard set it focused, it just won't work. Even when I set it to be able to lose and regain focus, it doesn't. Also when I do set it focused, hitting "e" closes the menu. How can I fix these two problems? Here is my GUI code (sorry it's a tad messy) The ModGuiElement is just a failed attempt at a wrapper class for all of the different ints related to a single texture (when it goes on the screen, where its located in the image file, etc). It was supposed to simplify things but it kinda just made it more clunky package com.mekelaina.duelcraft.gui; import java.io.IOException; import org.lwjgl.input.Keyboard; import com.mekelaina.duelcraft.container.ContainerBinder; import com.mekelaina.duelcraft.util.Reference; import com.mekelaina.duelcraft.util.handlers.ExpandableItemStackHandler; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.items.ItemStackHandler; public class GuiBinder extends GuiContainer { private static ResourceLocation BINDER_GUI_1 = new ResourceLocation(Reference.MOD_ID, "textures/gui/binder_gui1.png"); private static ResourceLocation BINDER_GUI_2 = new ResourceLocation(Reference.MOD_ID, "textures/gui/binder_gui2.png"); private static ResourceLocation BINDER_GUI_3 = new ResourceLocation(Reference.MOD_ID, "textures/gui/binder_gui3.png"); private static ModGuiElement MAIN_ON = new ModGuiElement(BINDER_GUI_1, 0, 0, 0, 0, 252, 198); private static ModGuiElement MAIN_OFF = new ModGuiElement(BINDER_GUI_2, 0, 0, 0, 0, 252, 198); private static ModGuiElement MAIN_FILTER = new ModGuiElement(BINDER_GUI_3, 0, 0, 0, 0, 252, 198); private static ModGuiElement BACK_40 = new ModGuiElement(BINDER_GUI_1, 148, 220, 18, 18); private static ModGuiElement BACK_60 = new ModGuiElement(BINDER_GUI_1, 166, 220, 18, 18); private static ModGuiElement BACK_EXTRA = new ModGuiElement(BINDER_GUI_1, 148, 238, 18, 18); private static ModGuiElement BACK_SIDE = new ModGuiElement(BINDER_GUI_1, 166, 238, 18, 18); private static ModGuiElement LOCKED_NORMAL = new ModGuiElement(BINDER_GUI_1, 216, 208, 16, 16); private static ModGuiElement LOCKED_HOVER = new ModGuiElement(BINDER_GUI_1, 200, 208, 16, 16); //private static ModGuiElement LOCKED_CLICK = new ModGuiElement(BINDER_GUI_1, 184, 208, 16, 16); //private static ModGuiElement UNLOCKED_CLICK = new ModGuiElement(BINDER_GUI_1, 184, 224, 16, 16); private static ModGuiElement UNLOCKED_HOVER = new ModGuiElement(BINDER_GUI_1, 200, 224, 16, 16); private static ModGuiElement UNLOCKED_NORMAL = new ModGuiElement(BINDER_GUI_1, 216, 224, 16, 16); //private static ModGuiElement FILTER_CLICK = new ModGuiElement(BINDER_GUI_1, 184, 240, 16, 16); private static ModGuiElement FILTER_HOVER = new ModGuiElement(BINDER_GUI_1, 200, 240, 16, 16); private static ModGuiElement FILTER_NORMAL = new ModGuiElement(BINDER_GUI_1, 216, 240, 16, 16); private static ModGuiElement SCROLL_NORMAL = new ModGuiElement(BINDER_GUI_1, 232, 241, 12, 15); private static ModGuiElement SCROLL_CLICK = new ModGuiElement(BINDER_GUI_1, 244, 241, 12, 15); private static GuiTextField searchBinder; private static final int FILTER_ID = 0; private static final int LOCK_ID = 1; private static final int BINDER_SEARCH = 2; private int refX; private int refY; private ItemStackHandler binderInv; private ItemStackHandler deckboxInv; private ItemStack binder; private InventoryPlayer player; //private ContainerBinder container; private boolean deckboxInserted; private boolean locked; private boolean inFilter; private int deckboxScrollstate; public GuiBinder(InventoryPlayer player, ItemStackHandler binderInv, ItemStack binder) { super(new ContainerBinder(player, binderInv, binderInv.getSlots())); this.player = player; this.binderInv = binderInv; this.binder = binder; this.deckboxInserted = false; this.locked = false; this.inFilter = false; } @Override public void initGui() { refX = (width - MAIN_ON.getWidth()) / 2; refY = (height - MAIN_ON.getHeight()) / 4; this.buttonList.add(new CustomButton(FILTER_ID, refX + 118, refY + 18, FILTER_NORMAL.getWidth(), FILTER_NORMAL.getHeight(), FILTER_NORMAL.getImage(), FILTER_NORMAL.getTextureX(), FILTER_NORMAL.getTextureY(), FILTER_NORMAL.getTextureX() - 16, FILTER_NORMAL.getTextureY())); searchBinder = new GuiTextField(BINDER_SEARCH, mc.fontRenderer, refX + 156, refY + 5, 70, mc.fontRenderer.FONT_HEIGHT); //searchBinder.setEnableBackgroundDrawing(false); searchBinder.setCanLoseFocus(true); searchBinder.setEnabled(true); Keyboard.enableRepeatEvents(true); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { } @Override public void updateScreen() { searchBinder.updateCursorCounter(); super.updateScreen(); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { GlStateManager.color(1, 1, 1, 1); if(inFilter) { mc.getTextureManager().bindTexture(MAIN_FILTER.getImage()); } else { if(deckboxInserted) { mc.getTextureManager().bindTexture(MAIN_ON.getImage()); } else { mc.getTextureManager().bindTexture(MAIN_OFF.getImage()); } } xSize = MAIN_OFF.getWidth(); ySize = MAIN_OFF.getHeight(); int x = refX; int y = refY; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); searchBinder.drawTextBox(); super.drawScreen(mouseX, mouseY, partialTicks); } @Override protected void keyTyped(char typedChar, int keyCode) throws IOException { searchBinder.textboxKeyTyped(typedChar, keyCode); super.keyTyped(typedChar, keyCode); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { /*final int refX = (width - MAIN_ON.getWidth()) / 2; final int refY = (height - MAIN_ON.getHeight()) / 4; mc.getTextureManager().bindTexture(FILTER_NORMAL.getImage()); xSize = FILTER_NORMAL.getWidth(); ySize = FILTER_NORMAL.getHeight(); int x = refX + FILTER_NORMAL.getX1(); int y = refY + FILTER_NORMAL.getY1();*/ //drawTexturedModalRect(FILTER_NORMAL.getX1(), FILTER_NORMAL.getY1(), x, y, FILTER_NORMAL.getWidth(), FILTER_NORMAL.getHeight()); } private void updateComponents() { } }
  14. Are there any tutorials for more advanced gui stuff? Like buttons, scrollbars, search boxes/text fields, drawing images over other images, "parsing" multiple areas of an image, etc.
  15. @diesieben07 yeah, its only for the item that can only hold items from my mod, so that shouldn't be a problem. I just have to figure out how to take the IItemHandler and apply it to a container with searchbar, and filter and scrollwheel.. fuuuun times
  16. So, Is there a way to have an item or tile entity with an inventory that will only be as big as it needs to be? Kind of like an ArrayList implementation? Essentially I have an item that holds different cards, and you should be able to put as many cards in it as you get. So, I have my CardData objects that represent each card you can get, so each "stack" should be the instance of the card item, the rarity, and the quantity of that type. So if you had one "card1" as a common, but two " card1" as rares, then they should be separate. I don't want to just make the inventory reeeealy big to compensate for not having a set size. Is this possible? Like I know you can create a modified version of an ItemStackHandler by extending the one forge provides, but I'm not really how to go about it if that makes sense.
  17. So, I can't figure out how to get it to where you can shift-click items into my custom container/inventory and the code I have just voids the item(s). My mergeItemStack and transferStackInSlot methods: @Override protected boolean mergeItemStack(ItemStack sourceStack, int startIndex, int endIndex, boolean useEndIndex) { boolean success = false; int index = startIndex; if(useEndIndex) { index = endIndex - 1; } Slot targetSlot; ItemStack targetStack; if(sourceStack.isStackable()) { while(sourceStack.getCount() > 0 && (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex)) { targetSlot = this.getSlot(index); targetStack = targetSlot.getStack(); if(!targetStack.isEmpty() && targetStack.getItem() == sourceStack.getItem()) { int combinedSize = targetStack.getCount() + sourceStack.getCount(); int maxTargetSize = Math.min(targetStack.getMaxStackSize(), targetSlot.getSlotStackLimit()); if(combinedSize <= maxTargetSize) { sourceStack.setCount(0); targetStack.setCount(combinedSize); targetSlot.onSlotChanged(); success = true; } else if(targetStack.getCount() < maxTargetSize) { sourceStack.shrink(maxTargetSize - targetStack.getCount()); targetStack.setCount(maxTargetSize); targetSlot.onSlotChanged(); success = true; } } if(useEndIndex) { --index; } else { ++index; } } } if(sourceStack.getCount() > 0) { if(useEndIndex) { index = endIndex - 1; } else { index = startIndex; } while(sourceStack.getCount() > 0 && (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex)) { targetSlot = this.inventorySlots.get(index); targetStack = targetSlot.getStack(); if(targetStack.isEmpty() && targetSlot.isItemValid(sourceStack)) { if(sourceStack.getCount() <= targetSlot.getItemStackLimit(sourceStack)) { targetSlot.putStack(sourceStack); targetSlot.onSlotChanged(); sourceStack.setCount(0); success = true; } else { ItemStack newStack = sourceStack.copy(); newStack.setCount(targetSlot.getItemStackLimit(sourceStack)); targetSlot.putStack(newStack); targetSlot.onSlotChanged(); sourceStack.shrink(targetSlot.getItemStackLimit(sourceStack)); success = true; } } if(useEndIndex) { --index; } else { ++index; } } } return success; } @Override public ItemStack transferStackInSlot(EntityPlayer playerIn, int fromSlotIndex) { ItemStack previous = ItemStack.EMPTY; Slot fromSlot = this.inventorySlots.get(fromSlotIndex); final int CONTAINER_START = 0, CONTAINER_END = this.numSlots-1, PLAYER_INV_START = CONTAINER_END+1, PLAYER_INV_END = PLAYER_INV_START + 26, HOT_BAR_START = PLAYER_INV_END+1, HOT_BAR_END = HOT_BAR_START+8; if(fromSlot != null && fromSlot.getHasStack()) { ItemStack current = fromSlot.getStack(); previous = current.copy(); if(fromSlotIndex <= CONTAINER_END) { if(!this.mergeItemStack(current, PLAYER_INV_START, HOT_BAR_END + 1, true)) { return null; } } else { if(!this.mergeItemStack(current, CONTAINER_START, CONTAINER_END + 1, false)) { return null; } } if(current.getCount() == 0) { fromSlot.putStack(ItemStack.EMPTY); } else { fromSlot.onSlotChanged(); } if(current.getCount() == previous.getCount()) { return ItemStack.EMPTY; } fromSlot.onTake(playerIn, current); } return previous; } }
  18. @Daeruin Thank you! I got it to work! Now, I just have to finish lining up my gui and container, lol.
  19. So, I noticed that there are two versions of the method GameRegistry.registerTileEntity. One takes the class and a String and the other takes the class and a ResourceLocaton, the former being depreciated. The forge documentation only mentions the latter, but I'm not sure how to convert my string to a ResourceLocation, and what resource would it be pointing to? Or does it not even matter and the ResourceLocation is used as a fancy wrapper for the string that for simpler things it doesn't make a difference but gives you the opportunity to do more with tile entities than you could previously?
  20. @Daeruin kinda? Like I get that, but is there a "tile entity" equivalent for items? or is that what the class that implements a capability would be. If my understanding is correct, all a tile entity is, is just a wrapped capabilities type thing that is used to attach a capability to blocks and handle them being placeable and such. so I create my own interface that extends ICapability for my needs (lets say a backpack for example) then create an object that uses that custom interface to "do things" like handles writing and reading nbt to the item its attached to (the backpack in this case) then register it with forge and "attach" it to my item class, right? is that the basic idea, or am I missing something? It's really weird, you'd think that someone would have a tutorial on how to do this by now. Not that I just want to copy someone else's work, but I learn better when I have someone (or an article) walk me through it first. Yeah It's similar to making a tile entity, but it's the different parts that confuse me; the new stuff is where I struggle because I'm not great at synthesizing solutions to problems I've never encountered. A lot of Minecraft modding is like that. It's not the easiest thing to do when you get to a point where the "basics" end. That's all most ever get to, unfortunately.
  21. @Daeruin I have. There isn't anything on creating items with inventories/data. I know its comparable to blocks, but I was hoping for *something* to show me the basic way to get something like that to work,
  22. @Cadiboo I get that, but actually creating the right capabilities and such
  23. So, I'm trying to create an item that can hold an inventory with a GUI. My problem is I can't really find a good guide on how to set it up. I know I need to use the capabilities implementation forge has, but that's about it. The forge documentation alone doesn't really give me much direction. Does anyone have a guide or a code example of creating a simple item with a GUI with an inventory?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.