45 Commits

Author SHA1 Message Date
dependabot[bot]
3bf68f24b5 Merge 0939cf0999 into febd3d63d2 2024-12-16 11:26:43 +00:00
Thea Schöbl
febd3d63d2 Delete dependabot.yml 2022-04-09 01:41:03 +02:00
dependabot[bot]
0939cf0999 Bump log4j-api from 2.16.0 to 2.17.2
Bumps log4j-api from 2.16.0 to 2.17.2.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 00:37:36 +00:00
dependabot[bot]
73e79dceed Merge pull request #25 from HMCore/dependabot/gradle/org.apache.logging.log4j-log4j-core-2.16.0 2021-12-16 13:38:26 +00:00
dependabot[bot]
6dae008be3 Merge pull request #28 from HMCore/dependabot/gradle/com.github.johnrengelman.shadow-7.1.1 2021-12-16 13:38:13 +00:00
dependabot[bot]
30d8815c78 Bump log4j-core from 2.14.1 to 2.16.0
Bumps log4j-core from 2.14.1 to 2.16.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-16 13:36:56 +00:00
dependabot[bot]
b8650b6c99 Bump com.github.johnrengelman.shadow from 7.1.0 to 7.1.1
Bumps com.github.johnrengelman.shadow from 7.1.0 to 7.1.1.

---
updated-dependencies:
- dependency-name: com.github.johnrengelman.shadow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-16 13:36:48 +00:00
dependabot[bot]
14380c6515 Merge pull request #26 from HMCore/dependabot/gradle/org.apache.logging.log4j-log4j-api-2.16.0 2021-12-16 13:36:34 +00:00
dependabot[bot]
627c817769 Merge pull request #27 from HMCore/dependabot/gradle/org.jetbrains.kotlin.jvm-1.6.10 2021-12-16 13:36:16 +00:00
dependabot[bot]
ab7af6f037 Bump org.jetbrains.kotlin.jvm from 1.6.0 to 1.6.10
Bumps org.jetbrains.kotlin.jvm from 1.6.0 to 1.6.10.

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-15 00:14:42 +00:00
dependabot[bot]
0ee724bdbe Bump log4j-api from 2.14.1 to 2.16.0
Bumps log4j-api from 2.14.1 to 2.16.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 00:19:03 +00:00
dependabot[bot]
076b6ccacd Bump junit-jupiter-api from 5.8.1 to 5.8.2 (#22) 2021-11-29 14:15:03 +00:00
dependabot[bot]
55c2ad2cd2 Merge pull request #19 from HMCore/dependabot/gradle/com.github.johnrengelman.shadow-7.1.0 2021-11-16 22:27:33 +00:00
dependabot[bot]
e14ede7fc2 Bump com.github.johnrengelman.shadow from 7.0.0 to 7.1.0
Bumps com.github.johnrengelman.shadow from 7.0.0 to 7.1.0.

---
updated-dependencies:
- dependency-name: com.github.johnrengelman.shadow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-16 22:25:19 +00:00
dependabot[bot]
1b9e9bb904 Merge pull request #20 from HMCore/dependabot/gradle/com.google.code.gson-gson-2.8.9 2021-11-16 22:24:49 +00:00
dependabot[bot]
f329af6e9f Merge pull request #21 from HMCore/dependabot/gradle/org.jetbrains.kotlin.jvm-1.6.0 2021-11-16 22:24:42 +00:00
dependabot[bot]
05fe2aacd6 Merge pull request #18 from HMCore/dependabot/gradle/org.junit.jupiter-junit-jupiter-api-5.8.1 2021-11-16 22:24:33 +00:00
dependabot[bot]
ed051fd49e Bump org.jetbrains.kotlin.jvm from 1.5.0 to 1.6.0
Bumps org.jetbrains.kotlin.jvm from 1.5.0 to 1.6.0.

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-16 00:15:33 +00:00
dependabot[bot]
42dc3b4e62 Bump gson from 2.8.6 to 2.8.9
Bumps [gson](https://github.com/google/gson) from 2.8.6 to 2.8.9.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.6...gson-parent-2.8.9)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 00:48:55 +00:00
dependabot[bot]
a50c72323f Bump junit-jupiter-api from 5.7.1 to 5.8.1
Bumps [junit-jupiter-api](https://github.com/junit-team/junit5) from 5.7.1 to 5.8.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.7.1...r5.8.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-23 00:12:21 +00:00
Wieland Schöbl
b26a7cf0ac Update README.md 2021-05-11 15:38:00 +02:00
Waterdev
6ac30d9f0a Update README.md 2021-05-11 15:29:32 +02:00
Waterdev
e23df79b73 Update README.md 2021-05-11 15:29:01 +02:00
Waterdev
8e65236c2b Update snyk-infrastructure-analysis.yml 2021-05-11 10:55:51 +02:00
Waterdev
1fd51a66b2 Update snyk-infrastructure-analysis.yml 2021-05-11 10:53:45 +02:00
Waterdev
d30fa27dc2 Create snyk-infrastructure-analysis.yml 2021-05-11 10:46:27 +02:00
UnrealValentin
35dc220249 Merge remote-tracking branch 'origin/main' into main 2021-05-11 10:16:28 +02:00
UnrealValentin
0507ee3e52 added ability to unzip 2021-05-11 10:16:09 +02:00
Waterdev
6311db9c2e Update nightly.yml 2021-05-11 10:14:25 +02:00
Waterdev
40603af040 Update build.gradle 2021-05-10 17:55:56 +02:00
Waterdev
ce9374500c Update log4j2.xml 2021-05-10 17:45:58 +02:00
Waterdev
2ba2e28ec1 Update build.gradle 2021-05-10 17:37:16 +02:00
UnrealValentin
a6cbf39485 added logging via log4j2 2021-05-10 16:09:36 +02:00
UnrealValentin
4fc7db7516 Merge remote-tracking branch 'origin/main' into main 2021-05-10 14:17:47 +02:00
UnrealValentin
abb6428a97 update to gradle 7 and addition of the ability to build a fat jar 2021-05-10 14:16:30 +02:00
Waterdev
00dc5f38b9 Merge pull request #7 from HMCore/add-code-of-conduct-1
Added a code of conduct
2021-05-10 13:29:48 +02:00
Waterdev
03d9da9128 Update CODE_OF_CONDUCT.md
Co-authored-by: Wieland Schöbl <wulkanat@gmail.com>
2021-05-10 13:29:00 +02:00
Waterdev
522905d93c Merge pull request #8 from HMCore/issue-templates
Added issue templates
2021-05-10 13:28:41 +02:00
UnrealValentin
ba4a5f94e0 added eclipse stuff to gitignore 2021-05-04 23:08:33 +02:00
UnrealValentin
6bf83d6e75 Merge branch 'main' of https://github.com/HMCore/Core into main 2021-05-04 11:10:08 +02:00
UnrealValentin
54bc7448a9 added ability to load modules 2021-05-04 11:10:02 +02:00
Waterdev
222e3cdf6c Added issue templates 2021-05-04 10:55:54 +02:00
Waterdev
a52c81654b Added a code of conduct 2021-05-04 10:42:00 +02:00
Waterdev
1f66d85f75 added ability ro manually run nightly workflow 2021-05-04 10:31:03 +02:00
Waterdev
6b50a3c74d Create nightly.yml 2021-05-04 10:27:27 +02:00
16 changed files with 413 additions and 25 deletions

34
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Please fill in the following information:**
- OS: [e.g. Windows]:
- Java Version [e.g. 11.0.9]:
- Version [e.g. v1.0]:
- Used Modules [eg. Ores]:
- Used Mods:
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1,20 @@
---
name: Module Request
about: Request a new module to be added and maintained officially by HMCore.
title: ''
labels: enhancement
assignees: ''
---
**What module do you want us to add?**
A clear description of the module and all its functionalities.
**Why do you want this module to be added? Has it something to do with a problem you encountered**
A clear description of why you want this module to be added. Maybe list some problems that would be solved by this module.
**How important is this module?**
How important the need of this module would be.
**Anything else to say?**
--

10
.github/ISSUE_TEMPLATE/other-issue.md vendored Normal file
View File

@@ -0,0 +1,10 @@
---
name: Other issue
about: Do you have any other issue not listed in the other options?
title: ''
labels: ''
assignees: ''
---

View File

@@ -1,11 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"

40
.github/workflows/nightly.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
# This workflow will run a nightly build and push it to the github releases section
name: Deploy Nightly
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
jobs:
nightly:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Unzip Javadoc
run: ./gradlew unzip
- name: Deploy Javadoc🚀
uses: JamesIves/github-pages-deploy-action@4.1.2
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./build/unpacked/javadoc # The folder the action should deploy.
- name: Deploy release🚀
uses: WebFreak001/deploy-nightly@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
with:
upload_url: https://uploads.github.com/repos/HMCore/Core/releases/42400467/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
release_id: 42400467 # same as above (id can just be taken out the upload_url, it's used to find old releases)
asset_path: ./build/libs/HMCore-1.1-SNAPSHOT.jar # path to archive to upload
asset_name: HMCore_SNAPSHOT-nightly-$$.jar # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
asset_content_type: application/java-archive # required by GitHub API
max_releases: 3 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted

View File

@@ -0,0 +1,41 @@
# A sample workflow which checks out your Infrastructure as Code Configuration files,
# such as Kubernetes, Helm & Terraform and scans them for any security issues.
# The results are then uploaded to GitHub Security Code Scanning
#
# For more examples, including how to limit scans to only high-severity issues
# and fail PR checks, see https://github.com/snyk/actions/
name: Snyk Infrastructure as Code
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '29 13 * * 5'
jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Snyk to check configuration files for security issues
# Snyk can be used to break the build when it detects security issues.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/gradle-jdk11@master
env:
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif

4
.gitignore vendored
View File

@@ -209,4 +209,6 @@ gradle-app.setting
# End of https://www.toptal.com/developers/gitignore/api/java,eclipse,intellij,gradle
run/
test-run/
test-run/
.classpath
.project

128
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement
[here](https://discord.gg/y4BVAbf).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -2,10 +2,50 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
[![Release](https://jitpack.io/v/org.hmcore/Core.svg)](https://jitpack.io/#org.hmcore/Core)
## The Core Mod of HMCore which powers the whole system.
### TODO
## Use HMCore
### Gradle
```groovy
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'org.hmcore:Core:{version}'
}
```
### Gradle Kotlin DSL
*Note: If you use Kotlin, you should probably use [core-ktx](https://github.com/HMCore/Core-ktx) instead*
```kotlin
repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("org.hmcore:Core:{version}")
}
```
### Maven
```xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>org.hmcore</groupId>
<artifactId>Core</artifactId>
<version>{version}</version>
</dependency>
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -25,4 +65,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

View File

@@ -1,15 +1,30 @@
plugins {
id 'java'
id 'maven'
id 'org.jetbrains.kotlin.jvm' version '1.5.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id 'com.github.johnrengelman.shadow' version '7.1.1'
id 'maven-publish'
}
group 'com.github.HMCore'
version '1.0-SNAPSHOT'
version '1.1-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'com.github.HMCore'
artifactId = 'Core'
version = '1.1'
from components.java
}
}
}
repositories {
@@ -18,12 +33,28 @@ repositories {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.apache.logging.log4j:log4j-api:2.17.2'
implementation 'org.apache.logging.log4j:log4j-core:2.16.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
task unzip(type: Copy) {
def zipFile = file('build/libs/HMCore-1.1-SNAPSHOT-javadoc.jar')
def outputDir = file("${buildDir}/unpacked/javadoc")
from zipTree(zipFile)
into outputDir
}

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,5 +1,7 @@
package org.hmcore;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hmcore.modules.Module;
import org.hmcore.modules.ModuleLoader;
import org.hmcore.modules.ModuleManager;
@@ -10,11 +12,18 @@ import java.util.HashMap;
public class HMCore {
public static final HashMap<String, Module> modules = new HashMap<>();
public static final Logger logger = LogManager.getLogger("HMCore");
public static void main(String[] args) {
ModuleManager.loadModules();
ModuleManager.initModules();
ModuleManager.hookModules();
ModuleManager.disableModules();
ModuleManager.unloadModules();
}
}

View File

@@ -22,12 +22,12 @@ public class ModuleLoader {
if(!moduleDir.exists()) moduleDir.mkdirs();
for (String path:
Objects.requireNonNull(moduleDir.list())) {
loadModule(path);
loadModule("hm/modules/" + path);
}
}
private void loadModule(String path) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
System.out.println("Loading module at: " + path);
HMCore.logger.debug("Loading module at: " + path);
JarFile jarFile = new JarFile(path);
JarEntry jarEntry = jarFile.getJarEntry("module.json");
String content = getClassPath(jarFile.getInputStream(jarEntry));
@@ -40,7 +40,7 @@ public class ModuleLoader {
Class<?> classToLoad = Class.forName(readable.getClassPath(), true, child);
Module instance = (Module) classToLoad.getDeclaredConstructor().newInstance();
HMCore.modules.put(instance.getName(), instance);
System.out.println("Loaded " + instance.getName() + " v" + readable.getVersion() + " by " + readable.getCreator());
HMCore.logger.info("Loaded " + instance.getName() + " v" + readable.getVersion() + " by " + readable.getCreator());
}
private String getClassPath(InputStream jarEntry) {

View File

@@ -47,8 +47,8 @@ public class ObjectInfoConfigHandler {
if(registryModule.objectAndInfoExist(data.objectInfoName, data.objectInfoChosen)) {
registryModule.forceObjectInfoForObject(data.objectInfoName, data.objectInfoChosen);
} else {
System.out.println("[!] Either Object Info " + data.objectInfoChosen + " doesn't exist for " + data.objectInfoName + " or " + data.objectInfoName + " doesn't exist!\n" +
"Please stop the Server, delete objetc-infos.json and let the server regenertate a new config [!]");
HMCore.logger.fatal("[!] Either Object Info " + data.objectInfoChosen + " doesn't exist for " + data.objectInfoName + " or " + data.objectInfoName + " doesn't exist!\n" +
"Please stop the Server, delete objetc-infos.json and let the server regenerate a new config [!]");
return false;
}
}
@@ -89,7 +89,7 @@ public class ObjectInfoConfigHandler {
try {
object = new GsonBuilder().create().fromJson(content, ObjectInfoConfig.class);
} catch (Exception e) {
System.out.println("[!] Object Info Config not valid!");
HMCore.logger.fatal("[!] Object Info Config not valid!");
return null;
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="WARN">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss} [%t | %-5level] %msg%n"/>
</Console>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="%d{HH:mm:ss} [%t | %-5level] %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="1000"/>
</RollingRandomAccessFile>
</appenders>
<loggers>
<root level="debug">
<appender-ref ref="Console" level="info"/>
<appender-ref ref="File" level="info"/>
</root>
</loggers>
</configuration>