Мод колдовство

Prerequisites

  • A reasonable knowledge of the basics of modding with Minecraft Forge: an understanding of simple Java, how to make blocks, items and such like, and familiarity with the registry and event handling systems. That said, I have made every effort to explain things as clearly as I can along the way.
  • A modding environment set up. I used eclipse for several years and recently switched to IntelliJ IDEA, but you can use any IDE — I won’t be referring to anything specific to either of those IDEs. Make sure you have the correct version of Minecraft Forge for the version of wizardry you intend to use. Usually this will be the latest version of Forge for the version of Minecraft you are using.
  • A mod set up ready to add spells to (main mod class and proxies, plus a lang file).

Attaching Wizardry’s source code

Whichever way you chose to set up your workspace, if you look inside the wizardry jar and open up any of the classes you’ll notice they’re completely unreadable. To get a readable version, you’ll need to attach the source code. The source code for all versions can be downloaded as a from GitHub as follows:

  1. Go to the releases page for wizardry’s GitHub repository (you can also access this from the main page by clicking releases on the right of the page)
  2. Find the release you’re developing for in the list
  3. Click the little icon below the release version number to download a zip file of the entire repository at that release

Once you’ve downloaded the source code, rename the file extension from to and move the file somewhere sensible (don’t put it in or Forge will think you have duplicate mods). Now use your IDE to attach the source jar to the compiled jar — again, if you don’t know how, you’ll need to look up how to do this for the IDE you’re using.

Setting up your workspace

There are two different ways to set up your workspace:

  • Using the wizardry jar file, stored locally (easier, but in some cases implementing won’t compile)
  • Using CurseForge’s Maven repository (more advanced, but more powerful)

Using a local jar file

Next, make a folder called inside your project folder (the one with build.gradle in) and put the wizardry jar in there. Now if you launch Minecraft in your development environment, wizardry should be fully working in-game.

Using Maven

Maven is a build tool that allows dependencies to be fetched automatically from a URL, rather than downloading the jar file manually. As part of hosting mods, CurseForge provides a Maven repository allowing both compiled and deobfuscated versions to be fetched using Maven.

Open up your file and add a block if you don’t already have it:

Inside the block (the top-level one, not the one inside ), add the following:

Now, inside the block, add the line:

replacing the numbers and with the Wizardry and Minecraft versions you are using (make sure you keep the before the Minecraft version). The part in the quotes is referred to as a Maven classifier.

Finally, run , restart your IDE if it’s open, and refresh the Gradle project (, or in IntelliJ IDEA you can click the refresh button in the Gradle tab). If it errors, check that you have typed all addresses and maven classifiers correctly, or try repeating the gradle commands (it can behave a bit weirdly sometimes!)

Specifying wizardry as a dependency

Next you’ll need to specify Wizardry as a dependency for your mod, which is done in your annotation using the following syntax:

This will do two things:

  1. It ensures Forge will always load your addon after wizardry. This is important for registries (and a few other things) to work correctly.
  2. If a user tries to run the game with your addon installed, but without wizardry, Forge will display a message telling them that wizardry must be installed.

It is also possible to define this information in your file instead, if is enabled in your `@Mod’ annotation.

Now you’re ready to start adding content to your addon mod! Check out the page on adding spells for a tutorial on how to add spells. Alternatively, take a look at the other tutorial pages on this wiki, or have a read of wizardry’s code — I endeavour to write useful Javadoc comments for all of the important classes and methods; you can learn a lot just by reading through the code itself.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector