Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion to Multi Loader for Fabric Support #55

Merged
merged 52 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
52f7388
Updated All Comments and CONTRIBUTING.MD
MeAlam1 Aug 17, 2024
81575e8
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 17, 2024
c245731
Created an InterfaceBase + Authored the Code
MeAlam1 Aug 17, 2024
ab4032c
Merge branch '1.20.4' of https://github.com/Repo-Fork-Alam/BlueLib-Fo…
MeAlam1 Aug 17, 2024
685edf0
Forgot the copyright shush
MeAlam1 Aug 17, 2024
68401c6
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 17, 2024
653496d
Moved the ReloadDataHandler to the Library
MeAlam1 Aug 20, 2024
e9d289d
Added Copyright
MeAlam1 Aug 20, 2024
6ea1ddb
Fixed the Custom Parameters to accept Int, Bool & Array
MeAlam1 Aug 21, 2024
2a0a475
Fixed some commenting
MeAlam1 Aug 21, 2024
eb1c9b0
Merge branch '1.20.4' into 1.20.4
MeAlam1 Aug 21, 2024
422b806
Fixed the Datapack Support
MeAlam1 Aug 21, 2024
efcf856
Merge branch '1.20.4' of https://github.com/Repo-Fork-Alam/BlueLib-Fo…
MeAlam1 Aug 21, 2024
81f22e5
Merge branch '1.20.4' into 1.20.4
MeAlam1 Aug 21, 2024
34e84a2
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 21, 2024
e16a5cb
/reload now registers new Variants
MeAlam1 Aug 21, 2024
1b28727
Fixed the Reload, but there is a 1 sec timer which needs to go
MeAlam1 Aug 22, 2024
cad205d
Updated Comments
MeAlam1 Aug 22, 2024
48fc344
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 28, 2024
e3143ac
Updated the Wiki Template
MeAlam1 Aug 28, 2024
2791e49
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 28, 2024
e2d95bb
Revised and Double Checked the Entire Code!!!!
MeAlam1 Aug 28, 2024
bf40db0
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 28, 2024
6f56a2d
Update CONTRIBUTING.md
MeAlam1 Aug 29, 2024
a17073e
Update CONTRIBUTING.md
MeAlam1 Aug 29, 2024
cc0ad68
Finished Commenting BlueLib
MeAlam1 Aug 29, 2024
4e9cdef
Update CONTRIBUTING.md
MeAlam1 Aug 29, 2024
d2ccc42
Commented all Library related code for the Test Mod
MeAlam1 Aug 29, 2024
505ffef
Removed Docs
MeAlam1 Aug 29, 2024
2a58516
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 29, 2024
ae7bb5b
Added Forge Port(BROKEN)
MeAlam1 Aug 29, 2024
9780b7a
Removed the TestMod / Fixed Forge
MeAlam1 Aug 30, 2024
ad823a4
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 30, 2024
2dc0fce
Minimized the build.gradle
MeAlam1 Aug 30, 2024
5a1bdb6
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 30, 2024
cf8c266
Merge branch '1.20.4' into 1.20.4
MeAlam1 Aug 30, 2024
91cb31f
Merge branch 'MeAlam1:1.20.4' into 1.20.4
MeAlam1 Aug 30, 2024
2c380a5
Merge branch 'MeAlam1:1.20' into 1.20
MeAlam1 Sep 4, 2024
ef4e639
Updated Workflow
MeAlam1 Sep 4, 2024
106a152
Create PullRequest.md
MeAlam1 Sep 4, 2024
af88fe3
Merge branch 'MeAlam1:1.20' into 1.20
MeAlam1 Sep 4, 2024
0d5a3be
Merge branch 'MeAlam1:1.20' into 1.20
MeAlam1 Sep 4, 2024
aba5c90
Update PULL_REQUEST_TEMPLATE.md
MeAlam1 Sep 4, 2024
a14de6c
Merge branch 'MeAlam1:1.20' into 1.20
MeAlam1 Sep 4, 2024
dea5e33
Added Logo
MeAlam1 Sep 5, 2024
784ee93
Added 1.20 Support (Forge is Broken Again)
MeAlam1 Oct 14, 2024
aa31a69
Update ci.yml
MeAlam1 Oct 14, 2024
6b87ea0
Update ci.yml
MeAlam1 Oct 14, 2024
438cc9d
Update README.md
MeAlam1 Oct 24, 2024
400e929
Update ci.yml
MeAlam1 Oct 24, 2024
eb55672
Removed Capitals to hopefully fix the Workflow
MeAlam1 Oct 24, 2024
a6a5a1d
Finished 1.20!
MeAlam1 Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/EnhancementTemplate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Enhancement Template
description: Create a Enhancement!
title: "[Enhancement]: "
labels: ["Enhancement"]
body:
- type: markdown
attributes:
value: |
Thank you for making a Suggestion!
- type: textarea
id: what-should-we-add
attributes:
label: What do you want to have added?
description: |
Please tell us as detailed as possible what you want to have added to the library!
Feel free to also add Examples if they exist!
validations:
required: true
- type: dropdown
id: inspiration
attributes:
label: Inspiration
description: Is this idea used in other Mods/Games?
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: inspiration-where
attributes:
label: Where did you get the inspiration from?
description: If this idea is used in a different Mod/Game, please provide a list of the Games/Mods
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
- [ ] My changes generate no new warnings.

## Related Issues
<!-- List any issues that this PR is related to or closes. -->
<!-- List any issues that this PR is related to or closes. -->
26 changes: 20 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
build:
runs-on: ubuntu-latest

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -22,6 +25,11 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
Expand All @@ -32,14 +40,20 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for Gradle wrappers
- name: Generate Gradle wrapper if not present
run: |
chmod +x NeoForge/gradlew
chmod +x Forge/gradlew
if [ ! -f "./gradlew" ]; then
gradle wrapper
fi

- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew

- name: Build for NeoForge
run: cd NeoForge && ./gradlew build
run: ./gradlew build -p neoforge

- name: Build for Forge
run: cd Forge && ./gradlew build

run: ./gradlew build -p forge

- name: Build for Fabric
run: ./gradlew build -p fabric
45 changes: 21 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# Compiled class file
*.class
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Default ignored files
# idea
out
*.ipr
*.iws
*.iml
.idea/*
!.idea/scopes

# gradle
build
.gradle

# other
eclipse
run
runs
190 changes: 108 additions & 82 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,115 @@

- All code should be commented using the `/** * * */` format. This ensures that comments are displayed when users hover over a method, class, or variable, even after the library is compiled. This helps maintain clarity and consistency in the documentation.

- **Structure**:
- **Class Descriptions**:
- **Key Methods:** List key methods provided by the class, using bullet points for easy readability.
- **Author:** If you have contributed to a Method/Class, put yourself as Co-author, if you have created an Method/Class, put yourself as Author.
- **Since Version:** Use the `@since` tag to indicate the version since which the class has been available.
**Example:**
```java
/**
* A {@code JSONLoader} class responsible for loading and parsing JSON data from resources
* defined by {@link ResourceLocation} within a Minecraft mod environment.
* <p>
* Key Methods:
* <ul>
* <li>{@link #loadJson(ResourceLocation, ResourceManager)} - Loads a JSON resource.</li>
* </ul>
* @author MeAlam
* @Co-author Dan
* @since 1.0.0
*/
public class JSONLoader {
}
```
- **Method Descriptions**: Begin each comment with a brief description that typically starts with `A ...`, where the `...` represents a link to the relevant class or object using `{@link ClassName}`. If the method is `void`, use `{@code}` to refer to the method name instead.
- **Example for a Method**:
```java
/**
* A {@link String} that retrieves the value of a custom parameter for a specific variant.
*
* @param pVariantName {@link String} - The variant name you want to see the custom parameter of.
* @param pParameterKey {@link String} - The parameter you want to see.
* @return The value of the custom parameter identified by {@code pParameterKey}
* for the variant specified by {@code pVariantName}.
* @author MeAlam
* @Co-author Dan
* @since 1.0.0
*/
public String getCustomParameter(String pVariantName, String pParameterKey) {
// Method implementation
}
```

- **Parameters**: Start each parameter description with `{@link TypeOfParameter} - [Comment]`. If the parameter is referenced within the comment, enclose it in a code block using `{@code}`.
- **Example for Parameters**:
```java
/**
* A {@link String} that retrieves the value of a custom parameter for a specific variant.
*
* @param pVariantName {@link String} - The variant name you want to see the custom parameter of.
* @param pParameterKey {@link String} - The parameter you want to see.
* @return The value of the custom parameter identified by {@code pParameterKey}
* for the variant specified by {@code pVariantName}.
* @author MeAlam
* @Co-author Dan
* @since 1.0.0
*/
public String getCustomParameter(String pVariantName, String pParameterKey) {
// Method implementation
}
```
- **Structure**:
- **Class Descriptions**:
- **Start with:** Start the Comment with A(n) {@code privacy/static/final} {@code/link Class/MethodType} [Description of the Class/Method].
- **Key Methods:** List key methods provided by the class, using bullet points for easy readability.
- **Author:** If you have contributed to a Method/Class, feel free to add yourself to the author tag.
- **Since Version:** Use the `@since` tag to indicate the version since which the Method/Class has been available.
- **Version:** Use the `@version` tag to indicate the version since when the class has last been updated.
**Example:**
```java
/**
* A {@code public abstract base class} for managing a collection of {@link #parameters}.
* <p>
* This {@code class} provides methods to add, retrieve, remove, and manipulate {@link #parameters} stored as key-value pairs.
* </p>
* Key Methods:
* <ul>
* <li>{@link #addParameter(String, Object)} - Adds a parameter to {@link #parameters}.</li>
* <li>{@link #getParameter(String)} - Retrieves a parameter from {@link #parameters}.</li>
* <li>{@link #removeParameter(String)} - Removes a parameter from {@link #parameters}.</li>
* <li>{@link #getAllParameters()} - Returns all parameters in {@link #parameters}.</li>
* <li>{@link #containsParameter(String)} - Checks if a parameter exists by its key from {@link #parameters}.</li>
* <li>{@link #isEmpty()} - Checks if {@link #parameters} is empty.</li>
* <li>{@link #clearParameters()} - Clears all parameters from {@link #parameters}.</li>
* <li>{@link #getParameterCount()} - Returns the number of parameters in {@link #parameters}.</li>
* <li>{@link #getParameterKeys()} - Returns a set of all parameter keys from {@link #parameters}.</li>
* <li>{@link #getParameterValues()} - Returns a collection of all parameter values from {@link #parameters}.</li>
* <li>{@link #updateParameter(String, Object)} - Updates the value of an existing parameter in {@link #parameters}.</li>
* </ul>
*
* @author MeAlam
* @since 1.0.0
* @version 1.0.0
*/
```
- **Start with:** Start the Comment with A(n) {@code privacy/static/final} {@code/link Class/MethodType} [Description of the Class/Method].
- **Example for a Method**:
```java
/**
* A {@code protected static void} that registers entity variants from specified locations.
* <p>
* This method attempts to load variants from both mod and datapack locations. It logs status information and
* handles exceptions that occur during the loading process.
* </p>
* <p>
* Parameters:
* <ul>
* <li>{@code pFolderPath} {@link String} - The folder path location within the mod or datapack where variants are stored.</li>
* <li>{@code pServer} {@link MinecraftServer} - The server instance of the current world.</li>
* <li>{@code pModID} {@link String} - The mod ID used to locate the entity variant resources. (Use your Mod's ID)</li>
* <li>{@code pEntityName} {@link String} - The entity name to load.</li>
* </ul>
*
* Exception Handling:
* <ul>
* <li>{@link JsonParseException} - Thrown when there is an error parsing the JSON files.</li>
* <li>{@link RuntimeException} - Thrown for unexpected errors during the registration process.</li>
* </ul>
*
* @param pFolderPath {@link String} - The folder path location within the mod or datapack where variants are stored.
* @param pServer {@link MinecraftServer} - The server instance of the current world.
* @param pModID {@link String} - The mod ID used to locate the entity variant resources. (Use your Mod's ID)
* @param pEntityName {@link String} - The entity name to load.
* @throws JsonParseException if there is an error parsing the JSON files.
* @throws RuntimeException if an unexpected error occurs during the registration process.
* @author MeAlam
* @see MinecraftServer
* @see ResourceLocation
* @see VariantLoader
* @since 1.0.0
*/
protected static void registerEntityVariants(String pFolderPath, MinecraftServer pServer, String pModID, String pEntityName) {
}
```

- **Parameters**: Start each parameter description with `{@link TypeOfParameter} - [Comment]`. If the parameter is referenced within the comment, enclose it in a code block using `{@code}`.
- **Example for Parameters**:
```java
/**
* A {@link String} that retrieves the value of a custom parameter for a specific variant.
*
* @param pVariantName {@link String} - The variant name you want to see the custom parameter of.
* @param pParameterKey {@link String} - The parameter you want to see.
* @return The value of the custom parameter identified by {@code pParameterKey}
* for the variant specified by {@code pVariantName}.
* @author MeAlam
* @since 1.0.0
*/
public String getCustomParameter(String pVariantName, String pParameterKey) {
// Method implementation
}
```

- **General Guidelines**:
- Always ensure that comments are clear, concise, and provide sufficient information to understand the code.
- When referencing variables or constants, use `{@code}` to wrap them within the comment.
- Use `{@link}` to refer to classes, methods, or any other Java elements where appropriate.
- Key Methods: In class-level comments, list out key methods provided by the class, which can help users quickly understand the main functionalities.
- Key Methods: In class-level comments, list out key methods provided by the class, which can help users quickly understand the main functionalities.
- Versioning: Include the `@since` tag in both class-level and method-level comments to indicate the version since which the class or method has been available.
- If you update a Class/Method, please add/update the `@version` to indicate it has been changed.
- If you update a Class, please add/update the `@version` to indicate it has been changed.
- Copyright: Each file should start with `// Copyright (c) BlueLib. Licensed under the MIT License.`
- Tags: Use `@see` to link to the correct Wiki Documentation page if it exists.
- Logging: Log every step using `BaseLogger.log`, Always remove the `@EnableLogging` annotation/disable the logging before committing.
- Error Handling: Always ensure that errors and warnings are logged using appropriate logging levels. Critical steps must be logged at least with `BaseLogger.log(BaseLogLevel.Error)` to keep a trail of execution.

### Deprecation

- If you optimize a method, variable, or class and determine that it is no longer necessary for the library, mark it as `@Deprecated` instead of removing it. This only applies to elements that have been included in previous released versions of the library.

- Include a **strong TODO comment** explaining why it is deprecated and any further action required, such as testing or eventual removal.
- Include an **`@see`** that links to the New Method
- **Example**:
```java
/**
Expand All @@ -97,8 +132,8 @@
* <strong>TODO: Testing with Multiple Entities and Datapacks required before Deletion/Refactoring.</strong><br>
* @return A map containing the parameters added to this builder.
* @author MeAlam
* @Co-author Dan
* @since 1.0.0
* @see #newMethod()
*/
@Deprecated
public Map<String, String> build() {
Expand Down Expand Up @@ -134,40 +169,31 @@
- Visual Studio Code (VSC)
- Eclipse (Recommended)

5. **Publish to Local Maven Repository**
- Run the following command from the library folder (e.g., `NeoForge`, `Forge`, `Fabric`) to publish the library to your local Maven repository.
- **Example**:
```bash
./gradlew publishToMavenLocal
```
- This allows you to test the library locally.

6. **Modify the Library**
5. **Modify the Library**
- Make the necessary changes to the respective library folder you are working on. Ensure you adhere to the coding conventions described above.

7. **Test Your Changes**
- Before committing, test your changes by running the game using the appropriate test mod loader folder:
- `TestMods/TestNeoForge`
- `TestMods/TestForge`
- `TestMods/TestFabric`
6. **Test Your Changes**
- Before committing, test your changes by running the game using the appropriate test mod loader folder.
- Use the `example` package to test your changes.
- If no code is available to test, create new test code in the `example` package.
- Ensure that your changes do not introduce any issues or regressions.

8. **Commit Your Changes**
- Once you are satisfied with your changes, commit them from the root folder (`BlueLib`).
7. **Commit Your Changes**
- Once you are satisfied with your changes, commit them to your branch.
- Write clear and concise commit messages explaining the changes made.
- **Example**:
```bash
git commit -am "Improved logging functionality and deprecated old log method"
```

9. **Push to Your Fork**
8. **Push to Your Fork**
- Push your branch to your fork on GitHub.
- **Example**:
```bash
git push origin feature/improve-logging
```

10. **Create a Pull Request (PR)**
9. **Create a Pull Request (PR)**
- Navigate to your fork on GitHub and create a Pull Request to the main repository. Provide a detailed description of the changes made and why they are necessary.

## Contributor License Agreement (CLA)
Expand All @@ -194,4 +220,4 @@ If you have any questions or need further clarification, please reach out to the

Thank you for contributing to BlueLib and helping to make it better!

---
---
5 changes: 0 additions & 5 deletions Forge/.gitattributes

This file was deleted.

Loading
Loading