Skip to content

Commit

Permalink
Initial port to fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
sashafiesta committed Apr 18, 2024
1 parent d829955 commit 274a194
Show file tree
Hide file tree
Showing 411 changed files with 28,419 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build
on: [ pull_request, push ]

jobs:
build:
strategy:
matrix:
java: [ 17 ]
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

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

- name: build
run: ./gradlew build

- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
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/
61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,59 @@
# create-connected-fabric
Unofficial Fabric port of Create: Connected by Lysine
## Create: Connected [FABRIC]

This is an **UNOFFICIAL** port of [Create: Connected by Lysine](https://github.com/hlysine/create_connected) to Fabric
It's experimental and may damage your saves, you have been warned.

Port status:

```
+=========================+=========================================================+
| Feature | Status |
+=========================+=========================================================+
| Kinetic Blocks | Implemented |
+-------------------------+---------------------------------------------------------+
| Copycats | Not planned |
+-------------------------+---------------------------------------------------------+
| Item Silo | Not planned |
+-------------------------+---------------------------------------------------------+
| Contraption Behaviors | Not planned |
+-------------------------+---------------------------------------------------------+
| Music Disks | Not planned |
+-------------------------+---------------------------------------------------------+
| Control Chip | Not planned |
+-------------------------+---------------------------------------------------------+
|Sequenced Pulse Generator| Implemented, recipe changed |
+-------------------------+---------------------------------------------------------+
| Linked Transmitter | Implemented, rendering bug exists |
+-------------------------+---------------------------------------------------------+
|S. Gearshift instructions| Not implemented |
+-------------------------+---------------------------------------------------------+
| Nested schematics | Not implemented |
+-------------------------+---------------------------------------------------------+
|Configs and FeatureToggle| Not planned |
+-------------------------+---------------------------------------------------------+
| Mod compat | Not planned |
+-------------------------+---------------------------------------------------------+
| Datagen | Not planned |
+-------------------------+---------------------------------------------------------+
| Advancements | Not planned |
+-------------------------+---------------------------------------------------------+
| Ponders and recipes | Implemented |
+-------------------------+---------------------------------------------------------+
| Cosmetic blocks | Not planned |
+-------------------------+---------------------------------------------------------+
| Fan Catalysts | Implemented |
+-------------------------+---------------------------------------------------------+
|Manual Appl. Rec. Changes| Not implemented |
+-------------------------+---------------------------------------------------------+
| Tags | Implemented |
+=========================+=========================================================+
```
Usage:
The conditions are the same as for original mod

But I personally wouldn't recommend using ported version for modpack.


Contributing:
Feel free to help me porting the mod! Even if this feature is not planned!
133 changes: 133 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
//file:noinspection GradlePackageVersionRange
plugins {
id "fabric-loom" version "1.0.+"
id "io.github.juuxel.loom-quiltflower" version "1.10.0" // Quiltflower, a better decompiler
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
id "maven-publish"
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
group = project.maven_group

// Formats the mod version to include the Minecraft version and build number (if present)
// example: 1.0.0+1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}+${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")

repositories {
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Forge Tags, Milk Lib, Registrate
maven { url = "https://mvn.devos.one/releases" } // Porting Lib
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
}

dependencies {
// Setup
minecraft("com.mojang:minecraft:${minecraft_version}")
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")

// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")

// Create - dependencies are added transitively
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")

// Development QOL
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")

// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
// See root gradle.properties to choose which to use at runtime.
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
case "jei": modLocalRuntime("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"); break
case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"); break
case "emi": modLocalRuntime("dev.emi:emi:${emi_version}"); break
case "disabled": break
default: println("Unknown recipe viewer specified: ${recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
}

include modApi("teamreborn:energy:${energy_version}") {
transitive = false
}

// if you would like to add integration with them, uncomment them here.
// modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_fabric_version}")
// modCompileOnly("mezz.jei:jei-${minecraft_version}-common:${jei_fabric_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}")
// modCompileOnly("dev.emi:emi:${emi_version}")
}

processResources {
// require dependencies to be the version compiled against or newer
Map<String, String> properties = new HashMap<>()
properties.put("version", version)
properties.put("fabric_loader_version", fabric_loader_version)
properties.put("fabric_api_version", fabric_api_version)
properties.put("create_version", create_version)
properties.put("minecraft_version", minecraft_version)

properties.forEach((k, v) -> inputs.property(k, v))

filesMatching("fabric.mod.json") {
expand properties
}
}

machete {
// disable machete locally for faster builds
enabled = buildNumber != null
}

tasks.withType(JavaCompile).configureEach {
it.options.release = Integer.parseInt(sourceCompatibility)
}

java {
withSourcesJar()
}

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

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

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}

loom {
accessWidenerPath = file("src/main/resources/create_connected.accesswidener")
}

}
42 changes: 42 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
org.gradle.jvmargs=-Xmx2G

# Mod Info
maven_group = com.hlysine
archives_base_name = create_connected
mod_version = 0.7.4-mc1.20.1

minecraft_version = 1.20.1

# Dependencies
# https://fabricmc.net/develop
fabric_loader_version = 0.15.7
fabric_api_version = 0.92.0+1.20.1

# Mappings
# https://lambdaurora.dev/tools/import_quilt.html
qm_version = 23
# https://parchmentmc.org/docs/getting-started
parchment_version = 2023.09.03

# Create
# https://modrinth.com/mod/create-fabric/versions
create_version = 0.5.1-f-build.1335+mc1.20.1

# Development QOL
# Create supports all 3 recipe viewers: JEI, REI, and EMI. This decides which is enabled at runtime.
# set to disabled to have none of them.
recipe_viewer = jei
# JEI - https://www.curseforge.com/minecraft/mc-mods/jei/files/all
jei_version = 15.3.0.1
# REI - https://modrinth.com/mod/roughly-enough-items/versions
rei_version = 9.1.580
# EMI - https://modrinth.com/mod/emi/versions
emi_version = 0.6.1+1.19.2

# Mod Menu - https://modrinth.com/mod/modmenu/versions
modmenu_version = 7.1.0
# LazyDFU - https://modrinth.com/mod/lazydfu/versions
lazydfu_version = 0.1.3

# TeamReborn Energy - https://maven.fabricmc.net/teamreborn/energy/
energy_version = 3.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-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 274a194

Please sign in to comment.