Skip to content

Commit

Permalink
downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Aug 8, 2024
0 parents commit 2cbc973
Show file tree
Hide file tree
Showing 54 changed files with 3,023 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: publish

on:
workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot'
java-version: 17
cache: 'gradle'

- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build files
run: ./gradlew build

- name: read mod name, mod version and minecraft version
id: properties
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
properties: 'archives_base_name mod_version minecraft_version'

- uses: Kir-Antipov/[email protected]
with:
modrinth-featured: true
modrinth-unfeature-mode: subset

modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

name: '${{ steps.properties.outputs.archives_base_name }}-${{ steps.properties.outputs.mod_version }}+${{ steps.properties.outputs.minecraft_version }}'
version: '${{ steps.properties.outputs.mod_version }}+${{ steps.properties.outputs.minecraft_version }}'
game-versions: |
${{ steps.properties.outputs.minecraft_version }}
version-type: release
version-resolver: exact

dependencies: |
fabric-api | depends | *
cloth-config | depends | *
changelog-file: CHANGELOG.md

retry-attempts: 2
retry-delay: 10000
fail-mode: fail

- name: read changelog
id: changelog
uses: juliangruber/read-file-action@v1
with:
path: 'CHANGELOG.md'

- name: discord webhook
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
embed-title: "${{ steps.properties.outputs.archives_base_name }} ${{ steps.properties.outputs.mod_version }} for Minecraft ${{ steps.properties.outputs.minecraft_version }} has been released!"
embed-description: "**Changelog**```md\n${{ steps.changelog.outputs.content }}```\n**Downloads**\n<:modrinth:1110118061106798644> https://modrinth.com/mod/${{ steps.properties.outputs.archives_base_name }}\n<:curseforge:1110124796362109028> https://www.curseforge.com/minecraft/mc-mods/${{ steps.properties.outputs.archives_base_name }}"
embed-footer-text: "Have fun and be blessed!"
embed-color: 0xFF8000
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# gradle

.gradle/
build/
out/
classes/

# eclipse

*.launch

# idea

.idea/
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# macos

*.DS_Store

# fabric

run/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Added:
-
### Fixed:
- Fixed levelz compat
### Changed:
-
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Globox_Z

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# RpgDifficulty
RpgDifficulty is a mod which strengthens mobs over time and distance.

