Skip to content

Commit a6ff6e2

Browse files
authored
Merge pull request #19 from box3lab/dev_coolfish
chore(build): 移除Gradle构建配置文件并更新文档
2 parents ac909f6 + acd8279 commit a6ff6e2

7,377 files changed

Lines changed: 36776 additions & 26 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: build
77
on: [pull_request, push]
88

99
jobs:
10-
build:
10+
build-fabric-1-21-1:
1111
runs-on: ubuntu-24.04
1212
steps:
1313
- name: checkout repository
@@ -17,14 +17,44 @@ jobs:
1717
- name: setup jdk
1818
uses: actions/setup-java@v4
1919
with:
20-
java-version: '25'
21-
distribution: 'microsoft'
20+
java-version: "25"
21+
distribution: "microsoft"
2222
- name: make gradle wrapper executable
23+
working-directory: ./Fabric-1.21.1
2324
run: chmod +x ./gradlew
24-
- name: build
25+
26+
- name: build Fabric 1.21.1
27+
working-directory: ./Fabric-1.21.1
2528
run: ./gradlew build
26-
- name: capture build artifacts
29+
30+
- name: upload artifacts Fabric 1.21.1
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: Fabric-1.21.1-artifacts
34+
path: Fabric-1.21.1/build/libs/
35+
36+
build-fabric-1-21-11:
37+
runs-on: ubuntu-24.04
38+
steps:
39+
- name: checkout repository
40+
uses: actions/checkout@v4
41+
- name: validate gradle wrapper
42+
uses: gradle/actions/wrapper-validation@v4
43+
- name: setup jdk
44+
uses: actions/setup-java@v4
45+
with:
46+
java-version: "25"
47+
distribution: "microsoft"
48+
- name: make gradle wrapper executable
49+
working-directory: ./Fabric-1.21.11
50+
run: chmod +x ./gradlew
51+
52+
- name: build Fabric 1.21.11
53+
working-directory: ./Fabric-1.21.11
54+
run: ./gradlew build
55+
56+
- name: upload artifacts Fabric 1.21.11
2757
uses: actions/upload-artifact@v4
2858
with:
29-
name: Artifacts
30-
path: build/libs/
59+
name: Fabric-1.21.11-artifacts
60+
path: Fabric-1.21.11/build/libs/

Fabric-1.21.1/build.gradle

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
plugins {
2+
id 'net.fabricmc.fabric-loom-remap' version "${loom_version}"
3+
id 'maven-publish'
4+
}
5+
6+
version = project.mod_version
7+
group = project.maven_group
8+
9+
base {
10+
archivesName = project.archives_base_name
11+
}
12+
13+
repositories {
14+
// Add repositories to retrieve artifacts from in here.
15+
// You should only use this when depending on other mods because
16+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18+
// for more information about repositories.
19+
}
20+
21+
loom {
22+
splitEnvironmentSourceSets()
23+
24+
mods {
25+
"box3" {
26+
sourceSet sourceSets.main
27+
sourceSet sourceSets.client
28+
}
29+
}
30+
31+
}
32+
33+
dependencies {
34+
// To change the versions see the gradle.properties file
35+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
36+
mappings loom.officialMojangMappings()
37+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
38+
39+
// Fabric API. This is technically optional, but you probably want it anyway.
40+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
41+
42+
}
43+
44+
processResources {
45+
inputs.property "version", project.version
46+
47+
filesMatching("fabric.mod.json") {
48+
expand "version": inputs.properties.version
49+
}
50+
}
51+
52+
tasks.withType(JavaCompile).configureEach {
53+
it.options.release = 21
54+
}
55+
56+
java {
57+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
58+
// if it is present.
59+
// If you remove this line, sources will not be generated.
60+
withSourcesJar()
61+
62+
sourceCompatibility = JavaVersion.VERSION_21
63+
targetCompatibility = JavaVersion.VERSION_21
64+
}
65+
66+
jar {
67+
inputs.property "archivesName", project.base.archivesName
68+
69+
from("LICENSE") {
70+
rename { "${it}_${inputs.properties.archivesName}"}
71+
}
72+
}
73+
74+
// configure the maven publication
75+
publishing {
76+
publications {
77+
create("mavenJava", MavenPublication) {
78+
artifactId = project.archives_base_name
79+
from components.java
80+
}
81+
}
82+
83+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
84+
repositories {
85+
// Add repositories to publish to here.
86+
// Notice: This block does NOT have the same function as the block in the top level.
87+
// The repositories here will be used for publishing your artifact, not for
88+
// retrieving dependencies.
89+
}
90+
}

Fabric-1.21.1/gradle.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx1G
3+
org.gradle.parallel=true
4+
5+
# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
6+
org.gradle.configuration-cache=false
7+
8+
# Fabric Properties
9+
# check these on https://fabricmc.net/develop
10+
minecraft_version=1.21.1
11+
loader_version=0.18.4
12+
loom_version=1.15-SNAPSHOT
13+
14+
# Mod Properties
15+
mod_version=1.4.0-mc1.21.1
16+
maven_group=com.box3lab
17+
archives_base_name=box3
18+
19+
# Dependencies
20+
fabric_api_version=0.116.8+1.21.1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.box3lab;
2+
3+
import com.box3lab.register.ModBlocks;
4+
import com.box3lab.util.BlockIndexUtil;
5+
6+
import net.fabricmc.api.ClientModInitializer;
7+
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
8+
import net.minecraft.client.renderer.RenderType;
9+
import net.minecraft.world.level.block.Block;
10+
11+
public class Box3Client implements ClientModInitializer {
12+
@Override
13+
public void onInitializeClient() {
14+
15+
for (var entry : ModBlocks.BLOCKS.entrySet()) {
16+
String registryName = entry.getKey();
17+
Block block = entry.getValue();
18+
19+
Integer id = BlockIndexUtil.getIdByName(registryName);
20+
if (id != null && !BlockIndexUtil.isSolid(id)) {
21+
BlockRenderLayerMap.INSTANCE.putBlock(block, RenderType.translucent());
22+
}
23+
}
24+
25+
}
26+
}

src/client/java/com/box3lab/mixin/client/ExampleClientMixin.java renamed to Fabric-1.21.1/src/client/java/com/box3lab/mixin/client/ExampleClientMixin.java

File renamed without changes.

0 commit comments

Comments
 (0)