Skip to content

Commit

Permalink
update to neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterpaul committed Jan 13, 2024
1 parent d662e53 commit d6273be
Show file tree
Hide file tree
Showing 1,345 changed files with 12,725 additions and 15,623 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ whitelist.json

# Other
/run/
/runs/
Thumbs.db
.directory
### Eclipse template
Expand Down
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ The following labeling scheme is used:
## People
- [maxanier](https://maxanier.de)
- [Cheaterpaul](https://paube.de)
- [1LiterZinalco](https://chimute.org/) _Triage/Support/Community/Official Server/Art_
- [lunofe](https://github.com/lunofe) _Triage/Support/Community/Official Server/Art_
- [Piklach](https://twitter.com/Piklach) _Community/Official Server_
- [xXvPendragonvXx](https://github.com/PendragonII) _Community/Official Server_


## Special Thanks to
- PendragonII _Community/Official Server_
- TheRebelT _Models/Textures_
- TinkerHatWill _Textures_
- Alis _Textures_
Expand All @@ -70,7 +71,12 @@ The following labeling scheme is used:

## API
Vampirism has an API you can use to add blood values to your mod's creatures or make them convertible and more. For more information and an overview checkout the wiki https://wiki.vampirism.dev/docs/api/intro.
#### Setup Gradle build script


## Setup Gradle build script

<details>
<summary>Use Vampirism in your development environment</summary>
You should be able to include it with the following in your `build.gradle`:
```gradle
repositories {
Expand All @@ -89,8 +95,8 @@ dependencies {

#### Choose a version

`${mc_version}` gets replaced by the current Minecraft version. (i.e. `1.16.5`)
`${vampirism_version}` gets replaced by the version of Vampirism you want to use (i.e `1.7.12`)
`${mc_version}` gets replaced by the current Minecraft version. (i.e. `1.20.4`)
`${vampirism_version}` gets replaced by the version of Vampirism you want to use (i.e `1.10.0`)

For a list of available Vampirism version,
see [CurseForge](https://www.curseforge.com/minecraft/mc-mods/vampirism-become-a-vampire) or
Expand Down Expand Up @@ -131,7 +137,9 @@ Vampirism will work correctly then.
Checkout this example project: https://github.com/TeamLapen/VampirismAPIExample

If you want to create an addon which access all of Vampirism's classes, not just the API, checkout
this https://github.com/TeamLapen/VampirismAddonExample and consider contacting @maxanier.
this https://github.com/TeamLapen/VampirismAddonExample and consider contacting @Cheaterpaul.

</details>

## Code Structure

Expand All @@ -153,6 +161,11 @@ Provides Helpers and Registries to automate stuff like EntityUpdates.
Provides abstract classes/default implementations/interfaces to simplify things (located under de.teamlapen.lib.lib).

## Setting up the development environment

<details>
<summary>old / outdated</summary>


If you would like to compile your own versions or even contribute to Vampirism's development you need to set up a dev environment.
The following example instructions will set up IntelliJ (Free community edition or Non-Free Ultimate edition). If you already have a setup or want to use another IDE, jump [here](#eclipse-or-other-ides).

Expand All @@ -177,7 +190,9 @@ If you would like to set up Vampirism in another way or another IDE, you should
2. Vampirism might have a few dependencies (e.g. Waila), which are specified in the gradle files and should be automatically downloaded and added when you run `ideaModule` or `eclipse`.
3. Vampirism requires at least Java 8

### Code Style
</details>

## Code Style
The code style used in this project is the IntelliJ default one.
For Eclipse, you can use the settings created by @Cheaterpaul [FormatFile](https://gist.github.com/Cheaterpaul/1aa0d0014240c8bd854434b5147804df) [ImportOrder](https://gist.github.com/Cheaterpaul/594d16f54358bdca6ea5e549f81b3589)

Expand Down
47 changes: 26 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'org.spongepowered.mixin' version '0.7.+'
id 'net.neoforged.gradle.userdev' version '7.+'
id "net.neoforged.gradle.mixin" version "7.+"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.modrinth.minotaur" version "2.4.5"
id 'de.undercouch.download' version '3.3.0'
Expand All @@ -10,17 +9,21 @@ plugins {
}

group = mod_group_id
version = mod_version

base {
archivesName = mod_name
mod_version = "1.0.0"
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)


sourceSets {
api
api {
compileClasspath += configurations["compileClasspath"]
}
lib {
compileClasspath += configurations["minecraft"]
compileClasspath += configurations["compileClasspath"]
}
//noinspection GroovyAssignabilityCheck
main {
Expand All @@ -29,6 +32,15 @@ sourceSets {
//if you want to exclude a package do it here, but use the package as path (e.g. de/teamlapen/vampirism for de.teamlapen.vampirism)
// if you want intellij to ignore the package, you need to add it in the settings (File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes)
// exclude(<package>)
if (!include_jei.toBoolean()) {
exclude('de/teamlapen/vampirism/modcompat/jei')
}
if (!include_guideapi.toBoolean()) {
exclude('de/teamlapen/vampirism/modcompat/guide')
}
if (!include_terrablender.toBoolean()) {
exclude('de/teamlapen/vampirism/modcompat/terrablender')
}
}
//noinspection GroovyAssignabilityCheck
compileClasspath += sourceSets.lib.output
Expand All @@ -43,26 +55,19 @@ sourceSets {
}
}


apply from: 'gradle/versioning.gradle'
apply from: 'gradle/forge.gradle'
apply from: 'gradle/versioning.gradle'
apply from: 'gradle/artifacts.gradle'
apply from: 'gradle/deploy.gradle'
apply from: 'gradle/crowdin.gradle'


configurations {
apiCompile.extendsFrom(compile)
apiImplementation.extendsFrom(implementation)
apiRuntimeOnly.extendsFrom(runtimeOnly)
}

idea {
module {
for (String excludeDirName in ["run", "out", "logs"]) {
for (String excludeDirName in ["run", "out", "logs", "runs"]) {
File excludeDir = new File(projectDir, excludeDirName)
excludeDirs.add(excludeDir)
}
downloadSources = true
}
}

Expand All @@ -77,6 +82,7 @@ tasks.named('processResources', ProcessResources).configure {
guideapi_version: guideapi_version,
mod_url: mod_url,
mod_issue_tracker: mod_issue_tracker,
pack_format_number: pack_format_number,
]
inputs.properties replaceProperties

Expand All @@ -87,9 +93,6 @@ tasks.named('processResources', ProcessResources).configure {

tasks.named('jar', Jar).configure {
dependsOn 'crowdin'

includeEmptyDirs = false

from sourceSets.main.output.classesDirs
from sourceSets.api.output.classesDirs
from sourceSets.lib.output.classesDirs
Expand All @@ -115,10 +118,12 @@ tasks.named('jar', Jar).configure {
"FMLAT" : "accesstransformer.cfg",
])
}

finalizedBy 'reobfJar'
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

configurations.all {
print(it.name + "\n")
}
36 changes: 20 additions & 16 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# gradle
org.gradle.daemon=false
org.gradle.jvmargs=-Xmx3G
org.gradle.debug=false

# forge
minecraft_version=1.20.1
minecraft_version_range=[1.20.1,1.21)
forge_version=47.1.0
forge_version_range=[47,)
loader_version_range=[47,)
mappings_channel=parchment
mappings_version=2023.07.16-1.20.1
minecraft_version=1.20.4
minecraft_version_range=[1.20.4,1.21)
forge_version=20.4.83-beta
forge_version_range=[20.4,)
loader_version_range=[1,)
parchment_minecraft_version=1.20.2
parchment_mappings_version=2023.12.10
pack_format_number=18

# mod
mod_id=vampirism
Expand All @@ -30,17 +32,19 @@ mod_version="Test"
type="test"
classification="test"

#gradle setting
include_jei=true
include_guideapi=true
include_terrablender=true

#Dependencies/Optional Libraries
#jei setting
include_jei=false
jei_mc_version=1.20.1
jei_version=15.0.0.12

#guideapi setting
include_guideapi=false
guideapi_version=1.20.1-2.2.6
terrablender_version=1.20.1-3.0.0.164

#terrablender setting
include_terrablender=true
terrablender_version=1.20.4-3.3.0.5

#jade
include_jade=true
jade_version=4801177
include_jade=false
jade_version=4980188
7 changes: 0 additions & 7 deletions gradle/artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ tasks.register('apiJar', Jar) {
archiveClassifier = 'api'
}

tasks.register('deobfJar', Jar) {
description = 'Creates a JAR containing the non-obfuscated compiled code.'
from sourceSets.main.output
archiveClassifier = 'deobf'
}

tasks.register('sourcesJar', Jar) {
from sourceSets.main.allJava
from sourceSets.api.allJava
Expand All @@ -31,6 +25,5 @@ javadoc {
artifacts {
archives sourcesJar
archives apiJar
archives deobfJar
archives javadocJar
}
3 changes: 1 addition & 2 deletions gradle/deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ publishing {

artifact apiJar
artifact sourcesJar
artifact deobfJar
artifact javadocJar

}
Expand Down Expand Up @@ -123,7 +122,7 @@ modrinth {
versionNumber = "${project.minecraft_version}-${project.mod_version}"
uploadFile = jar
gameVersions = [project.minecraft_version]
loaders = ["forge"]
loaders = ["neoforge"]
dependencies {
optional.project "u6dRKJwZ" //jei
optional.project "w5L2PHJU" //guide-api-village-and-pillage
Expand Down
Loading

0 comments on commit d6273be

Please sign in to comment.