### Installation
RpgDifficulty is a mod built for the [Fabric Loader](https://fabricmc.net/). It requires [Fabric API](https://www.curseforge.com/minecraft/mc-mods/fabric-api) and [Cloth Config API](https://www.curseforge.com/minecraft/mc-mods/cloth-config) to be installed separately; all other dependencies are installed with the mod.

### License
RpgDifficulty is licensed under MIT.

### Config
- `increasingDistance`: distance in blocks to increase strength of mobs by `distanceFactor`. <br>
example: 300 blocks = 10% stronger, 600 blocks = 20% stronger, can be disabled by turning `increasingDistance` to 0
- `increasingTime`: time in minutes to increase strength of mobs by `timeFactor`. <br>
example: 60 minutes = 5% stronger, 120 minutes = 10% stronger, can be disabled by turning `increasingTime` to 0
- `heightDistance`: distance in blocks from mob y - `startingHeight` / `heightDistance` to increase strength of mobs by `heightFactor`. <br>
example: 30 blocks above `startingHeight` = 10% stronger, 60 blocks above `startingHeight` = 20% stronger ,can be disabled by `positiveHeightIncreasion` or `negativeHeightIncreasion` for each direction of height
- `maxFactorHealth`: max factor for health increasion. <br>
example: 1.0 = no increasion at all, 2.0 = max double health, 3.0 = max tripple health
- `maxFactorDamage`: max factor for damage increasion. <br>
example: see `maxFactorHealth`
- `maxFactorProtection`: max factor for protection increasion. <br>
example: see `maxFactorHealth`
- `maxFactorSpeed`: max factor for speed increasion. <br>
example: see `maxFactorHealth`, only applies onto special zombie
- `allowRandomValues`: allow random values to be applied on mobs with chance of `randomChance`. <br>
example: `randomChance` = 10 equals 10% chance for applying random stats
- `randomFactor`: applies when `allowRandomValues` is true with the chance of `randomChance` <br>
example: mobHealth = mobHealth * (1 - `randomFactor` + (random.nextDouble() * `randomFactor` * 2F));
- `extraXP`: calculate xp drop by strength. <br>
example: strength = 2.0 cause of distance 3000 blocks = double xp amount
- `maxXPFactor`: max xp factor for xp drop increasion. <br>
example: 2.0 = max double xp drop
- `startingFactor`: overall starting factor for calculation. <br>
example: 1.0 = normal calculation, 2.0 = double calculation
- `startingDistance`: starting distance in blocks to calculate strength from spawn point. <br>
example: 0 = strength calculation begins from spawn point, 100 = strength calculation begins from 100 blocks around spawn point
- `startingTime`: staring time in minutes to calculate strength. <br>
example: 0 = strength calculation begins from minute 0, 60 = strength calculation begins after 60 minutes

### Datapacks

For settings specific to a dimension a datapack is required.
If you don't know how to create a datapack check out [Data Pack Wiki](https://minecraft.fandom.com/wiki/Data_Pack) website and try to create your first one for the vanilla game.\
If you know how to create one, the folder path has to be ```data\rpgdifficulty\difficulty\YOURFILE.json```\
Boss modificators will get used for all mobs which are in the common entity types boss tag. (Called c:bosses)\
If the mod is used on a server, turning the timeFactor to 0 is recommended.

Settings which can get modified are:
- distanceCoordinatesX
- distanceCoordinatesZ
- increasingDistance
- distanceFactor
- increasingTime
- timeFactor
- heightDistance
- heightFactor
- maxFactorHealth
- maxFactorDamage
- maxFactorProtection
- maxFactorSpeed
- startingFactor
- startingDistance
- startingTime
- startingHeight
- positiveHeightIncreasion
- negativeHeightIncreasion

An example can be found below:

```json
{
"dimension": "minecraft:the_nether",
"increasingDistance": 300,
"distanceFactor": 0.1,
"increasingTime": 60,
"timeFactor": 0.05,
"heightDistance": 30,
"heightFactor": 0.1,
"maxFactorHealth": 3.0,
"maxFactorDamage": 3.0,
"maxFactorProtection": 1.5,
"maxFactorSpeed": 2.0,
"startingFactor": 1.0,
"startingDistance": 0,
"startingTime": 0,
"startingHeight": 62,
"positiveHeightIncreasion": true,
"negativeHeightIncreasion": true
}
```
90 changes: 90 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url 'https://jitpack.io' }
maven { url "https://maven.bai.lol" }
maven { url "https://www.cursemaven.com" }
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
maven { url "https://api.modrinth.com/maven" }
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Config
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
// Modmenu
modCompileOnly modRuntimeOnly("com.terraformersmc:modmenu:${project.mod_menu_version}"),{
exclude(group: "net.fabricmc.fabric-api")
}
// Nameplate
modCompileOnly ('maven.modrinth:nameplate:1.1.3+1.19.2') {
exclude(group: "net.fabricmc.fabric-api")
}
//Wthit for nameplate
modCompileOnly ("mcp.mobius.waila:wthit-api:fabric-8.0.2")
// LevelZ
modCompileOnly ('maven.modrinth:levelz:1.4.9+1.20') {
exclude(group: "net.fabricmc.fabric-api")
}
// // PlayerEx
// modCompileOnly ('maven.modrinth:playerex-directors-cut:4.0.0+1.20.1-alpha.12') {
// exclude(group: "net.fabricmc.fabric-api")
// }

// RpgLootZ
// modCompileOnly ('maven.modrinth:rpgz:0.5.3') {
// exclude(group: "net.fabricmc.fabric-api")
// }
}

processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version, "fabric_version": project.fabric_version, "loader_version": project.loader_version, "minecraft_version": project.minecraft_version, "cloth_config_version": project.cloth_config_version
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

repositories {
}
}
19 changes: 19 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.11

# Mod Properties
mod_version = 1.3.13
maven_group = net.rpgdifficulty
archives_base_name = rpgdifficulty

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.92.2+1.20.1
cloth_config_version=11.0.99
mod_menu_version=7.0.0
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2cbc973

Please sign in to comment.