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.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. FMLNetworkEvent.ClientConnectedToServerEvent is fired (on the Netty thread) when the client connects to a server. The FMLNetworkEvent.ClientConnectedToServerEvent#isLocal field will be true when the connection is local, i.e. the server is an integrated server and this client is the host. Minecraft#getCurrentServerData will return the current ServerData . ServerData#func_181041_d ( isOnLAN in recent mappings) will return true when the connection is to a LAN server (i.e. an integrated server hosted by a different client).
  2. It looks like you're never calling the ClientProxy#preInit method. Add a method with the same signature (name + arguments) to CommonProxy , add the @Override annotation to the ClientProxy method and then call this method from DaemonologyMod#preInit . The overload of RenderingRegistry.registerEntityRenderingHandler you're using is deprecated and will be removed at some point in the future. Use the overload with an IRenderFactory argument instead. To implement IRenderFactory , either use an anonymous class (if you're targeting Java 6/7) or a constructor method reference (if you're targeting Java . As the documentation of this method says, it should be called in the preInit phase. Edit: The smiley is really annoying when talking about Java 8 or Minecraft 1.8.
  3. You're passing the Integer 1 as the mod argument of EntityRegistry.registerModEntity . This compiles because every reference type extends Object and every primitive type can be boxed to a reference type. This fails at runtime because 1 isn't a String mod ID or an instance of a mod class, it's just an integer. When asking for help with a crash, always post the FML log or crash report. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page. It's much easier to read code with proper formatting and syntax highlighting.
  4. The sources JAR is exactly what the name suggests: the source code of the mod; though it's actually the reobfuscated source (SRG names) rather than the original deobfuscated source (MCP names). Source JARs are there to allow other projects that depend on yours to see your project's source code in the IDE. ForgeGradle allows you to add deobfCompile / deobfProvided dependencies (source code or compiled bytecode), these will be deobfuscated on disk from SRG names to the current project's MCP names. Source JARs definitely shouldn't be required outside of the development environment. Any mod that asks you to install a source JAR is doing something wrong.
  5. Chunk#getChunkCoordIntPair returns the chunk's coordinates as a ChunkCoordIntPair . This class implements Object#hashCode to return a hash based on the coordinates. You can also use the ChunkCoordIntPair#chunkXZ2Int method to combine the x and z coordinates of a chunk into a long suitable for hashing.
  6. The only unique identifier of a chunk is its x and z coordinates.
  7. You have a _JAVA_OPTIONS environment variable limiting the maximum memory to 512 MB. Delete this and give Gradle at least 2 GB of memory in gradle.properties. I'd recommend following the official documentation's Getting Started tutorial to set up your ForgeGradle workspace and IDE project.
  8. EntityPlayer#isUsingItem has been replaced by EntityLivingBase#isHandActive , yes. EntityPlayer#getItemInUse has been replaced by EntityLivingBase#getActiveItemStack . EntityLivingBase#getHeldItemMainhand only returns the item in the entity's main hand, regardless of which hand they're using (if any).
  9. When the if statement's conditional is true , you know that the entity argument (the entity updating the item) is an instance of EntityPlayer . This means that you can safely cast entity to EntityPlayer . As Draco said, never use the Minecraft class in common code. It's client-only and will crash the dedicated server (as you've seen). Always add the @Override annotation to override methods so you get a compilation error if the method doesn't actually override a super method. Your IDE can also auto-generate override methods with the correct signature and the annotation.
  10. Ah, I missed that. It looks like line 140 is where you instantiate EPick . Post this class. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page. It's much easier to read code with proper formatting and syntax highlighting.
  11. Mitems.initializeItem is referencing a client-only class on line 140. If you want more help, post the Mitems class.
  12. Did you read the big red text at the top of the main page of the forums or the EAQ? Always post your FML log, preferably using Gist.
  13. Create an array of Element s indexed by their atomic number and populate it when you register each Element .
  14. To save a class to NBT, you need to convert runtime types to collection (byte array, int array, list, compound) and primitive (byte, short, int, long, float, double, string) tags. The only part of a Compound you need to store is its structure. The LinkedHashMap can become a list tag, with a compound tag for each entry containing an int each for the Element (the atomic number) and the amount. To use capabilities for this, you'd need to create an ICompound interface with the required Compound methods and register it as a capability. Upon further consideration, I don't think capabilities will work for you here. Combining stacks in inventories ignores capabilities, so you could combine a stack of water and a stack of glucose together as if they were the same item. You'll have to stick to NBT in this case.
  15. Assuming that's in a JSON file, you need to escape the quotation marks for the --mods argument by placing a backslash in front of them: "minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userProperties ${user_properties} --userType ${user_type} --tweakClass net.minecraftforge.fml.common.launcher.FMLTweaker --mods \"modsDir1/mod1.jar,modsDir1/mod2.jar,modsDir2/mod3.jar\"" Does the Mojang launcher actually support passing arguments to Minecraft like this?
  16. Make sure you're using the latest version of Galacticraft and MicdoodleCore. In future, please post logs using Gist.
  17. The versions of Extra Cells 2 and Applied Energistics 2 you have installed are incompatible. Update AE2.
  18. --mods "modsDir1/mod1.jar,modsDir1/mod2.jar,modsDir2/mod3.jar"
  19. It looks like you have both a 1.8.9 and a 1.7.10 version of Warp Book installed. Remove the 1.8.9 version.
  20. Like I said, it's a comma-separated list of mod files to load. There's not much more to it than that.
  21. Yes, that would be a much better way to handle compounds. You could even have elements as a single Item with the atomic number as the metadata. You could probably even use Capabilities instead of NBT.
  22. ForgeGradle for 1.8.8+ requires at least 2 GB of memory to decompile Minecraft. I believe this is due to Mojang's obfuscation process leaving generics intact instead of stripping them. This tutorial explains how to give ForgeGradle more memory. Side note: Why are you using 1.8.8? It's been superseded by 1.8.9.
  23. You can use the --mods command line argument (a comma-separated list of mod files) or just create a separate game directory for each profile. I think the mod list file was mainly intended for modpack launchers (e.g. ATLauncher) to store their mods in a central location shared between all instances/profiles and still only load the mods for the launched pack.
  24. { "repositoryRoot": "jsonmods", "modRef": [ "dan200:ComputerCraft:1.78", "org.squiddev:CCTweaks:1.8.9-0.3.2" ] } This will load two mods: <gameDir>/jsonmods/dan200/ComputerCraft/1.78/ComputerCraft-1.78.jar and <gameDir>/jsonmods/org/squiddev/CCTweaks/1.8.9-0.3.2/CCTweaks-1.8.9-0.3.2.jar (where <gameDir> is the game directory specified in the client's launcher profile or the server's directory).
  25. That sounds like what I'm doing. Every element is being registered in the language file, and then when combining the names I loop over each element in the compound, use the StatCollector line on each element, and append it to the string, which is returned and set as the compound's unlocalized name. If I don't include that extra .name then the element name is not found to be translated and I get a horrible mess of a combination of unlocalized names making one big unlocalized name. Code's here: https://github.com/Roboguy99/Chemistry/tree/master/src/main/java/roboguy99/chemistry/item The translation keys in your lang file end in .name , so you need to include that when using StatCollector.translateToLocal . If they didn't end in .name , you wouldn't need to include it. Item#getUnlocalizedName returns the unlocalised name without the .name suffix so items with subtypes (e.g. dyes) can combine the base unlocalised name with the unlocalised name of the subtype before the .name suffix is added. You can't compare strings with == or != , since two different string objects may have the same value. Use Object#equals instead. I would suggest using StringBuilder rather than concatenation to build strings. The way you're currently building your localised names should mostly work, but you should override Item#getItemStackDisplayName to return this name instead of setting it as the unlocalised name. Your current implementation of getCommonName will only work for English. I would recommend having common names in your lang files, having a field or method for the unlocalised common name and translating it in getCompoundName . You should also check if the common name exists before building the full compound name to avoid unnecessary processing. I would recommend against using the empty string as a default return value, I'd suggest using null to indicate no value instead. What you have now won't re-translate the names when the user changes the game's locale. On the client side, you need to register an instance of registerReloadListener that rebuilds the localised name of every Compound when the client's resources are reloaded (e.g. when they change the locale). Use Minecraft#getResourceManager to get the resource manager, then cast it to IReloadableResourceManager and call registerReloadListener with your registerReloadListener instance.

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.