mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-15 11:25:11 +01:00
Puzzle 2.0.0 - Multiplatform & Cleaner code
- Removed intrusive branding (previously visible on Title screen and F3 menu) - De-modularized: Previously, Puzzle was split into multiple modules which complicated the development process and was just unnecessary - Experimental NeoForge support - Many small improvements - puzzle-splashscreen: Improved background image blending - puzzle-splashscreen: Added support for custom blend functions for full OptiFine parity
This commit is contained in:
103
fabric/build.gradle
Normal file
103
fabric/build.gradle
Normal file
@@ -0,0 +1,103 @@
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
id "me.shedaniel.unified-publishing"
|
||||
}
|
||||
repositories {
|
||||
maven { url "https://maven.terraformersmc.com/releases" }
|
||||
}
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
fabric()
|
||||
}
|
||||
|
||||
configurations {
|
||||
common
|
||||
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentFabric.extendsFrom common
|
||||
archivesBaseName = rootProject.archives_base_name + "-fabric"
|
||||
version = rootProject.mod_version + "+" + rootProject.minecraft_version
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||
modImplementation include ("maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric")
|
||||
|
||||
modImplementation ("com.terraformersmc:modmenu:${project.modmenu_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", rootProject.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": rootProject.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude "architectury.common.json"
|
||||
|
||||
configurations = [project.configurations.shadowCommon]
|
||||
archiveClassifier = "dev-shadow"
|
||||
}
|
||||
|
||||
remapJar {
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
|
||||
components.java {
|
||||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
}
|
||||
|
||||
unifiedPublishing {
|
||||
project {
|
||||
displayName = "Puzzle $rootProject.version - Fabric $project.minecraft_version"
|
||||
releaseType = "$project.release_type"
|
||||
changelog = releaseChangelog()
|
||||
gameVersions = []
|
||||
gameLoaders = ["fabric","quilt"]
|
||||
mainPublication remapJar
|
||||
relations {
|
||||
depends {
|
||||
curseforge = "fabric-api"
|
||||
modrinth = "fabric-api"
|
||||
}
|
||||
}
|
||||
|
||||
var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN")
|
||||
if (CURSEFORGE_TOKEN != null) {
|
||||
curseforge {
|
||||
token = CURSEFORGE_TOKEN
|
||||
id = rootProject.curseforge_id
|
||||
gameVersions.addAll "Java 21", project.minecraft_version, project.supported_versions
|
||||
}
|
||||
}
|
||||
|
||||
var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN")
|
||||
if (MODRINTH_TOKEN != null) {
|
||||
modrinth {
|
||||
token = MODRINTH_TOKEN
|
||||
id = rootProject.modrinth_id
|
||||
version = "$rootProject.version-$project.name"
|
||||
gameVersions.addAll project.minecraft_version, project.supported_versions
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
fabric/src/main/java/net/puzzlemc/fabric/PuzzleFabric.java
Normal file
28
fabric/src/main/java/net/puzzlemc/fabric/PuzzleFabric.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package net.puzzlemc.fabric;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
||||
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
|
||||
import net.minecraft.resource.ResourceManager;
|
||||
import net.minecraft.resource.ResourceType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.puzzlemc.core.PuzzleCore;
|
||||
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
|
||||
|
||||
public class PuzzleFabric implements ClientModInitializer {
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
PuzzleCore.initModules();
|
||||
|
||||
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() {
|
||||
@Override
|
||||
public Identifier getFabricId() {
|
||||
return Identifier.of("puzzle", "splash_screen");
|
||||
}
|
||||
@Override
|
||||
public void reload(ResourceManager manager) {
|
||||
PuzzleSplashScreen.ReloadListener.INSTANCE.reload(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package net.puzzlemc.fabric.modmenu;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||
|
||||
public class ModMenuIntegration implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return PuzzleOptionsScreen::new;
|
||||
}
|
||||
}
|
||||
42
fabric/src/main/resources/fabric.mod.json
Executable file
42
fabric/src/main/resources/fabric.mod.json
Executable file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "puzzle",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "Puzzle",
|
||||
"description": "Improved resourcepack capabilities.",
|
||||
"authors": [
|
||||
"PuzzleMC",
|
||||
"Motschen"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://www.midnightdust.eu/",
|
||||
"sources": "https://github.com/TeamMidnightDust/Puzzle",
|
||||
"issues": "https://github.com/TeamMidnightDust/Puzzle/issues"
|
||||
},
|
||||
|
||||
"license": "MIT",
|
||||
"icon": "assets/puzzle/icon.png",
|
||||
|
||||
"environment": "client",
|
||||
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"net.puzzlemc.fabric.PuzzleFabric"
|
||||
],
|
||||
"modmenu": [
|
||||
"net.puzzlemc.fabric.modmenu.ModMenuIntegration"
|
||||
]
|
||||
},
|
||||
|
||||
"mixins": [
|
||||
"puzzle-gui.mixins.json",
|
||||
"puzzle-models.mixins.json",
|
||||
"puzzle-splashscreen.mixins.json"
|
||||
],
|
||||
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"minecraft": ">=1.21"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user