Skip to content

Commit dc1ed1d

Browse files
authored
Update README.md
1 parent 3d94a87 commit dc1ed1d

File tree

1 file changed

+43
-32
lines changed

1 file changed

+43
-32
lines changed

Diff for: README.md

+43-32
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
1-
Rusherhack Example Plugin
1+
# RusherHack Example Plugin
22

3-
This is an example plugin that shows how to use Rusherhack's plugin API.
3+
An example implementation of a RusherHack plugin.
44

5-
## Building:
5+
RusherHack plugins are custom add-ons written by developers to add new features to RusherHack.
66

7-
### Option 1: Intelij IDEA
8-
1. Download [intelij idea community edition](https://www.jetbrains.com/idea/download). Make sure to scroll down to community edition - pro costs money
9-
2. Install idea using whatever method you downloaded and run it
10-
3. It should look like this. Click "clone repository" and type in `https://github.com/john200410/example-plugin`
7+
## Setting up the Development Environment
118

12-
![image](https://github.com/user-attachments/assets/8fc7803a-423d-4d54-8022-98b0543e4817)
9+
### Installing Java Development Kit (JDK)
1310

14-
4. Once it is done cloning (downloading) click on "trust project" and it should up the ide window
11+
For Minecraft versions 1.20.1-1.20.4, you will need to have JDK 17 installed. You can download it [here](https://www.azul.com/downloads/?version=java-17-lts&package=jdk#zulu).
1512

16-
![image](https://github.com/user-attachments/assets/8fc7803a-423d-4d54-8022-98b0543e4817)
13+
For Minecraft versions 1.20.5 and newer, you will need to have JDK 21 installed. You can download it [here](https://www.azul.com/downloads/?version=java-21-lts&package=jdk#zulu).
1714

18-
5. Click on the little elephant in the corner (Gradle)
15+
### Installing IntelliJ IDEA
1916

20-
![image](https://github.com/user-attachments/assets/7f65b23e-42ce-4a36-b185-e235860c5220)
17+
IntelliJ IDEA is the preferred Java IDE for rusherhack plugin development.
2118

22-
6. Click on the button that a box with a play button and then type "build" in the text box that pops up
19+
IntelliJ IDEA can be downloaded from [the official website](https://www.jetbrains.com/idea/download).
2320

24-
![image](https://github.com/user-attachments/assets/f53ada2a-0e4f-4617-af26-5c2d4b680858)
21+
The Community edition is recommended because it is free and open-source.
2522

26-
7. Press enter. A window should pop up in the bottom with a bunch of text info.
23+
## Clone the repository
2724

28-
![image](https://github.com/user-attachments/assets/e1679529-06ee-40f4-94fd-044ad09276f1)
25+
In IntelliJ, when creating a new project there is an option to clone a repository:
2926

30-
8. Once this is done (it should finish successfully, if it is unsuccessful, please ask in #plugins-dev) your compiled jar should be in the build/libs folder of the project folder.
27+
<img src="https://rusherhack.org/i/zsa4nyb3v3m5ifk8gkyoywak.png" alt="cloning" width="600"/>
3128

32-
9. You can open up the project folder using file explorer, and use that jar as you would with any other plugin (see [Rusherhack Plugins](https://github.com/RusherDevelopment/rusherhack-plugins/blob/main/README.md))
29+
In the URL, write the text `https://github.com/RusherDevelopment/example-plugin.git` and press `Clone`
3330

34-
35-
### Option 2: Linux command line
31+
<img src="https://rusherhack.org/i/2rdwc40q98ihb93lt1yykyw8.png" alt="cloning2" width="600"/>
3632

37-
1. This method only works on Linux, WSL, and probably git bash. NOT POWERSHELL
38-
2. Open up terminal and run these commands in order
39-
```
40-
git clone https://github.com/john200410/example-plugin
41-
cd example-plugin
42-
chmod +x gradlew
43-
./gradlew build
44-
```
45-
3. If something goes wrong in any of these steps, you may not have java installed. Install something around the lines of `jdk21-openjdk` from your package manager. If more goes wrong, please ask in #plugins-dev
46-
4. Your compiled jar file should be in the build/libs subdirectory of the project folder.
47-
5. You can use that jar as you would with any other plugin (see [Rusherhack Plugins](https://github.com/RusherDevelopment/rusherhack-plugins/blob/main/README.md))
48-
![image](https://github.com/user-attachments/assets/470b84fd-10c4-48fc-827c-c88c6d635ab2)
33+
IntelliJ may prompt you asking if you trust the project. Click `Trust Project` to continue.
34+
35+
You should now have a window that looks like this:
36+
37+
<img src="https://rusherhack.org/i/vwvie6ljusi2tfunyrmvty7j.png" alt="project" width="800"/>
38+
39+
## Modifying the template
40+
41+
- Open the `gradle.properties` file and modify it to your preferences.
42+
- Open the `src/main/resources/rusherhack-plugin.json` file and modify it to your preferences.
43+
- The `Plugin-Class` property must match the main class of your plugin.
44+
- The `Name`, `Version`, and `Minecraft-Versions` properties get automatically filled by the values in the `gradle.properties` file. You can add more Minecraft versions if you wish but compatibility between multiple versions is not guaranteed.
45+
46+
## Building the plugin
47+
48+
To build the plugin .jar file, you can run the `gradle build` task.
49+
50+
1. Click on the elephant icon on the right of the screen (Gradle)
51+
2. Navigate to `Tasks` -> `build` -> `build` and double-click it:
52+
53+
<img src="https://rusherhack.org/i/jkdw12a3wtsz9vvwpvujo9px.png" alt="gradle" width="400"/>
54+
55+
3. The compiled plugin .jar file will be located in the `build/libs` directory:
56+
57+
<img src="https://rusherhack.org/i/lfwho6o6vrqc4c3znl3pm60v.png" alt="build" width="400"/>
58+
59+
To install the plugin into RusherHack, you can follow the instructions on the [RusherHack plugins repository](https://github.com/RusherDevelopment/rusherhack-plugins?tab=readme-ov-file#installation)

0 commit comments

Comments
 (0)