Development: Difference between revisions

Content deleted Content added
Elisis (talk | contribs)
No edit summary
m →‎JVM flags: Fix classloading path
 
(181 intermediate revisions by 22 users not shown)
Line 1:
[[Category:Dev]]
== Introduction ==
 
Everyone can contribute to GTNH in one way or another. One possible way is to improve or expand the source code of the mods.
 
To get started, you first need a vision for what you want to do. <br>
If you don't have it yet, you can look through [https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues issues] and try to address some. <br>
If you ''do'' have a vision but want to hear more opinions on it, you can discuss it in a new Github issue or in Discord.
 
== Getting started ==
 
If you found a mod that you want to edit, then create a fork of it by pressing the Fork button on its GitHub page. <br>
After that, you can clone your fork to a local repository, import it to your IDE, and get started on development. <br>
If you are not sure how to do something, try to look up how things similar to it were done before.
 
==== Starting from an existing repository ====
 
# Clone the repository.
# Update the buildscript automatically through <code>./gradlew updateBuildScript</code> or if it doesn't work, manually with [https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/docs/migration.md this guide].
 
==== Starting from scratch ====
See the [https://github.com/GTNewHorizons/ExampleMod1.7.10#getting-started ExampleMod README.md] if the instructions below don't work.
 
# Unzip [https://github.com/GTNewHorizons/ExampleMod1.7.10/releases/download/master-packages/starter.zip project starter] into project directory
# Replace placeholders in LICENSE-template and rename it to LICENSE, or remove LICENSE-template and put any other license you like on your code. This is an permissive OSS project and we encourage you participate in OSS movement by having permissive license like one in template. You can find out pros and cons of OSS software in [https://www.freecodecamp.org/news/what-is-great-about-developing-open-source-and-what-is-not/ this article]
# Ensure your project is under VCS. For example initialize git repository by running <code>git init; git commit --message "initialized repository"</code>
# Replace placeholders (edit values in gradle.properties, change example package and class names, etc.)
# Run <code>./gradlew build</code>
# Make sure to check out the rest sections of this file
# You are good to go!
 
==== Next steps ====
# Run <code>./gradlew updateBuildScript</code> to update the Gradle build-script for the repository.
# Run <code>./gradlew build --build-cache</code> to build the project. The flag <code>--build-cache</code> makes builds faster. For more info, see [https://docs.gradle.org/current/userguide/build_cache.html documentation].
# If the build fails, check what was printed in console. Usually it fails because of outdated dependencies or Spotless. You can fix it with <code>./gradlew updateDependencies</code> or <code>./gradlew spotlessApply</code> respectively.
# In Eclipse / IntelliJ IDEA, import your workspace as an existing Gradle project. If the import fails, you may need to adjust the Gradle version and/or the buildscript. If you are developing for Minecraft 1.7.10, read [https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/docs/migration.md this guide].
# After you made changes, test them:
## Build the project with <code>./gradlew build</code>. You will find several jars in <code>build/libs</code>. What you need is the one without affixes like <code>-dev</code> or <code>-api</code>.
## Download the last [[Nightly builds|nightly build]] and import it in the launcher of your choice.
## Replace the target mod with your version or add if it's a new one.
## Launch the pack and check that things work as they should.
 
==== Common issues ====
* If your IDE tells you that stuff is missing even after you executed <code>gradlew build</code>, then try to reload Gradle.
* You need a 64-bit Java for development. Most mods work with any Java 8-19. However, some mods now use <code>enableModernJavaSyntax</code>in gradle.properties. In that case you need at least Java 11 to compile them. If you have multiple Java versions on your machine, then you may need to set the <code>JAVA_HOME</code> environment variable to the location of your desired Java installation and also configure it in your IDE.
 
==== Git Configuration ====
If you want to avoid signing commits with your real name, then please refer to the page [[Managing Git Identities]].
 
== Contribution Procedure ==
 
# Find something to contribute.
# Fork the needed repos.
# Test your changes thoroughly. If you change something, understand the changed class or method in order to understand what to test.
# Push code into your fork.
# Open a pull request against master branch and provide a description on what it changes/adds/removes. Include pictures/graphs if necessary. If there is a related issue, link it.
# Address review problems. Resolve merge conflicts. Wait for the final merge. During this period, your PR might be merged into dev branch manually by project admins, on a case by case basis. If that happens, your changes will go into one of the nightlies for border testings. There is no strict rules over whether this merge-into-dev will happen at all, and it's usually not needed anyway. It's however expected that the original author should fix every issues arouse during nightly testings, if any.
Please do not make multiple changes/features in a single PR, make a separate PR for each. If they depend on each other, you can leave a note in the PR's description.
 
'''''If you are not sure how to fork and open pull requests, read [https://gist.github.com/Chaser324/ce0505fbed06b947d962 this gist] by Chaser324.'''''
 
== GTNH-specific Contribution Guides ==
 
* You can find the Code of Conduct of the GTNH dev community [https://github.com/GTNewHorizons/GTNH-Dev-Doc/blob/master/developer's%20code%20of%20conduct.md here].
* See which GTNH mods are supported outside of the modpack and see an overview of licenses in [https://docs.google.com/spreadsheets/d/1LHd8c4FLLHiJqsuTppF2XFTE6bh-mXE7afVwGbzOKms/edit#gid=1469028684 this spreadsheet].
* For the GTNH Code Style guidelines please see the dedicated page [[Code Style]].
* For quest development, read the [https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/tree/master/config/betterquesting Quests Development Guide].
* The StructureLib documentation can be found [https://www.gtnewhorizons.com/StructureLib/?version=master here]. Use this for your multiblock structures.
* To understand how chemical formulas are balanced in recipes, read [[Chemical Balance]].
 
==Tools==
All applications that are grouped together can do about the same. This does not mean that you can pick any one of them, as they differ in functionality, style, performance and customizability. It is recommended you look at what they can do and try each one out, so you can decide which application you want to use for which use case.
WIP
{| {{STDT | mw-collapsible mw-collapsed}}
!Category
!Links
|-
|Code Editors
|
* [https://notepad-plus-plus.org/ Notepad++]
* [https://code.visualstudio.com/ Visual Studio Code]
* [https://www.sublimetext.com/ Sublime Text]
* [https://atom.io/ Atom]
|-
|Integrated Development Environments (IDEs)
|
* [https://www.eclipse.org/ Eclipse]
* [https://www.jetbrains.com/idea/ IntelliJ IDEA]
|-
|Image Editors
|
* [https://www.gimp.org/ GIMP]
* [https://www.getpaint.net/ Paint.NET]
* [https://krita.org/ Krita]
* [https://libresprite.github.io/ LibreSprite]
* [https://www.aseprite.org/ Aseprite] '''Paid'''
* [https://www.photoshop.com/ Photoshop] '''Paid'''
|-
|Modeling
|
* [https://blockbench.net/ Blockbench]
* [https://ephtracy.github.io/ MagicaVoxel]
* [https://www.blender.org/ Blender]
|-
|Animation
|
* [https://vberlier.github.io/animated-models/ Block Model Animator]
* [https://dokucraft.co.uk/stash/?animation-editor Animated Textures Editor]
* [https://libresprite.github.io/ LibreSprite]
|-
|Miscellaneous
|
* [https://jsonlint.com/ JSONLint]
* [https://lospec.com/palette-list Palette Library]
* [https://mcrpw.github.io/ Resource Pack Workbench]
* [https://github.com/GTNewHorizons/BON2 Bearded-Octo-Nemesis 2 (BON2)]
* [https://github.com/MinecraftForge/FernFlower FernFlower]
* [https://java-decompiler.github.io/ Java Decompiler]
* [https://github.com/glowredman/MCPMappingViewer MCP Mapping Viewer]
* [https://winmerge.org/ WinMerge]
|}
 
=== Helpful IDEA Plugins ===
==Setting up a Development Environment==
Additionally, if you choose JetBrains IntelliJ IDEA as your IDE, there are some plugins that can be very helpful in some ways
WIP
 
* Minecraft Development: Autocompletion for mixin development, builtin [[NBT]] editor, minecraft project project type in new project window, and a bunch more small utility. Notice that for GTNH specifically you will want [https://github.com/eigenraven/MinecraftDev the fork maintained by eigenraven]. We use RFG as the build tool and that one unfortunately is not compatible with the original version available on the plugin marketplace. Follow the install instructions in README of that fork.
https://discord.com/channels/181078474394566657/603348502637969419/791085350751567882
* ASM Bytecode Viewer: Very helpful plugin for asm development. Can also be occasionally helpful for mixin development. Notice that there are multiple plugins with similiar name and near identical purpose, with one of them being a bundled one from JetBrains. The JetBrains one is slightly wonky and doesn't display ASMified code. The plugin suggested here works perfectly and can display ASMified code. If in doubt whether you got the correct plugin, here is a direct link: https://plugins.jetbrains.com/plugin/10302-asm-bytecode-viewer To use this plugin, focus on any opened Java editor tab (either it's decompiled library class without attached source, library class with attached source, or your own source files), then click ASM Bytecode Viewer in Code menu. The action is also available via Search Everything under the same name. For your own source files, it will trigger a project build to ensure .class files are up to date.
 
=== Debugging with Eclipse ===
''Set up launch config:''
 
# Select the project you want to debug
# Click the drop-down menu next to the debug symbol -> Debug configurations...
# Select "Remote Java Application"
# Click "New launch configuration" (top left)
# Change the port to 5005
# Click "Apply"
 
''Actually debug:''
 
# Launch the game with <code>--debug-jvm</code> (I do this from the terminal)
# Wait until it says "Listening for transport dt_socket at address: 5005"
# Debug with the launch config you created (you may have to go into the debug configurations menu again, if it doesnt show up in the drop-down yet)
# Change to the "Debug" view (button in the top-right corner). There may be a window popping up asking if you want to go there
# Done!
 
==Maven/Jenkins Selection==
{| {{STDT | mw-collapsible mw-collapsed}}
{| class="wikitable"
|+
!URL
!Mods
|-
|https://aidancbrady.com/mekanism/download/
|http://files.minecraftforge.net/maven
|Mekanism, MekanismGenerators, MekanismTools
|Biomes O' Plenty, HelpFixer, MalisisCore, MalisisDoors, Mixin, IronChest, ...
|-
|https://api.modrinth.com/maven
|[http://chickenbones.net/maven/codechicken/CodeChickenCore/ http://chickenbones.net/maven/]
|All Modrinth mods
|-
|https://chickenbones.net/maven/
|CodeChickenCore, CodeChickenLib, EnderStorage, NotEnoughItems, Translocator, WR-CBE, ...
|-
|httphttps://mavenci.ic2rs485.player.tonetwork/
|
|IndustrialCraft, Forestry, ...
|-
|http://mavendownloads.tterraggtnewhorizons.com/Mods_for_Jenkins/
|''Various''
|EnderIO, EnderZoo, Chisel, ...
|-
|httphttps://dvs1.progwml6.com/files/maven
|IguanaTinkerTweaks, HungerOverhaul, Mantle, Natura, TinkersConstruct, TinkersMechworks, ...
|-
|httphttps://wwwfiles.ryanliptakprojectredwiki.com/maven/
|MrTJPCore, ForgeRelocation, ProjectRed
|AppleCore
|-
|https://files.vexatos.com
|http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/
|Are We Endgame Yet?, AsieLib, BeeSpecific, BuildcraftOilTweak, CheatyComputers, Computronics, Conventional, CustomManualTab, Don't Stub Your Toe, FactumOpus, ForecatsersBackpacks, TGregworks, ...
|YAMCore
|-
|https://gregtech.overminddl1.com/
|http://jenkins.usrv.eu:8081/nexus/content/repositories/thirdparty/
|''Various''
|Baubles, TicTooltips
|-
|https://immibis.com/
|http://downloads.gtnewhorizons.com/Mods_for_Jenkins/
|Advanced Machines, Advanced Repulsion Systems, AutoFood, Cloud Storage, Connected Glass, Dimensional Anchors, Immibis Core, Immibis's Macroblocks, Immibis's Microblocks, Immibis's Peripherals, InfiView, InfiniTubes, Liquid XP, RedLogic, Simple Recycling, TinyCarts, TubeStuff, ...
|-
|https://jenkins.bdew.net/maven
|AE2Stuff, BDLib, CoFHLib, Compacter, Computercraft, Generators, Gendustry, Mekanism, Pressure, ...
|-
|https://jenkins.dries007.net/
|AutoCrafter2000, BetterFoliage, CrayCrafting, D3Backend, D3Log, GooglyEyes, GreenThumb, HoloInventory, InsiderTrading, MCLink, MineSafety, MorphAdditions, Pay2Spawn, Pay2SpawnBlocks, PlaceableTools, TapeMouse, TerraFirmaCraft, TerraFirmaStuff, TFCraft-NEIplugin, TFC-Tweaks, Thermal Expansion, TorchTools, WeepingAngels, ...
|-
|https://jenkins.ironhide.de/
|CraftingUtilities, Open Modular Turrets, FloodLights, ...
|-
|http://jenkins.usrv.eu:8080/
|''Various''
|-
|https://gregtechnexus.overminddl1gtnewhorizons.com/repository/public/
|''Various''
|-
|https://jitpack.io/
|http://files.projectredwiki.com/maven
|Any GitHub project
|MrTJPCore, ForgeRelocation, ProjectRed
|-
|httphttps://maven.cilblamejared.licom/
|MineTweaker3, CraftTweaker, ...
|OpenComputers, ...
|-
|https://maven.cil.li/
|http://mobiusstrip.eu/maven
|AppliedEnergistics 2, BetterStorage, BloodMagic, BluePower, BuildCraft, Charset, CodeChickenCore, CodeChickenLib, CoFHCore, CoFHLib, ColoredLightsCore, ComputerCraft, CraftGuide, EnderCore, EnderIO, EnderStorage, Forestry, Forge Multipart, GalacticraftCore, GregTech, Immibis Multipart, InGameWiki, Inventory Tweaks, Mantle, Mekanism, MineFactory Reloaded, MrTJPCore, NotEnoughItems, NotEnoughKeys, OpenComputers, PowerAdvantage, QmunityLib, ProjectRed, Railcraft, RedLogic, RedstoneFlux API, RotaryCraft, RotateableBlocks, ThaumicEnergistics, TinkersConstruct, TinkersMechworks, TIS-3D, Waila, WR-CBE, ...
|JABBA, WAILA, ...
|-
|https://maven.covers1624.net/
|http://www.mod-buildcraft.com/releases/BuildCraft/
https://nexus.covers1624.net/repository/maven-hosted/
|Buildcraft
|ChickenChunks, CodeChickenCore, CodeChickenLib, EnderStorage, ForgeMultipart, NotEnoughItems, Translocators, WR-CBE
|-
|https://filesmaven.vexatosfalsepattern.com/releases
|LightningOverhaul, AnimFix, CrashGuard, DyamicRendering, EndlessIDs, FalsePatternLib, JarLoader, LagGoggles, SSMLegacy, Triangulator, ...
|AsieLib, BuildcraftOilTweak, TGregworks, ...
|-
|https://jenkinsmaven.bdewic2.netplayer.to/maven&#x22;
|AE2StuffIndustrialCraft, BDLib, GendustryForestry, ...
|-
|https://wwwmaven.cursemavenk-4u.comnl/
|Boilerplate, InGameWiki, K4Lib, MoarCarts, PneumaticCraft, ServerInfoProvider, Steamcraft2, ...
|-
|https://maven.latmod.com/
|
|-
|https://maven.mcmoddev.com
Backup: https://maven.tophatcat.dev/
|Baubles, LLibrary, Thaumcraft, VeinMiner, ...
|-
|https://maven.minecraftforge.net/
Backup: https://repo.spongepowered.org/repository/forge-proxy/
|Biomes O' Plenty, HelpFixer, MalisisCore, MalisisDoors, Mixin, IronChest, ...
|-
|https://maven.modmuss50.me/
|
|-
|https://maven.mjrlegends.com/
|ExtraPlanets, ...
|-
|https://ci.tterrag.com/
https://maven.tterrag.com
|Chisel, CTMLib, CustomThings, DifficultyRecipes, EnderIO, EnderCore, EnderZoo, Ex-Astris, Ex-Nihilo, RecipeTweakingCore, SuperMassiveTech, ttCore, ...
|-
|http://mc.lunatri.us/files/
|Config Patcher, DynIMC, Extension Fixer, InGame Info XML, InGame Mod Configs, Laser, Level, LunatriusCore, Monster Spawner Highlighter, Profiles, Schematica, SchematicaPlugin, Stackie, Tracer
|-
|https://minecraft.curseforge.com/api/maven/
|Any CurseForge file
|-
|http://minetweaker3.powerofbytes.com/download/
|MineTweaker3
|-
|https://mobiusstrip.eu/maven
|AdminCommandsToolbox, JABBA, MobiusCore, Netty-Opis, Opis, WAILA, ...
|-
|https://modmaven.dev/
|AccountSync, AddictedToRed, AI Improvements, Announcement Mod, Armory, Armory Gem Items, AssemblyLine, Atomic Science, Bagable Plants, Basic Industry, boilerplate, BoneTorch, cardboardboxes, ChickenChunks, CodeChickenCore, CodeChickenLib, Colored Chests, Colored Pots, Come Closer, Controlling, Corruption, Ender Storage, Forge Multipart, GasCan, GrapplingHook, HelmBucket, ICBM, ICBM Classic, ICBM Classic Sentry, IguanaTinkerTweaks, IguanaTweaks, Magic Mirror, MC Profiler, MFFS, MilitaryBaseDecour, MinecraftJUnit, moarcarts, NotEnoughItems, NVFix, ProgressWorldCleanup, RedCow, Sentry AA, SkyIslandGenerator, steamcraft2, Translocator, VE Fluid Handling, Voltz Engine, Voltz Engine Essentials, Wooden Bucket, Wooden Rails, Wooden Shears, WR-CBE, ...
|-
|https://mvn.falsepattern.com/releases
|GasStation, LightingOverhaul, MixinExtras, AnimFix, CartLoad, CrashGuard, DynamicRendering, EndlessIDs, FalsePatternLib, FalseTweaks, JarLoader, LagGogglesLegacy, SSMLegacy, Triangulator, GalactiCraft-Core, GalactiCraft-Planets, MicdoodleCore, Biome Wand, Space Core, CoroUtil, EnhancedBiomes, Tropicraft, ...
|-
|https://purpleposeidon.github.io/fz_archive/
|Factorization
|-
|https://repo.spongepowered.org/maven/
|Mixin, ...
|-
|httphttps://mavenwww.k-4ucursemaven.nl/com
|InGameWiki, ...
|-
|https://minecraft.curseforge.com/api/maven/
|Any CurseForge file
|-
|https://www.mod-buildcraft.com/releases/BuildCraft/
|Buildcraft, BuildCraft Compat
|-
|https://www.ryanliptak.com/maven/
|AppleCore
|}
 
== Code Style Resources==
Not every wiki/tutorial/article/... listed here contains information about Minecraft version 1.7.10 but some topics haven't changed much and often the general methodology is the same. The newer the version, the less comparable the inner workings of Minecraft/Forge are to 1.7.10.
 
Use Ctrl+F if you look for something specific.
* Keep your added variables either private or constant unless absolutely necessary
* Don't touch existing public variables' implementation, as this can break code using those variables.
* Use thread-safe collections where you can, to make future multithreading possible
* '''Comment your code''', especially Javadoc-ing your methods and classes, if able
* Try not to make one method do too much. Add helper methods if you need
* Use the @Override annotation when overriding methods.
 
==Wikis==
Not every wiki listed here contains information about Minecraft version 1.7.10 but some topics haven't changed much and often the general methodology is the same. The newer the version, the less comparable the inner workings of Minecraft/Forge are to 1.7.10.
 
You can look at the source-code of most mods included in GTNH [https://github.com/GTNewHorizons here].
 
=== Link Collections ===
'''[https://github.com/MinecraftModDevelopment/Modding-Resources/blob/master/index.md This] list will be sufficient for most basic use cases.'''
{| {{STDT | mw-collapsible mw-expanded}}
{| class="wikitable"
!Name
|+
!Version(s)
!URL
|-
!Versions
|[https://github.com/MinecraftModDevelopment/Modding-Resources/blob/master/index.md MMD Resource Index]
|Various
|-
|[https://archive.ph/YGQKG Minecraft Modding Overview (WIP) Resources for Mr. Turner‎ (Archive)]
|1.6, 1.7
|-
|[https://github.com/LegacyModdingMC/awesome-minecraft-1.7.10 Awesome Minecraft 1.7.10]
|1.7.10
|}
 
=== Tutorials / Blogs ===
{| {{STDT | mw-collapsible mw-collapsed}}
!Name
!Version(s)
!Topics (including, but often not limited to)
|-
|[https://github.com/MinecraftModDevelopment/Modding-Resources MMD Modding-Resources]
|https://minecraft.gamepedia.com/Minecraft_Wiki
|Various
|Blocks, Commands, Entities, Fluids, Items, Rendering, ...
|-
|[http://jabelarminecraft.blogspot.com/ Jabelar's Minecraft Forge Modding Tutorials]
|Various
|Getting Started, Concepts, Registries, Entities, Blocks, Items, Armor, Weapons, Tools, Fluids, Tanks, Recipes, Ore Dictionary, Loot, Tile Entities, Networking, Events, Models, Animations, Rendering, Assets, Enchantments, GUIs, Keybindings & Mouse, Achievements / Advancements, Configs, World Generation, Creative Tabs, Particles, Sounds, Commands, IMC / Compat, ...
|-
|#knowledgebase ([https://discord.com/invite/R7FThXBUMR Minecraft Pack Development Discord])
|Various
|Various bits of information on Mod(pack) Development
|-
|#resources ([http://discord.blockbench.net/ Blockbench Discord])
|All
|Modeling, Textures, Animation
|Everything related to vanilla Minecraft, though there is information about mods aswell
|-
|[https://github.com/2xsaiko/mixin-cheatsheet 2xsaiko's Mixin Cheatsheet]
|https://wiki.vg/Main_Page
|All?
|Cheatsheet for mixins
|Protocols, Authentification, NBT, etc.
|-
|[https://gist.github.com/TelepathicGrunt/3784f8a8b317bac11039474012de5fb4 TelepathicGrunt' How to Mixin]
|https://forums.minecraftforge.net/
|All
|Mixins
|Everything related to Forge modding. ''This is a forum, not a wiki but you may still find information in old threads. Be aware that 1.7.10 is not supported anymore, so you'll likely receive no answer if you ask something related to 1.7.10 there.''
|-
|[https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials Mapping and Modding Tutorials on Minecraft Forum]
|https://www.khronos.org/opengl/wiki/Main_Page
|All?
|*
|Various Topics
|OpenGL
|-
|[https://web.archive.org/web/20160302191408/http://www.minecraftforge.net/wiki/Category:Tutorials Old Forge Wiki Tutorials] (Archive)
|https://mcforge.readthedocs.io/en/latest/
|1.3 - 1.7
(https://mcforge.readthedocs.io/en/latest/legacy/ for legacy versions)
|Gettings Started, Concepts, Blocks, Items, Recipes, Events, Ore Generation, Tile Entities, Commands, Rendering, Configs, Models, Biome Dictionary, Ore Dictionary, Achievements, Sounds, GUIs, Networking, NBT, Containers, Entities, Multiblocks, Fluids, Scala, ...
|1.12+
|Getting started, Concepts, Blocks, Items, TileEntities, Rendering, Events, Networking, ..
|-
|[https://web.archive.org/web/20181007042911/http://www.wuppy29.com/minecraft/modding-tutorials/forge-modding/ Wuppy's Tutorials] (Archive)
|https://greyminecraftcoder.blogspot.com/
|1.63 - 1.7, 1.14+8
|Gettings Started, Recipes, Loot, Assets, Blocks, Items, Tools, Rendering, World Generation, Crops, Entities, Dimensions, ...
|Concepts, Blocks, Items, Rendering, User Input, Packets, Entities, GUIs, Containers, Tools, Restone, ...
|-
|[https://web.archive.org/web/20180114234905/http://courses.vswe.se/videos.php Vswe's Summer Courses] (Archive)
|https://0fps.net/
|1.6.2
|*
|Java Basics, Getting Started, Items, Blocks, Tile Entities, Entities, World Gen, Sounds, Particles, Models, Textures, Animations
|Collision Detection, Geometry, Mathematics, Voxels, Shape Modelling, Ambient Occlusion, ...
|-
|The Grey Ghost's Minecraft By Example [[https://greyminecraftcoder.blogspot.com/ Blog]<nowiki>|</nowiki>[https://github.com/TheGreyGhost/MinecraftByExample GitHub]]
|https://www.redblobgames.com/
|1.6 - 1.16
|*
|Concepts, Blocks, Items, Rendering, User Input, Packets, Entities, GUIs, Containers, Tools, Redstone, ...
|Path Finding, Graph Theory, Map Generation, Procedural Generation
|-
|[https://wwwemxtutorials.wikipediawordpress.orgcom/ EMX Tutorials]
|*1.7
|Getting Started, Items, Blocks, Recipes, Keybindings, Textures, Drops, GUIs, NBT, Models, Containers, ...
|More than you can think of (but not everything)
|-
|[https://github.com/coolAlias/Forge_Tutorials coolAlias' Forge Tutorials]
|#knowledgebase ([https://discord.com/invite/R7FThXBUMR Minecraft Pack Developement Discord])
|All1.7
|Armor, Villager Trades, Inventories, Events, Rendering, ...
|Various bits of information on Mod(pack) Developement
|-
|Using the Simple Network Implementation (SimpleNetworkWrapper) [[https://archive.ph/KCJtl#selection-525.0-525.62 Tutorial] (Archive)<nowiki>|</nowiki>[https://gist.github.com/CatDany/4a3df7fcb3c8270cf70b Example]]
|#resources ([http://discord.blockbench.net/ Blockbench Discord])
|All1.7
|Networking
|Modeling, Textures, Animation
|-
|Vike's ASM Tutorial [[https://www.youtube.com/watch?v=FgaxnpD-DC4 Part 1]<nowiki>|</nowiki>[https://www.youtube.com/watch?v=75_rJYLj5AU Part 2]]
|https://docs.google.com/spreadsheets/d/1dxmloJUSox8xdMtHZCZAqeLQgG9Yb6sLYyviOyNcwck/
|1.7-1.12
|ASM
|Concepts and Tips & Tricks for Modpack developement
|-
|[https://web.archive.org/web/20200614093742/https://bedrockminer.jimdofree.com/modding-tutorials/ Bedrock Miner's Tutorials] (Archive)
|https://docs.oracle.com/javase/tutorial/
|1.7, 1.8
|*
|Getting started, Concepts, Blocks, Items, Tools, Armor, Food, Recipes, ...
|Java Documentation
|-
|[https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials/2282788-1-7-1-8-thexfactor117s-forge-modding-tutorials-20 TheXFactor117's Forge Modding Tutorials]
|https://github.com/Ladysnake/Satin/wiki/Data-driven-shaders
|1.7+, 1.8
|Getting Started, Items, Blocks, Armor, Tools, Ore Generation, NBT, Tile Entities, Assets, Creative Tabs, Recipes, Entities, ...
|Post Process Shaders
|-
|[https://darkhax.net/tag/mc-mod-tutorial Darkhax' Tutorials]
|https://github.com/MinecraftModDevelopment/Modding-Resources
|1.8 - 1.12
|All
|Custom Entity Data, Loot Tables, Events, Structure Generation, Update Checker, IMC, Jar Signing, Access Transformers, Rendering, CraftTweaker Support, Mixin
|Blocks, Commands, Entities, Fluids, Items, Rendering, ...
|-
|[https://wiki.mcjty.eu/modding/index.php?title=Main_Page McJty's Tutorials]
|https://ftbwiki.org/Feed_The_Beast_Wiki
|1.9+
|All
|Getting Started, Concepts, Configs, Blocks, Items, Tile Entities, Recipes, GUIs, Inventories, Entities, Rendering, Networking, Commands, Dimensions, WAILA Integration, ...
|Information on many Mods
|-
|[https://shadowfacts.net/tutorials/ ShadowFacts' Tutorials]
|https://ftb.gamepedia.com/FTB_Wiki
|1.10 - 1.12
|All
|Getting Started, Concepts, Items, Models, Blocks, Blockstates, Assets, Crops, Creative Tabs, Recipes, Ore Dictionary, Food, Tools, Armor, World Generation, Tile Entities, Inventories, GUIs, Rendering, ...
|Information on many Mods
|-
|[https://suppergerrie2.com/category/forge-tutorial/ suppergerrie2's Tutorials]
|https://ae-mod.info/
|1.7+12 - 1.15
|Getting Started, Items, Blocks, Recipes, Ore Generation, Food, Creative Tabs, Tools, Slabs, Enchantments, Crops, Block States, Events, ...
|Applied Energistics
|-
|[https://commoble.github.io/helpful-things-for-forge-modding/ Cubic Interpolation - Helpful Things for Making Mods with Forge for Minecraft 1.15]
|https://wiki.industrial-craft.net/index.php?title=Main_Page
|Beta 1.3+15
|Events, Registries, Tile Entities, Dimensions, Loot, Data Generators, Configs, NBT, ...
|Industrial Craft
|-
|http[https://minetweaker3forge.powerofbytesgemwire.comuk/wiki/Main_Page Forge Community Wiki]
|LTS, Latest
https://docs.blamejared.com/
|Getting Started, Concepts, Blocks, Items, Tile Entities, Events, Resources, Data, Models, Networking, Potions, Particles, Sound, Events, Loot, Key Bindings, Access Transformers, ...
|1.6.4, 1.7
1.12, 1.14+
|MineTweaker / CraftTweaker
|-
|[https://docs.oracle.com/javase/tutorial/ Java Docs Tutorials]
|https://docs.google.com/spreadsheets/d/1Rsz0rH9tIVJxr18b1Z6-QxOSaEKssxF7u2naQTq2Mqg/
|''Not Minecraft specific''
|1.7.10
|Java
|GTNH Spreadsheet
|-
|[https://git-scmwww.redblobgames.com/docs Red Blob Games]
|''Not Minecraft specific''
|*
|Path Finding, Graph Theory, Map Generation, Procedural Generation
|-
|[https://0fps.net/ 0 FPS]
|''Not Minecraft specific''
|Collision Detection, Geometry, Mathematics, Voxels, Shape Modeling, Ambient Occlusion, ...
|-
|[https://jornvernee.github.io/methodhandles/2024/01/19/methodhandle-primer.html Java introduction to MethodHandles - a faster reflection API replacement]
|''Not Minecraft specific''
|Java, Reflection
|}
 
=== Wikis / Docs ===
{| {{STDT | mw-collapsible mw-collapsed}}
!Name
!Topics
|-
|[https://docs.blamejared.com/ CraftTweaker Docs]
|CraftTweaker
|-
|[https://docs.gradle.org/current/userguide/userguide.html Gradle User Manual]
|Gradle
|-
|[https://eventlistforge.com/ Minecraft Forge Event List]
|Vanilla and Forge Events (MC 1.12+)
|-
|[https://fabricmc.net/wiki/tutorial:mixin_introduction Fabric Wiki - Introduction to Mixins]
|Mixins
|-
|FTB Wiki [https://ftbwiki.org/Feed_The_Beast_Wiki Unofficial]
|Information on many Mods
|-
|[https://git-scm.com/docs Git Docs]
|Git
|-
|[https://github.com/Ladysnake/Satin/wiki/Data-driven-shaders Data Driven Shaders by Ladysnake]
|https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/
|MC 1.7+ Post Process Shaders
|1.7.10
|-
|Forge 10.13.4.1614 JavaDocs
|[https://github.com/LlamaLad7/MixinExtras/wiki Mixin Extras Wiki]
|Mixin Extras
|-
|[https://github.com/SpongePowered/Mixin/wiki Mixin Wiki]
|Mixins
|-
|Official Forge Docs [[https://mcforge.readthedocs.io/en/latest/ Latest]<nowiki>|</nowiki>[https://mcforge.readthedocs.io/en/latest/legacy/ Legacy]]
|Forge
|-
|[https://legacymoddingmc.github.io/wiki/ Legacy Modding Wiki]
|Wiki for Modding on older Minecraft Versions (WIP)
|-
|[https://web.archive.org/web/20220713052708/http://minetweaker3.powerofbytes.com/wiki/Main_Page 3 Wiki (Archive)]
|MineTweaker 3
|-
|[https://github.juanmuscaria.com/DocsMC/ DocsMC] (1.7.10), [https://makamys.github.io/MCJavadoc/ MCJavaDocs] (1.7.10), [https://skmedix.github.io/ForgeJavaDocs/ ForgeJavaDocs] (1.7.10 - 1.12.2), [https://nekoyue.github.io/ForgeJavaDocs-NG/ ForgeJavaDocs-NG] (1.12.2)
|Javadocs for Minecraft, FML and Minecraft Forge
|-
|[https://visualvm.github.io/documentation.html VisualVM Docs]
|VisualVM
|-
|[https://wiki.vg/Main_Page wiki.vg]
|Protocols, Authentification, NBT, etc.
|-
|[https://www.wikipedia.org/ Wikipedia]
|More than you can think of (but not everything)
|}
 
<nowiki>*</nowiki> This wiki does not (mainly) cover specifics of Minecraft/Forge but some concepts described here apply in Minecraft aswell.
=== Raven's list of rendering resources ===
 
OpenGL resources:
* [https://learnopengl.com/] - a good C++ tutorial for opengl
* [https://lazyfoo.net/tutorials/OpenGL/index.php] - another step-by-step opengl c++ tutorial
* [https://ahbejarano.gitbook.io/lwjglgamedev/] - lwjgl3 tutorial book about 3d gamedev with code samples
* [https://open.gl/] - a short, but useful tutorial into modern opengl's rendering pipeline
* [https://www.songho.ca/opengl/] - a lot of useful diagrams and linear algebra for 3d rendering with opengl
* [https://github.com/LWJGL/lwjgl3-demos/] - a lot of example LWJGL3 programs showing off implementations of various rendering techniques, it's a small gold mine
Reference docs:
* [https://docs.gl/] - nice site to search&view khronos's official docs
* [https://www.khronos.org/files/opengl45-quick-reference-card.pdf] - a cheat sheet you can print out with the full opengl API
 
More advanced stuff:
* [https://raytracing.github.io/] - Raytracing in a Weekend series, teaches you a lot about computer graphics (beware, raytracing != rasterization which is what opengl uses, but most of the math still applies)
* [https://realtimecollisiondetection.net/blog/?p=86] - a blogpost on 1 efficient method of batching drawcalls for performance
* [https://asawicki.info/news?x=titles] a great blog from an AMD gpu driver developer, lots of valuable info here
Search for GDC, AMD, NVIDIA and AMD talks on youtube about rendering topics too
Super advanced stuff:
* [https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/] - a series of blogposts going really deep into how GPUs work
* [https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/gcn3-instruction-set-architecture.pdf] - the full instruction set architecture doc for AMD GCN3 GPUs, useful to understand what kind of machine code GPUs actually execute
 
Random non-rendering stuff:
https://gameprogrammingpatterns.com/contents.html - a book (available for free online) about common patterns in game code
 
==Help==
Line 202 ⟶ 497:
*<nowiki>#help-modded-java (</nowiki>[http://discord.blockbench.net/ Blockbench Discord])
 
== Maven Local Repository ==
==Debugging==
Sometimes you want to make cross-mod changes. In order to make use of code changed locally from another mod, use maven local.
WIP
 
* Run <code>publishToMavenLocal</code> for your dependency mod. Setting environment variable <code>VERSION</code> allows you to publish it with specified tag, like 99.99.99
https://discord.com/channels/181078474394566657/603348502637969419/805122033167237175
* Add <code>mavenLocal()</code> to your <code>repositories.gradle</code> in your dependent mod, and change <code>dependencies.gradle</code> to your desired version.
 
[[File:IDEA mavenLocal configuration.PNG|thumb|Environment variable can be set on IDEA GUI]]
==Miscellaneous==
Note that this doesn't work on GitHub, so in order to pass CI, you need to publish pre tag online. If you're not in the GTNH team, ask others to publish it.
 
===How to...=Hotswap ==
Hotswap allows you to reflect code changes without relaunching the game. Use <code>1b. Run Client (Java 17, Hotswap)</code> or <code>2b. Run Server (Java 17, Hotswap)</code> to launch the game, and use <code>Run > Debugging Actions > Reload Changed Classes</code> to hotswap.
 
==Dependency types==
====...get...====
The following table shows if a source dependency - later called the Source - you included in Your Mod is visible to Your Mod and the mods that depend on Your Mod. For instance, <code>implementation</code> makes the Source visible to Your Mod at compile and runtime, but only at runtime to the Dependent mods, meaning that the Dependent mods are not able to use a class from Your Mod if it implements an interface from the Source. There are also ''test'' versions of some, you probably just want ''testImplementation.''
{| class="wikitable"
| rowspan="2" |
! colspan="2" |Your mod
! colspan="2" |Dependent mod
|-
!compile
!runtime
!compile
!runtime
|-
!api
| style="color:green;" |Yes
| style="color:green;" |Yes
| style="color:green;" |Yes
| style="color:green;" | Yes
|-
!implementation
| style="color:green;" |Yes
| style="color:green;" |Yes
| style="color:red;" |No
| style="color:green;" |Yes
|-
!compileOnly
| style="color:green;" |Yes
| style="color:red;" | No
| style="color:red;" |No
| style="color:red;" |No
|-
!compileOnlyApi
| style="color:green;" |Yes
| style="color:red;" |No
| style="color:green;" |Yes
| style="color:red;" |No
|-
!runtimeOnlyNonPublishable
| style="color:red;" |No
| style="color:green;" |Yes
| style="color:red;" | No
| style="color:red;" |No
|-
!devOnlyNonPublishable
| style="color:green;" |Yes
| style="color:green;" |Yes
| style="color:red;" |No
| style="color:red;" | No
|-
!runtimeOnly
| style="color:red;" |No
| style="color:green;" |Yes
| style="color:red;" |No
| style="color:green;" | Yes
|-
!compile
| colspan="4" |Deprecated. Use ''api'' or ''implementation''
|}
You can also read document on [https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/dependencies.gradle ExampleMod repository] for details.
 
=====...an Item===JVM flags ==
These are some useful JVM flags for development purposes. A full, detailed list can be found in the table below.
<syntaxhighlight lang="java">
import cpw.mods.fml.common.registry.GameRegistry;
GameRegistry.findItem(String modId, String name);
</syntaxhighlight>Vanilla Items are located in <code>net.minecraft.init.Items</code>.
 
* <code>-Dmixin.debug=true</code> Enable Mixin Debug
=====...a Block=====
* <code>-Dmixin.debug.verbose=true</code> Verbose Debug Messages
<syntaxhighlight lang="java">
* <code>-Dmixin.debug.export=true</code> Export classes after mixins have been applied. If you include fernflower in your classpath, or copy org.jetbrains.fernflower into your mixin jar the exported classes will be decompiled
import cpw.mods.fml.common.registry.GameRegistry;
* <code>-Dmixin.debug.countInjections=true</code> Throw an error if the injection count doesn't match expectations
GameRegistry.findBlock(String modId, String name);
* <code>-Dlegacy.debugClassLoading=true</code> Class Load Debugging
</syntaxhighlight>Vanilla Blocks are located in <code>net.minecraft.init.Blocks</code>.
* <code>-Dlegacy.debugClassLoading=true -Dlegacy.debugClassLoadingFiner=true -Dlegacy.debugClassLoadingSave=true</code> Dump classes to <code>./RFB_CLASS_DUMP</code>
* <code>-Dfml.debugAccessTransformer=true</code> Enable debug logging of access transformers
{| {{STDT | mw-collapsible mw-collapsed}}
!Flag
!Default
!Result
!Code Reference
|-
| -Dfml.badPacketCounter
|100
|Sets the number of leaked packets before a warning is logged.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java#L32 FMLProxyPacket]
|-
| -Dfml.coreMods.load
|
|Allows setting a comma separated list of coremod classes to load before "normal" coremods are discovered.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/CoreModManager.java#L204 CoreModManager]
|-
| -Dfml.debugAccessTransformer
|false
|true: Logs detailed debug information when applying Access Transformers.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java#L62 AccessTransformer]
|-
| -Dfml.debugAPITransformer
|false
|true: Logs detailed debug information when processing <code>@Optional</code> annotations.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/transformers/ModAPITransformer.java#L28 ModAPITransformer]
|-
| -Dfml.debugExit
|false
|true: Logs the stacktrace before exiting the java application.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/FMLCommonHandler.java#L618 FMLCommonHandler]
|-
| -Dfml.debugClassPatchManager
|false
|true: Logs detailed debug information when appling runtime patches.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/patcher/ClassPatchManager.java#L41 ClassPatchManager]
|-
| -Dfml.debugRegistryEntries
|false
|true: Logs detailed debug information about the block and item registries.
|FMLControlledNamespacedRegistry
|-
| -Dfml.doNotBackup
|false
|true: Prevents the creation of a backup when loading an old or damaged save.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java#L69 GuiOldSaveLoadConfirm]
|-
| -Dfml.dumpPatchedClasses
|false
|true: Writes classes to a temp directory after runtime patching. The file locations are logged.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/patcher/ClassPatchManager.java#L40 ClassPatchManager]
|-
| -Dfml.dumpRegistry
|false
|true: Dumps the item registry to <code>./itemStackRegistry.csv</code> after the mods have finished loading.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/registry/GameData.java#L161 GameData]
|-
| -Dfml.ignoreInvalidMinecraftCertificates
|false
|true: Continues loading the game even if an invalid Minecraft certificate was detected.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/FMLSanityChecker.java#L152 FMLSanityChecker]
|-
| -Dfml.ignorePatchDiscrepancies
|false
|true: Continues loading the game even if discrepancies have been detected while applying runtime patches.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/patcher/ClassPatchManager.java#L101 ClassPatchManager]
|-
| -Dfml.LogContext
|false
|true: Adds a mod's name to the Log4J thread context (key: <code>mod</code>) before invoking the mod's event handler. The name is removed from the context afterwards.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java#L24 ASMEventHandler]
|-
| -Dfml.loginTimeout
|600
|Sets the time (in ticks) before a login attempt times out.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java#L54 FMLNetworkHandler]
|-
| -Dfml.modStates
|
|Allows setting mod states by providing a (semi-)colon separated list of <code>=</code>-separated key/value-pairs. The value is a boolean representing the "enabled" state when "true". Example:
<code>-Dfml.modStates=IC2=true;Railcraft=false</code>
This can also be done via a <code>fmlModState.properties</code> file, located in the config directory.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/Loader.java#L541 Loader]
|-
| -Dfml.noGrab
|false
|true: Prevents the mouse cursor from being grabbed when focussing the game.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/patches/minecraft/net/minecraft/util/MouseHelper.java.patch#L7 MouseHelper]
|-
| -Dfml.queryResult
|
|Uses <code>confirm</code>/<code>cancel</code> to answer any queries during the load process.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/StartupQuery.java#L97 StartupQuery]
|-
| -Dfml.readTimeout
|30
|Sets the time (in seconds) before a read times out.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java#L53 FMLNetworkHandler]
|-
| -Dfml.remappingDebug
|false
|Condition for <code>-Dfml.remappingDebug.dumpFieldMaps</code> and <code>-Dfml.remappingDebug.dumpMethodMaps</code>.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java#L64 FMLDeobfuscatingRemapper]
|-
| -Dfml.remappingDebug.dumpFieldMaps
|false
|true: Logs all field mappings of a class when that class is loaded.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java#L65 FMLDeobfuscatingRemapper]
|-
| -Dfml.remappingDebug.dumpMethodMaps
|false
|true: Logs all method mappings of a class when that class is loaded.
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java#L66 FMLDeobfuscatingRemapper]
|-
| -Dfml.skipFirstTextureLoad
|true
|true: Skips the first loading of textures.
|TextureMap
|-
| -Dfmlbuild.build.number
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L59 FMLInjectionData]
|-
| -Dfmlbuild.deobfuscation.hash
|deadbeef
|''Unused''
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L62 FMLInjectionData]
|-
| -Dfmlbuild.major.number
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L56 FMLInjectionData]
|-
| -Dfmlbuild.mcpversion
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L61 FMLInjectionData]
|-
| -Dfmlbuild.mcversion
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L60 FMLInjectionData]
|-
| -Dfmlbuild.minor.number
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L57 FMLInjectionData]
|-
| -Dfmlbuild.revision.number
|missing
|
|[https://github.com/MinecraftForge/FML/blob/1.7.10/src/main/java/cpw/mods/fml/relauncher/FMLInjectionData.java#L58 FMLInjectionData]
|-
| -Dforge.debugBlockEvent
|false
|true: Logs when (Multi)PlaceEvents are fired.
|[https://github.com/MinecraftForge/MinecraftForge/blob/1.7.10/src/main/java/net/minecraftforge/event/world/BlockEvent.java#L20 BlockEvent]
|-
| -Dforge.debugBlockSnapshot
|false
|true: Logs creations/restorations of block snapshots.
|[https://github.com/MinecraftForge/MinecraftForge/blob/1.7.10/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java#L24 BlockSnapshot]
|-
| -Dforge.forceDisplayStencil
|false
|true: Initializes the LWJGL Display with 8 stencil bits.
false: Initializes the LWJGL Display with 0 stencil bits.
|[https://github.com/MinecraftForge/MinecraftForge/blob/1.7.10/src/main/java/net/minecraftforge/client/ForgeHooksClient.java#L322 ForgeHooksClient]
|-
| -Dlegacy.debugClassLoading
|false
|Condition for the following three flags. true: Logs additional debug information when loading/transforming classes.
|[https://github.com/GTNewHorizons/LegacyLauncher/blob/master/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java#L46 LaunchClassLoader]
|-
| -Dlegacy.debugClassLoadingFiner
|false
|true: Logs additional debug information while class transformers run.
|[https://github.com/GTNewHorizons/LegacyLauncher/blob/master/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java#L47-L48 LaunchClassLoader]
|-
| -Dlegacy.debugClassLoadingSave
|false
|true: Saves a copy of every class before and after each class transformer runs to the <code>./CLASSLOADER_TEMP</code> directory.
|[https://github.com/GTNewHorizons/LegacyLauncher/blob/master/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java#L49-L50 LaunchClassLoader]
|-
| -Dlegacy.debugClassLoadingSlim
|false
|true: Disables <code>-Dlegacy.debugClassLoadingSave</code>.
|[https://github.com/GTNewHorizons/LegacyLauncher/blob/master/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java#L51-L52 LaunchClassLoader]
|-
| -Dmixin.checks
|false
|true: Enables all checks.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L304 MixinEnvironment$Option]
|-
| -Dmixin.checks.interfaces
|false
|true: Checks that all declared interface methods are implemented on a class after mixin application. Requires <code>-Dmixin.checks=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L310 MixinEnvironment$Option]
|-
| -Dmixin.checks.interfaces.strict
|true
|If interface check is enabled, "strict mode" applies the implementation check even to abstract target classes. Setting this option to <code>false</code> causes abstract targets to be skipped when generating the implementation report.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L318 MixinEnvironment$Option]
|-
| -Dmixin.debug
|false
|true: Enables all mixin debugging options.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L207 MixinEnvironment$Option]
|-
| -Dmixin.debug.countInjections
|false
|true: Elevates failed injections to an error condition, see <code>[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/injection/Inject.java#L260 Inject#expect]</code> for details. Requires <code>-Dmixin.debug=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L270 MixinEnvironment$Option]
|-
| -Dmixin.debug.export
|false
|true: Enables post-mixin class export. This causes all classes to be written to the <code>./.mixin.out</code> directory within the runtime directory after mixins are applied, for debugging purposes. Requires <code>-Dmixin.debug=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L214 MixinEnvironment$Option]
|-
| -Dmixin.debug.export.decompile
|true
|true: Allows fernflower to be disabled even if it is found on the classpath. Requires <code>-Dmixin.debug.export=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L234 MixinEnvironment$Option]
|-
| -Dmixin.debug.export.decompile.async
|true
|true: Runs fernflower in a separate thread. In general this will allow export to impact startup time much less (decompiling normally adds about 20% to load times) with the trade-off that crashes may lead to undecompiled exports. Requires <code>-Dmixin.debug.export.decompile=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L242 MixinEnvironment$Option]
|-
| -Dmixin.debug.export.decompile.mergeGenericSignatures
|true
|By default, if the runtime export decompiler is active, mixin generic signatures are merged into target classes. However this can cause problems with some runtime subsystems which attempt to reify generics using the signature data. Set this option to <code>false</code> to disable generic signature merging. Requires <code>-Dmixin.debug.export.decompile=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L251 MixinEnvironment$Option]
|-
| -Dmixin.debug.export.filter
|
|Export filter, if omitted allows all transformed classes to be exported. If specified, acts as a filter for class names to exportand only matching classes will be exported. This is useful when using Fernflower as exporting can be otherwise very slow. The followingwildcards are allowed:
 
* <code>*</code> Matches one or more characters except dot (.)
=====...a Fluid=====
* <code>**</code> Matches any number of characters
<syntaxhighlight lang="java">
* <code>?</code> Matches exactly one character
import net.minecraftforge.fluids.FluidRegistry;
FluidRegistry.getFluid(String fluidName);
</syntaxhighlight>Vanilla Fluids are located in <code>net.minecraftforge.fluids.FluidRegistry</code>.
 
Requires <code>-Dmixin.debug.export=true</code>.
=====...an ItemStack=====
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L229 MixinEnvironment$Option]
<syntaxhighlight lang="java">
|-
import cpw.mods.fml.common.registry.GameRegistry;
| -Dmixin.debug.profiler
GameRegistry.findItemStack(String modId, String name, int stackSize);
|true
</syntaxhighlight>If you want to change the meta-data, do<syntaxhighlight lang="java">
|true: Enable the performance profiler for all mixin operations (normally it is only enabled during mixin prepare operations).
import cpw.mods.fml.common.registry.GameRegistry;
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L293 MixinEnvironment$Option]
import net.minecraft.init.Items;
|-
import net.minecraft.item.ItemStack;
| -Dmixin.debug.strict
ItemStack stack = GameRegistry.findItemStack(String modId, String name, int stackSize);
|false
Items.apple.setDamage(stack, int damage); // Items.apple can be any instance of net.minecraft.item.Item
|true: Enables strict checks. Requires <code>-Dmixin.debug=true</code>.
</syntaxhighlight>
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L275 MixinEnvironment$Option]
|-
| -Dmixin.debug.strict.targets
|false
|true: Enables strict checking for mixin targets. Requires <code>-Dmixin.debug.strict=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L287 MixinEnvironment$Option]
|-
| -Dmixin.debug.strict.unique
|false
|If false, <code>[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/Unique.java Unique]</code> public methods merely raise a warning when encountered and are not merged into the target. If true, an exception is thrown instead. Requires <code>-Dmixin.debug.strict=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L282 MixinEnvironment$Option]
|-
| -Dmixin.debug.verbose
|false
|true: Enables verbose mixin logging (elevates all DEBUG level messages to INFO level). Requires <code>-Dmixin.debug.export=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L264 MixinEnvironment$Option]
|-
| -Dmixin.debug.verify
|false
|true: Runs the CheckClassAdapter on all classes after mixins are applied, also enables stricter checks on mixins for use at dev-time, promotes some warning-level messages to exceptions. Requires <code>-Dmixin.debug.export=true</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L258 MixinEnvironment$Option]
|-
| -Dmixin.dumpTargetOnFailure
|false
|true: Dumps the bytecode for the target class to disk when mixin application fails.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L299 MixinEnvironment$Option]
|-
| -Dmixin.env.allowPermissiveMatch
|true
|When <code>mixin.env.remapRefMap</code> is enabled and a refmap is available for a mixin config, certain injection points are allowed to fail over to a "permissive" match which ignores the member descriptor in the refmap. To disable this behaviour, set this property to <code>false</code>.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L379 MixinEnvironment$Option]
|-
| -Dmixin.env.compatLevel
|
|Default compatibility level to operate at.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L389 MixinEnvironment$Option]
|-
| -Dmixin.env.disableRefMap
|false
|true: Disables refmap when required.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L343 MixinEnvironment$Option]
|-
| -Dmixin.env.ignoreRequired
|false
|true: Globally ignores the "required" attribute of all configurations.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L384 MixinEnvironment$Option]
|-
| -Dmixin.env.refMapRemappingEnv
|searge
|When using <code>mixin.env.refMapRemappingFile</code>, this setting overrides the default source environment. However note that the specified environment type must exist in the orignal refmap.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L370 MixinEnvironment$Option]
|-
| -Dmixin.env.refMapRemappingFile
|
|If <code>mixin.env.remapRefMap</code> is enabled, this setting can be used to override the name of the SRG file to read mappings from. The mappings must have a source type of <code>searge</code> and a target type matching the current development environment. If the source type is not <code>searge</code> then the <code>mixin.env.refMapRemappingEnv</code> should be set to the correct source environment type.
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L363 MixinEnvironment$Option]
|-
| -Dmixin.env.remapRefMap
|false
|true: Rather than disabling the refMap, you may wish to remap existing refMaps at runtime. This can be achieved by setting this property and supplying values for <code>mixin.env.refMapRemappingFile</code> and <code>mixin.env.refMapRemappingEnv</code>. Though those properties can be ignored if starting via <code>GradleStart</code> (this property is also automatically enabled if loading via GradleStart).
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L353 MixinEnvironment$Option]
|-
| -Dmixin.env.shiftByViolation
|warn
|Behaviour when the maximum defined <code>[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/injection/At.java#L147 At#by]</code> value is exceeded in a mixin. Currently the behaviour is to <code>warn</code>. In later versions of Mixin this may be promoted to <code>error</code>.
Available values for this option are:
 
* <code>ignore</code> Pre-0.7 behaviour, no action is taken when a violation is encountered.
=====...a FluidStack=====
* <code>warn</code> Current behaviour, a <code>WARN</code>-level message is raised for violations.
<syntaxhighlight lang="java">
* <code>error</code> Violations throw an exception.
import net.minecraftforge.fluids.FluidRegistry;
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L409 MixinEnvironment$Option]
FluidRegistry.getFluidStack(String fluidName, int amount);
|-
</syntaxhighlight>
| -Dmixin.hotSwap
 
|false
==== ...add... ====
|true: Enables the hot-swap agent.
 
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L328 MixinEnvironment$Option]
===== ...a Shaped Recipe =====
|-
<syntaxhighlight lang="java">
| -Dmixin.ignoreConstraints
import cpw.mods.fml.common.registry.GameRegistry;
|false
import net.minecraft.item.ItemStack;
|true: Ignores all constraints on mixin annotations, outputs warnings instead.
GameRegistry.addShapedRecipe(ItemStack output, Object... params);
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L323 MixinEnvironment$Option]
</syntaxhighlight>
|-
 
| -Dmixin.initialiserInjectionMode
===== ...a Shapeless Recipe =====
|default
<syntaxhighlight lang="java">
|Behaviour for initialiser injections, current supported options are "default" and "safe".
import cpw.mods.fml.common.registry.GameRegistry;
|[https://github.com/LegacyModdingMC/UniMix/blob/main/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java#L415 MixinEnvironment$Option]
import net.minecraft.item.ItemStack;
|}
GameRegistry.addShapelessRecipe(ItemStack output, Object... params);
</syntaxhighlight>
 
==Remote debugging==
===== ...a Shaped OreDict Recipe =====
<syntaxhighlight lang="java">
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
GameRegistry.addRecipe(new ShapedOreRecipe(ItemStack result, Object... recipe));
</syntaxhighlight>
 
*<code>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005</code> to wait for a debugger to be attached to the game before running code, put this in launcher args to debug the full pack
===== ...a Shapeless OreDict Recipe =====
*In IntelliJ, use Run->Attach to process to attach the debugger to the running instance.
<syntaxhighlight lang="java">
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapelessOreRecipe;
GameRegistry.addRecipe(new ShapelessOreRecipe(ItemStack result, Object... recipe));
</syntaxhighlight>
 
{{Template:Navbar GTNH}}
===== ...a Smelting Recipe =====
[[Category:Dev]]
<syntaxhighlight lang="java">
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
GameRegistry.addSmelting(ItemStack input, ItemStack output, float xp);
</syntaxhighlight>