Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
description: Report a bug with the mod.
labels: [ "bug" ]

body:
- type: markdown
attributes:
value: |
Before opening an issue, please briefly look through the [open issues](https://github.com/chrrs/scribble/issues)
to see if a similar bug report already exists.

- type: textarea
id: description
validations:
required: true
attributes:
label: Describe the issue
description: |
What's the problem? Describe the bug, what doesn't work, and what did you expect to happen? If you have any log
files, make sure to include them. If a screenshot would help to describe the problem, please include that too!

- type: input
id: minecraftVersion
validations:
required: true
attributes:
label: Minecraft Version
placeholder: ex. "1.20.1"

- type: input
id: modVersion
validations:
required: true
attributes:
label: Scribble Version
description: |
If you're not sure, it will show up by default if the feather icon is hovered in the bottom left of the book
editing screen. Alternatively, the version can be found in a mod menu, or the file name of the downloaded mod.
placeholder: ex. "2.3.4"

- type: dropdown
id: loader
validations:
required: true
attributes:
label: Mod Loader
description: |
If the issue applies to multiple loaders, please select the loader that it was encountered on.
options:
- Fabric / Quilt
- NeoForge
- Forge
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Feature Request
description: Propose a new feature or a change to the mod.
labels: [ "enhancement" ]

body:
- type: markdown
attributes:
value: |
Before opening an issue, please briefly look through the [open issues](https://github.com/chrrs/scribble/issues)
to see if a similar request already exists.

- type: textarea
id: description
validations:
required: true
attributes:
label: Describe the feature / change
description: |
Describe what the new feature or change would be. Please be specific, and motivate your answer, it helps make
requests more understandable!
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Please read CONTRIBUTING.md. AI assisted contributions will _not_ be accepted. -->
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Hi! Thanks for considering contributing to Scribble. Here's some things to keep in mind. For the most part, these are
not hard rules, but suggestions to keep the code manageable.

### LLMs and AI

**Any contributions generated with AI or assisted by AI will not be accepted!** This is inflexible, it's a personal
preference, please respect it.

### Code style

There's not a set list of guidelines to follow here, but try to match the code style to the rest of the code base. This
includes: descriptive variable names, use plenty of whitespace to group related lines together and don't be afraid to
separate out some variables if lines grow too long.

Make sure to use IntelliJ's formatter and import organizer to manage indentation and spacing.

### Reviews

I generally make a lot of comments during PR reviews, please don't take this personally! My end goal is to try and keep
the code base clean and maintainable, as both Minecraft's code base changes in unpredictable ways, and Scribble keeps
growing in features. Keeping the code clean and properly separated helps with this a lot!
14 changes: 11 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,26 @@ architectury.common(stonecutter.tree.branches.mapNotNull {

repositories {
maven("https://maven.shedaniel.me/")
maven("https://maven.isxander.dev/releases")
maven("https://maven.parchmentmc.org")
}

dependencies {
minecraft("com.mojang:minecraft:$minecraft")
mappings(loom.officialMojangMappings())

@Suppress("UnstableApiUsage")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${prop("parchment", "version")}@zip")
})

modImplementation("net.fabricmc:fabric-loader:${prop("fabric", "loaderVersion")}")

modCompileOnly("me.shedaniel.cloth:cloth-config-fabric:${prop("clothconfig", "version")}")
modCompileOnly("dev.isxander:yet-another-config-lib:${prop("yacl", "version")}")
}

loom {
accessWidenerPath = rootProject.file("src/main/resources/aw/${prop("mod", "accesswidener")}.accesswidener")
accessWidenerPath = rootProject.file("src/main/resources/scribble.accesswidener")
}

java {
Expand Down
16 changes: 7 additions & 9 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import me.modmuss50.mpp.ReleaseType
plugins {
id("dev.architectury.loom")
id("architectury-plugin")
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
id("me.modmuss50.mod-publish-plugin")
}

Expand Down Expand Up @@ -44,10 +44,10 @@ dependencies {

fun fabricApiModule(name: String) =
modImplementation(fabricApi.module(name, common.prop("fabric", "apiVersion")))
include(fabricApiModule("fabric-resource-loader-v0")!!)
include(fabricApiModule("fabric-api-base")!!)
include(fabricApiModule("fabric-resource-loader-v1")!!)

modCompileOnly("com.terraformersmc:modmenu:${common.prop("modmenu", "version")}")
modCompileOnly("dev.isxander:debugify:1.21.8+1.0") { isTransitive = false }

commonBundle(project(common.path, "namedElements")) { isTransitive = false }
shadowBundle(project(common.path, "transformProductionFabric")) { isTransitive = false }
Expand All @@ -64,10 +64,8 @@ loom {
}

java {
val java = if (stonecutter.eval(current, ">=1.20.5"))
JavaVersion.VERSION_21 else JavaVersion.VERSION_17
targetCompatibility = java
sourceCompatibility = java
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}

tasks {
Expand Down Expand Up @@ -131,13 +129,13 @@ publishMods {
projectId.set(prop("modrinth", "id"))
accessToken.set(providers.environmentVariable("MODRINTH_TOKEN"))
minecraftVersions.addAll(versions)
optional("cloth-config")
optional("yacl")
}

curseforge {
projectId.set(prop("curseforge", "id"))
accessToken.set(providers.environmentVariable("CURSEFORGE_TOKEN"))
minecraftVersions.addAll(versions)
optional("cloth-config")
optional("yacl")
}
}
10 changes: 0 additions & 10 deletions fabric/src/main/java/me/chrr/scribble/fabric/DebugifyCompat.java

This file was deleted.

11 changes: 7 additions & 4 deletions fabric/src/main/java/me/chrr/scribble/fabric/ModMenuCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import me.chrr.scribble.config.ClothConfigScreenFactory;
import me.chrr.scribble.Scribble;
import net.fabricmc.loader.api.FabricLoader;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

@NullMarked
public class ModMenuCompat implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
return ClothConfigScreenFactory::create;
public @Nullable ConfigScreenFactory<?> getModConfigScreenFactory() {
if (FabricLoader.getInstance().isModLoaded("yet_another_config_lib_v3")) {
return Scribble::buildConfigScreen;
}

return null;
Expand Down
30 changes: 26 additions & 4 deletions fabric/src/main/java/me/chrr/scribble/fabric/ScribbleFabric.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,35 @@
import me.chrr.scribble.Scribble;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import org.jspecify.annotations.NullMarked;

public class ScribbleFabric implements ClientModInitializer {
import java.nio.file.Path;

@NullMarked
public class ScribbleFabric extends Scribble.Platform implements ClientModInitializer {
@Override
public void onInitializeClient() {
Scribble.CONFIG_DIR = FabricLoader.getInstance().getConfigDir();
Scribble.BOOK_DIR = FabricLoader.getInstance().getGameDir().resolve("books");
Scribble.init(this);
}

@Override
protected boolean isModLoaded(String modId) {
return FabricLoader.getInstance().isModLoaded(modId);
}

@Override
protected String getModVersion() {
return FabricLoader.getInstance().getModContainer(Scribble.MOD_ID)
.orElseThrow().getMetadata().getVersion().getFriendlyString();
}

@Override
protected Path getConfigDir() {
return FabricLoader.getInstance().getConfigDir();
}

Scribble.init();
@Override
protected Path getGameDir() {
return FabricLoader.getInstance().getGameDir();
}
}
5 changes: 1 addition & 4 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@
],
"modmenu": [
"me.chrr.scribble.fabric.ModMenuCompat"
],
"debugify": [
"me.chrr.scribble.fabric.DebugifyCompat"
]
},
"depends": {
"minecraft": "${minecraft}",
"fabricloader": ">=0.15",
"fabric-resource-loader-v0": "*"
"fabric-resource-loader-v1": "*"
},
"breaks": {
"fixbookgui": "*"
Expand Down
6 changes: 2 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
org.gradle.jvmargs=-Xmx1G

platform.versions=[versioned]
parchment.version=[versioned]

# Mod details
mod.name=Scribble
mod.version=1.6.7
mod.group=me.chrr

# Name of the accesswidener file used
mod.accesswidener=[versioned]

# Fabric
# check these on https://modmuss50.me/fabric.html
fabric.loaderVersion=[versioned]
Expand All @@ -21,7 +19,7 @@ neoforge.version=[versioned]

# Dependencies
modmenu.version=11.0.2
clothconfig.version=15.0.140
yacl.version=3.8.1+1.21.11-fabric

# Distribution
modrinth.id=yXAvIk0x
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun May 12 20:30:28 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 6 additions & 8 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import me.modmuss50.mpp.ReleaseType
plugins {
id("dev.architectury.loom")
id("architectury-plugin")
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
id("me.modmuss50.mod-publish-plugin")
}

Expand Down Expand Up @@ -56,10 +56,8 @@ loom {
}

java {
val java = if (stonecutter.eval(minecraft, ">=1.20.5"))
JavaVersion.VERSION_21 else JavaVersion.VERSION_17
targetCompatibility = java
sourceCompatibility = java
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}

tasks {
Expand All @@ -69,7 +67,7 @@ tasks {
}

remapJar {
atAccessWideners.add("aw/${common.prop("mod", "accesswidener")}.accesswidener")
atAccessWideners.add("scribble.accesswidener")
inputFile.set(shadowJar.get().archiveFile)
archiveClassifier = null
dependsOn(shadowJar)
Expand Down Expand Up @@ -123,13 +121,13 @@ publishMods {
projectId.set(prop("modrinth", "id"))
accessToken.set(providers.environmentVariable("MODRINTH_TOKEN"))
minecraftVersions.addAll(versions)
optional("cloth-config")
optional("yacl")
}

curseforge {
projectId.set(prop("curseforge", "id"))
accessToken.set(providers.environmentVariable("CURSEFORGE_TOKEN"))
minecraftVersions.addAll(versions)
optional("cloth-config")
optional("yacl")
}
}
Loading