From a2f1615425dd7a7a93111e1c4c78532d935239e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=95=9C=ED=98=84=EB=B9=88?= <41675181+tmvkrpxl0@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:45:03 +0900 Subject: [PATCH] Delete outdated forgedev category (#7) --- docs/forgedev/index.md | 111 ---------------------------------- docs/forgedev/prguidelines.md | 97 ----------------------------- 2 files changed, 208 deletions(-) delete mode 100644 docs/forgedev/index.md delete mode 100644 docs/forgedev/prguidelines.md diff --git a/docs/forgedev/index.md b/docs/forgedev/index.md deleted file mode 100644 index 766171677..000000000 --- a/docs/forgedev/index.md +++ /dev/null @@ -1,111 +0,0 @@ -Getting Started -=============== - -If you have decided to contribute to Forge, you will have to take some special steps to get started with developing. A simple mod development environment will not suffice to work with Forge's codebase directly. Instead, you can use the following guide to help you with your setup and get you started with improving Forge! - -Forking and Cloning the Repository ----------------------------------- - -Like most major open source projects you will find, Forge is hosted on [GitHub][github]. If you have contributed to another project before, you will know this process already and can skip right ahead to the next section. - -For those who are beginners when it comes to collaboration via Git, here are two easy steps to get you started. - -:::note -This guide assumes that you already have a GitHub account set up. If you do not, visit their [registration page][register] to create an account. Furthermore, this guide is not a tutorial for git's usage. Please consult different sources first if you are struggling to get it working. -::: - -### Forking - -First of all, you have to "fork" the [MinecraftForge repository][forgerepo] by clicking the "Fork" button in the upper right hand corner. If you are in an organization, select the account you want your fork to be hosted on. - -Forking the repository is necessary since not every GitHub user can have free access to every repository. Instead, you create a copy of the original repository to later contribute your changes via a so called Pull Request, which you will learn more about later. - -### Cloning - -After forking the repository, it is time to get local access to actually make some changes. For this, you need to clone the repository onto your local machine. - -Using your favorite git client, simply clone your fork into a directory of your choice. As general example, here is a command line snippet that should work on all correctly configured systems and clones the repository into a directory called "MinecraftForge" under the current directory (note that you have to replace `` with your username): - -```git clone https://github.com//MinecraftForge``` - -# Checking out the Correct Branch - -Forking and cloning the repository are the only mandatory steps to develop for Forge. However, to ease the process of creating Pull Requests for you, it is best to work with branches. - -It is recommended to create and check out a branch for each PR you plan to submit. This way, you can always keep around the latest changes of Forge for new PRs while you still work on older patches. - -After completing this step, you are ready to go and set up your development environment. - -Setting Up the Environment --------------------------- - -Depending on your favorite IDE, there is a different set of recommended steps you have to follow to successfully set up a development environment. - -### Eclipse - -Due to the way Eclipse workspaces work, ForgeGradle can do most of the work involved to get you started with a Forge workspace. - -1. Open a terminal/command prompt and navigate to the directory of your cloned fork. -2. Type `./gradlew setup` and hit enter. Wait until ForgeGradle is done. -3. Type `./gradlew genEclipseRuns` and hit enter. Once again, wait until ForgeGradle is done. -4. Open your Eclipse workspace and go to `File -> Import -> General -> Existing Gradle Project`. -5. Browse to the repo directory for the "Project root directory" option in the dialog that opens. -6. Complete the import by clicking the "Finish" button. - -That is all it takes to get you up and running with Eclipse. There is no extra steps required to get the test mods running. Simply hit "Run" like in any other project and select the appropriate run configuration. - -### IntelliJ IDEA - -JetBrains' flagship IDE comes with great integrated support for [Gradle][gradle]: Forge's build system of choice. Due to some peculiarities of Minecraft mod development, however, there are additional steps required to get everything to work properly. - -#### IDEA 2021 onwards -1. Start IntelliJ IDEA 2021. - - If you already have another project open, close the project with the File -> Close project option. -2. In the projects tab of the "Welcome to IntelliJ IDEA" window, click the "Open" button on the top right and select the MinecraftForge folder you cloned earlier. -3. Click "Trust Project" if prompted. -4. After IDEA is done importing the project and indexing its files, run the Gradle setup task. You can do this by: - - Open the Gradle sidebar on the right hand side of your screen, then open the forge project tree, select Tasks, then other and double-click the `setup` task (may also appear as `MinecraftForge[Setup]`) found in Forge -> Tasks -> other -> `setup`. -5. Generate the run configurations: - - Open the Gradle sidebar on the right hand side of your screen, then open the forge project tree, select Tasks, then other and double-click the `genIntellijRuns` task (may also appear as `MinecraftForge[genIntellijRuns]`) found in Forge -> Tasks -> forgegradle runs -> `genIntellijRuns`. -- If you get a licensing error during build before making any changes, running the `updateLicenses` task may help. This task is found in Forge -> Tasks -> other as well. - -#### IDEA 2019-2020 -There are a few minor differences between IDEA 2021 and these versions for setup. - -1. Import Forge's `build.gradle` as an IDEA project. For this, simply click `Import Project` from the `Welcome to IntelliJ IDEA` splash screen, then select the `build.gradle` file. -1. After IDEA is done importing the project and indexing the files, run the Gradle setup task. Either: - 1. Open the Gradle sidebar on the right hand side of your screen, then open the `forge` project tree, select `Tasks`, then `other` and double-click the `setup` task (may also appear as `MinecraftForge[Setup]`. Or alternatively: - 1. Tap the CTRL key twice, and type `gradle setup` in the `Run` command window that pops up. - -You can then run Forge using the `forge_client` gradle task (`Tasks -> fg_runs -> forge_client`): right-click the task and select either `Run` or `Debug` as desired. - -You should now be able to work with your mod using the changes you introduce to the Forge and Vanilla codebase. - -Making Changes and Pull Requests --------------------------------- - -Once you have set up your development environment, it is time to make some changes to Forge's codebase. There are, however, some pitfalls you have to avoid when editing the project's code. - -The most important thing to note is that if you wish to edit Minecraft source code, you must only do so in the "Forge" sub-project. Any changes in the "Clean" project will mess with ForgeGradle and generating the patches. This can have disastrous consequences and might render your environment completely useless. If you wish to have a flawless experience, make sure you only edit code in the "Forge" project! - -### Generating Patches - -After you have made changes to the code base and tested them thoroughly, you may go ahead and generate patches. This is only necessary if you work on the Minecraft code base (i.e. in the "Forge" project), but this step is vital for your changes to work elsewhere. Forge works by injecting only changed things into Vanilla Minecraft and hence needs those changes available in an appropriate format. Thankfully, ForgeGradle is capable of generating the changeset for you to commit it. - -To initiate the patch generation, simply run the `genPatches` Gradle task from your IDE or the command line. After its completion, you can commit all your changes (make sure you do not add any unnecessary files) and submit your Pull Request! - -### Pull Requests - -The last step before your contribution is added to Forge is a Pull Request (PR in short). This is a formal request to incorporate your fork's changes into the live code base. Creating a PR is easy. Simply go to [this GitHub page][submitpr] and follow the proposed steps. It is now that a good setup with branches pays off, since you are able to select precisely the changes you want to submit. - -:::note -Pull Requests are bound to rules; not every request will blindly be accepted. Follow [this document][contribute] to get further information and to ensure the best quality of your PR! If you want to maximize the chances of your PR getting accepted, follow these [PR guidelines][guidelines]! -::: - -[github]: https://www.github.com -[register]: https://www.github.com/join -[forgerepo]: https://www.github.com/MinecraftForge/MinecraftForge -[gradle]: https://www.gradle.org -[submitpr]: https://github.com/MinecraftForge/MinecraftForge/compare -[contribute]: https://github.com/MinecraftForge/MinecraftForge/blob/1.13.x/CONTRIBUTING.md -[guidelines]: ./prguidelines.md diff --git a/docs/forgedev/prguidelines.md b/docs/forgedev/prguidelines.md deleted file mode 100644 index 223cc43e0..000000000 --- a/docs/forgedev/prguidelines.md +++ /dev/null @@ -1,97 +0,0 @@ -Pull Request Guidelines -======================= - -Mods are built on top of Forge, but there are some things that Forge does not support, and that limits what mods can do. -When modders run into something like that, they can make a change to Forge to support it, and submit that change as a Pull Request on Github. - -To make the best use of both your and the Forge team's time, it is recommended to follow some rough guidelines when preparing a Pull Request. The following points are the most important aspects to keep in mind when it comes to writing a good Pull Request. - -What Exactly is Forge? ----------------------- - -At a high level, Forge is a mod compatibility layer on top of Minecraft. -Early mods edited Minecraft's code directly (like coremods do now), but they ran into conflicts with each other when they edited the same things. They also ran into issues when one mod changed behavior in ways that the other mods could not anticipate (like coremods do now), causing mysterious issues and lots of headaches. - -By using something like Forge, mods can centralize common changes and avoid conflicts. -Forge also includes supporting structures for common mod features like Capabilities, Registries, and others that allow mods to work together better. - -When writing a good Forge Pull Request, you also have to know what Forge is at a lower level. -There are two main types of code in Forge: Minecraft patches, and Forge code. - -Patches -------- - -Patches are applied as direct changes to Minecraft's source code, and aim to be as minimal as possible. -Every time Minecraft code changes, all the Forge patches need to be looked over carefully and applied correctly to the new code. -This means that large patches that change lots of things are difficult to maintain, so Forge aims to avoid those and keep patches as small as possible. -In addition to making sure the code makes sense, reviews for patches will focus on minimizing the size. - -There are many strategies to make small patches, and reviews will often point out better methods to do things. -Forge patches often insert a single line that fires an event or a code hook, which affects the code after it if the event meets some condition. -This allows most of the code to exist outside of the patch, which keeps the patch small and simple. - -For more detailed information about creating patches, [see the GitHub wiki][patches]. - -Forge Code ----------- - -Aside from the patches, Forge code is just normal Java code. It can be event code, compatibility features, or anything else that is not directly editing Minecraft code. -When Minecraft updates, Forge code has to update just like everything else. However, it is much easier because it is not directly entangled in the Minecraft code. - -Because this code stands on its own, there is no size restriction like there is with the patches. - -In addition to making sure the code makes sense, reviews will focus on making the code clean: with proper formatting and Java documentation. - -Explain Yourself ----------------- - -All Pull Requests need to answer the question: why is this necessary? -Any code added to Forge needs to be maintained, and more code means more potential for bugs, so solid justification is needed for adding code. - -A common Pull Request issue is offering no explanation, or giving cryptic examples for how the Pull Request might theoretically be used. -This only delays the Pull Request process. -A clear explanation for the general case is good, but also give a concrete example of how your mod needs this Pull Request. - -Sometimes there is better way to do what you wanted, or a way to do it without a Pull Request at all. Code changes can not be accepted until those possibilities have been completely ruled out. - -Show that it Works ------------------- - -The code you submit to Forge should work perfectly, and it is up to you to convince the reviewers that it does. - -One of the best ways to do that is to add an example mod or JUnit test to Forge that makes use of your new code and shows it working. - -To set up and run a Forge Environment with the example mods, see [this guide][forgeenv]. - -Breaking Changes in Forge -------------------------- - -Forge cannot make changes that break the mods that depend on it. -This means that Pull Requests have to ensure that they do not break binary compatibility with previous Forge versions. -A change that breaks binary compatibility is called a Breaking Change. - -There are some exceptions to this: - -* Forge accepts Breaking Changes at the beginning of new Minecraft versions, where Minecraft itself already causes Breaking Changes for modders. -* Sometimes an emergency breaking change is required outside of that time window, but it is rare and can cause dependency headaches for everyone in the modded Minecraft community. - -Outside of those exceptional times, Pull Requests with breaking changes are not accepted. They must be adapted to support the old behavior or wait for the next Minecraft version. - -Be Patient, Civil, and Empathetic --------------------------------- - -When submitting Pull Requests, you will often have to survive code review and make several changes before it is the best Pull Request possible. -Keep in mind that code review is not judgement against you. Bugs in your code are not personal. Nobody is perfect, and that is why we are working together. - -Negativity will not help. Threatening to give up on your Pull Request and write a coremod instead will just make people upset and make the modded ecosystem worse. -It is important that while working together you assume the best intentions of the people who are reviewing your Pull Request and not take things personally. - -Review ------- - -If you do your best to understand the slow and perfectionistic nature of the Pull Request process, we will do our best to understand your point of view as well. - -After your Pull Request has been reviewed and cleaned up to the best of everyone's ability, it will be marked for a final review by Lex, who has the final say on what is included in the project or not. - -[patches]: https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge#conventions-for-coding-patches-for-a-minecraft-class-javapatch -[forgeenv]: ./index.md