Skip to content

Commit 50a811a

Browse files
committed
Merge branch 'development' of https://github.com/SkyblockAddons/SkyblockAddons into development
� Conflicts: � src/main/java/codes/biscuit/skyblockaddons/tweaker/SkyblockAddonsTransformer.java
2 parents 4b1fa0a + 9535074 commit 50a811a

22 files changed

Lines changed: 246 additions & 163 deletions

.github/docs/CONTRIBUTING.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Contributor's Guide
2+
------
3+
4+
Please make sure to make your pull requests off the `development` branch if you're adding new features. If there's
5+
an important bug fix, still make your PR on development, but put it in a separate commit so I can cherry-pick it
6+
into `master` branch. Thank you!
7+
```shell script
8+
# Not recommended
9+
git checkout -b development --track origin/development
10+
```
11+
12+
### Requirements
13+
- **IDE** (One of them)
14+
- [IntelliJ IDEA](https://www.jetbrains.com/idea/) **(Recommended)**
15+
- [Eclipse](https://www.eclipse.org/)
16+
- **(Plugin) Lombok** to help with things such as not having to manually create Getters and Setters.
17+
- [IntelliJ IDEA](https://plugins.jetbrains.com/plugin/6317-lombok)
18+
- **After installing the plugin**
19+
- Go to `Preferences`
20+
- Go to `Build, Execution, Deployment`
21+
- Go to `Compiler`
22+
- Go to `Annotation Processors`
23+
- Check ☑ `Enable annotation processing`.
24+
- [Eclipse](https://projectlombok.org/setup/eclipse)
25+
26+
### Getting started
27+
**Note:** You can use `gradle` instead of using gradle wrapper `./gradlew`.
28+
29+
1. Clone the repository
30+
2. Setup the development environment
31+
```shell script
32+
./gradlew setupDecompWorkspace
33+
```
34+
3. Integrate the development environment with your IDE
35+
- IntelliJ IDEA
36+
```shell script
37+
./gradlew idea genIntellijRuns
38+
```
39+
- Eclipse **(doesn't generate debug configuration)**
40+
```shell script
41+
./gradlew eclipse
42+
```
43+
- (Eclipse) Change **Text File Encoding** from `Default` to `UTF-8`
44+
- Go to `Window` -> `Preferences` -> `General` -> `Workspace`
45+
- Change `Text File Encoding` from `Default` to `UTF-8`
46+
47+
4. Make sure to add the **VM** argument to your debug configuration
48+
```text
49+
-Dfml.coreMods.load=codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsLoadingPlugin
50+
```
51+
5. Include your **Minecraft** username and password as arguments in the **debug configuration**.
52+
In order, to login into [Hypixel](https://hypixel.net) by your account.
53+
```text
54+
--username "<username>" --password "<password>"
55+
```
56+
> **Note:** Don't share your password with **anyone**.
57+
> **We aren't going to ask you about your password!**
58+
6. **You are now ready to build the mod!**
59+
60+
### How to build
61+
1. Build the mod
62+
```shell script
63+
./gradlew build
64+
```
65+
> **Note**
66+
>
67+
> If your jar **build** is **failing** because the code is trying to access private methods or fields,
68+
> this may be because someone added some new access transformers.
69+
>
70+
> You may want to re-run the gradle task
71+
> ```shell script
72+
> ./gradlew setupDecompWorkspace
73+
> ```
74+
> so the access transformers are applied to the source code!
75+
>
76+
2. (Optional) Run **Minecraft Forge** client
77+
```shell script
78+
./gradlew runClient
79+
```

.github/docs/OPEN_SOURCE_SOFTWARE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Software | License
88
[Discord IPC](https://github.com/jagrosh/DiscordIPC) | [Apache 2.0](licenses/APACHE_2.0.txt)
99
[Gson](https://github.com/google/gson) | [Apache 2.0](licenses/APACHE_2.0.txt)
1010
[Guava](https://github.com/google/guava) | [Apache 2.0](licenses/APACHE_2.0.txt)
11+
[JUnit 5](https://junit.org/) | [Eclipse Public License 2.0](https://github.com/junit-team/junit5/blob/main/LICENSE.md)
1112
[junixsocket](https://github.com/kohlschutter/junixsocket) | [Apache 2.0](licenses/APACHE_2.0.txt)
1213
[Log4j](https://logging.apache.org/log4j/2.x/) | [Apache 2.0](licenses/APACHE_2.0.txt)
1314
[Minecraft Forge](https://github.com/MinecraftForge/MinecraftForge/tree/1.8.9) | [Minecraft Forge License](https://github.com/MinecraftForge/MinecraftForge/blob/1.8.9/MinecraftForge-License.txt)

CONTRIBUTING.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,6 @@ Thanks to Open Source Software
5858
------
5959
Big thanks to all the open source software we use in this project! They are all listed [here](/.github/docs/OPEN_SOURCE_SOFTWARE.md).
6060

61-
6261
For Contributors
6362
------
64-
65-
Please make sure to make your pull requests off the development branch if you're adding new features. If there's
66-
an important bug fix, still make your PR on development, but put it in a separate commit so I can cherry-pick it
67-
into master branch. Thank you!
68-
69-
1. Make sure to add this VM argument to your debug configuration or your IDE's equivalent, so that all the transformers
70-
are applied properly in your dev environment!
71-
```-Dfml.coreMods.load=codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsLoadingPlugin```
72-
2. This project uses Lombok, which helps with things such as not having to manually create Getters and
73-
Setters. If you are using IntelliJ, please download the plugin called Lombok either in your IDE or by
74-
[visiting this link](https://plugins.jetbrains.com/plugin/6317-lombok) so that everything works correctly.
75-
If you are using Eclipse, [you can read this page here.](https://projectlombok.org/setup/eclipse)
76-
3. After installing the plugin in IntelliJ, go to `File``Settings``Build`
77-
`Execution, Deployment, Compiler``Annotation Processors`, and check ☑
78-
`Enable annotation processing` on the top right. This will allow you to debug properly.
79-
4. If you are using the Gradle builder (you can check in `File``Settings``Build, Execution, Deployment`
80-
`Gradle``Build and run using`), set the Gradle task ```processResourcesDev``` to run every time before
81-
launching the Minecraft client from your dev environment. This is required for the mod assets to load properly
82-
in the dev environment.
83-
84-
Note: If your jar build is failing because the code is trying to access private methods or fields,
85-
this may be because someone added some new access transformers.
86-
You may want to re-run the gradle tasks `setupDecompWorkspace` and `setupDevWorkspace` so
87-
the access transformers are applied to the source code!
63+
Please read the [contributor's guide](/.github/docs/CONTRIBUTING.md) for instructions.

build.gradle

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ sourceCompatibility = JavaVersion.VERSION_1_8
1515
targetCompatibility = JavaVersion.VERSION_1_8
1616
compileJava.options.encoding = 'UTF-8'
1717

18+
repositories {
19+
mavenCentral()
20+
maven {
21+
name 'JitPack'
22+
url 'https://jitpack.io'
23+
}
24+
}
25+
26+
dependencies {
27+
// Discord RPC for Java https://github.com/jagrosh/DiscordIPC
28+
implementation('com.github.jagrosh:DiscordIPC:e29d6d8') {
29+
exclude module: 'log4j'
30+
}
31+
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
32+
}
33+
1834
sourceSets {
1935
main {
2036
output.resourcesDir = java.outputDir
@@ -35,20 +51,6 @@ minecraft {
3551
replaceIn("${project.modName}.java")
3652
}
3753

38-
repositories {
39-
maven {
40-
name 'JitPack'
41-
url 'https://jitpack.io'
42-
}
43-
}
44-
45-
dependencies {
46-
// Discord RPC for Java https://github.com/jagrosh/DiscordIPC
47-
implementation('com.github.jagrosh:DiscordIPC:e29d6d8') {
48-
exclude module: 'log4j'
49-
}
50-
}
51-
5254
jar {
5355
// Set the archive name here instead of in shadowJar because ForgeGradle needs it when re-obfuscating the jar.
5456
archiveName = project.modName + "-" + version + "-for-MC-1.8.9.jar"
@@ -95,4 +97,8 @@ processResources {
9597
}
9698
}
9799

100+
test {
101+
useJUnitPlatform()
102+
}
103+
98104
tasks.reobfJar.dependsOn(tasks.shadowJar)

src/main/java/SkyblockAddonsInstallerFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static void main(String[] args) {
7777
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
7878
SkyblockAddonsInstallerFrame frame = new SkyblockAddonsInstallerFrame();
7979
frame.centerFrame(frame);
80-
frame.show();
80+
frame.setVisible(true);
8181

8282
} catch (Exception ex) {
8383
showErrorPopup(ex);

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiContainerHook.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import codes.biscuit.skyblockaddons.features.backpacks.Backpack;
77
import codes.biscuit.skyblockaddons.features.backpacks.BackpackColor;
88
import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPattern;
9-
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsTransformer;
9+
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsSetup;
1010
import codes.biscuit.skyblockaddons.utils.EnumUtils;
1111
import codes.biscuit.skyblockaddons.utils.ColorCode;
1212
import codes.biscuit.skyblockaddons.utils.objects.FloatPairString;
@@ -294,7 +294,7 @@ public static void drawSlot(GuiContainer guiContainer, Slot slot) {
294294
private static Method drawGradientRect = null;
295295

296296
private static void drawRightGradientRect(GuiContainer guiContainer, int left, int top, int right, int bottom, int startColor, int endColor) {
297-
if (SkyblockAddonsTransformer.isLabymodClient()) { // There are no access transformers in labymod.
297+
if (SkyblockAddonsSetup.isUsingLabyModClient()) { // There are no access transformers in labymod.
298298
try {
299299
if (drawGradientRect == null) {
300300
drawGradientRect = guiContainer.getClass().getSuperclass().getSuperclass().getDeclaredMethod("a", int.class, int.class, int.class, int.class, int.class, int.class);
@@ -364,7 +364,7 @@ public static void handleMouseClick(Slot slotIn, int slotId, int clickedButton,
364364
private static Field zLevel = null;
365365

366366
private static void setZLevel(Gui gui, int zLevelToSet) {
367-
if (SkyblockAddonsTransformer.isLabymodClient()) { // There are no access transformers in labymod.
367+
if (SkyblockAddonsSetup.isUsingLabyModClient()) { // There are no access transformers in labymod.
368368
try {
369369
if (zLevel == null) {
370370
zLevel = gui.getClass().getDeclaredField("e");
@@ -384,7 +384,7 @@ private static void setZLevel(Gui gui, int zLevelToSet) {
384384
private static Method drawHoveringText = null;
385385

386386
private static void drawHoveringText(GuiContainer guiContainer, List<String> text, int x, int y) {
387-
if (SkyblockAddonsTransformer.isLabymodClient()) { // There are no access transformers in labymod.
387+
if (SkyblockAddonsSetup.isUsingLabyModClient()) { // There are no access transformers in labymod.
388388
try {
389389
if (drawHoveringText == null) {
390390
drawHoveringText = guiContainer.getClass().getSuperclass().getDeclaredMethod("a",

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/GuiNewChatHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package codes.biscuit.skyblockaddons.asm.hooks;
22

33
import codes.biscuit.skyblockaddons.SkyblockAddons;
4-
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsTransformer;
4+
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsSetup;
55
import net.minecraft.client.Minecraft;
66
import net.minecraft.command.ICommandSender;
77
import net.minecraft.util.IChatComponent;
@@ -11,7 +11,7 @@ public class GuiNewChatHook {
1111
public static String getUnformattedText(IChatComponent iChatComponent) {
1212
SkyblockAddons main = SkyblockAddons.getInstance();
1313
ICommandSender player = Minecraft.getMinecraft().thePlayer;
14-
if (main != null && SkyblockAddonsTransformer.isDeobfuscated() || (player != null && player.getName().equals("Biscut"))) {
14+
if (main != null && SkyblockAddonsSetup.isDeobfuscatedEnvironment() || (player != null && player.getName().equals("Biscut"))) {
1515
return iChatComponent.getFormattedText(); // makes it easier for debugging
1616
}
1717
return iChatComponent.getUnformattedText();

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/PlayerControllerMPHook.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPattern;
1010
import codes.biscuit.skyblockaddons.features.craftingpatterns.CraftingPatternResult;
1111
import codes.biscuit.skyblockaddons.utils.*;
12-
import codes.biscuit.skyblockaddons.utils.ItemUtils;
1312
import net.minecraft.block.Block;
1413
import net.minecraft.client.Minecraft;
1514
import net.minecraft.entity.player.EntityPlayer;

src/main/java/codes/biscuit/skyblockaddons/asm/hooks/SoundManagerHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package codes.biscuit.skyblockaddons.asm.hooks;
22

33
import codes.biscuit.skyblockaddons.SkyblockAddons;
4-
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsTransformer;
4+
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsSetup;
55
import net.minecraft.client.audio.ISound;
66
import net.minecraft.client.audio.SoundCategory;
77
import net.minecraft.client.audio.SoundManager;
@@ -19,7 +19,7 @@ public static float getNormalizedVolume(SoundManager soundManager, ISound sound,
1919
if (main != null && main.getUtils() != null && main.getUtils().isPlayingSound()) {
2020
return 1;
2121
} else {
22-
if (SkyblockAddonsTransformer.isLabymodClient()) { // There are no access transformers in labymod.
22+
if (SkyblockAddonsSetup.isUsingLabyModClient()) { // There are no access transformers in LabyMod.
2323
try {
2424
if (getNormalizedVolume == null) {
2525
getNormalizedVolume = soundManager.getClass().getDeclaredMethod("a", ISound.class, SoundPoolEntry.class, SoundCategory.class);

0 commit comments

Comments
 (0)