Skip to content

Commit 7dbca4c

Browse files
1.21.5
1 parent ae90bfe commit 7dbca4c

File tree

17 files changed

+260
-284
lines changed

17 files changed

+260
-284
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
fetch-tags: true
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Make Gradle wrapper executable
22+
run: chmod +x ./gradlew
23+
24+
- name: Build
25+
run: ./gradlew build
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: Artifacts
30+
path: |
31+
neoforge/build/libs/
32+
fabric/build/libs/
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release All
1+
name: Publish
22
on: [workflow_dispatch]
33

44
permissions:
@@ -9,20 +9,22 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout Repository
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@v3
13+
with:
14+
submodules: true
1315

1416
- name: Setup JDK 21
15-
uses: actions/setup-java@v5
17+
uses: actions/setup-java@v4
1618
with:
1719
java-version: '21'
18-
distribution: temurin
19-
cache: gradle
20+
distribution: 'temurin'
2021

21-
- name: Make Gradle wrapper executable
22+
- name: Make Gradle Wrapper Executable
23+
if: ${{ runner.os != 'Windows' }}
2224
run: chmod +x ./gradlew
2325

24-
- name: Build & Release
26+
- name: Publish
2527
env:
2628
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
2729
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
28-
run: ./gradlew build :neoforge:publishMods :fabric:publishMods
30+
run: ./gradlew publishMods

.github/workflows/release-fabric-quilt.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release-neoforge.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 MarbleGate
3+
Copyright (c) 2025 MarbleGate
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.gradle

Lines changed: 86 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
11
plugins {
2-
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
4-
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
5-
id "me.modmuss50.mod-publish-plugin" version "0.7.4"
2+
id 'dev.architectury.loom' version '1.11-SNAPSHOT' apply false
3+
id 'architectury-plugin' version '3.4-SNAPSHOT'
4+
id 'com.gradleup.shadow' version '8.3.6' apply false
5+
id "me.modmuss50.mod-publish-plugin" version "0.8.4"
66
}
77

88
architectury {
9-
minecraft = rootProject.minecraft_version
9+
minecraft = project.minecraft_version
1010
}
1111

1212
allprojects {
13-
14-
15-
version = rootProject.mod_version
1613
group = rootProject.maven_group
14+
version = rootProject.mod_version
1715
}
1816

1917
subprojects {
20-
apply plugin: "dev.architectury.loom"
21-
apply plugin: "architectury-plugin"
22-
apply plugin: "maven-publish"
18+
apply plugin: 'dev.architectury.loom'
19+
apply plugin: 'architectury-plugin'
20+
apply plugin: 'maven-publish'
2321

2422
base {
2523
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
26-
archivesName = "$rootProject.name-$project.name"
24+
archivesName = "$rootProject.archives_name-$project.name"
25+
}
26+
27+
repositories {
28+
// Add repositories to retrieve artifacts from in here.
29+
// You should only use this when depending on other mods because
30+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
31+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
32+
// for more information about repositories.
2733
}
2834

2935
dependencies {
30-
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
36+
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
3137
mappings loom.layered {
3238
it.mappings("net.fabricmc:yarn:$rootProject.yarn_mappings:v2")
3339
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$rootProject.yarn_mappings_patch_neoforge_version")
3440
}
3541
}
3642

37-
tasks.withType(JavaCompile) {
38-
options.encoding = "UTF-8"
39-
options.release = 21
40-
}
41-
4243
java {
4344
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
4445
// if it is present.
@@ -48,5 +49,71 @@ subprojects {
4849
sourceCompatibility = JavaVersion.VERSION_21
4950
targetCompatibility = JavaVersion.VERSION_21
5051
}
51-
}
5252

53+
tasks.withType(JavaCompile).configureEach {
54+
it.options.release = 21
55+
}
56+
57+
// Configure Maven publishing.
58+
publishing {
59+
publications {
60+
mavenJava(MavenPublication) {
61+
artifactId = base.archivesName.get()
62+
from components.java
63+
}
64+
}
65+
66+
repositories {
67+
// Add repositories to publish to here.
68+
// Notice: This block does NOT have the same function as the block in the top level.
69+
// The repositories here will be used for publishing your artifact, not for
70+
// retrieving dependencies.
71+
}
72+
}
73+
74+
publishMods {
75+
changelog = rootProject.file("CHANGELOG.md").text
76+
version = mod_version
77+
type = STABLE
78+
79+
def CFOption = curseforgeOptions {
80+
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
81+
projectId = "564244"
82+
minecraftVersions.add(minecraft_version)
83+
}
84+
85+
def MROption = modrinthOptions {
86+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
87+
projectId = "ELrdP6OH"
88+
minecraftVersions.add(minecraft_version)
89+
}
90+
91+
curseforge("CFFabric") {
92+
from CFOption
93+
file project(":fabric")
94+
modLoaders.add("fabric")
95+
displayName = "[Fabric] Splash Milk ${mod_version} for ${minecraft_version}"
96+
}
97+
98+
curseforge("CFNeoForge") {
99+
from CFOption
100+
file project(":neoforge")
101+
displayName = "[NeoForge] Splash Milk ${mod_version} for ${minecraft_version}"
102+
modLoaders.add("neoforge")
103+
}
104+
105+
modrinth("MRFabric") {
106+
from MROption
107+
file project(":fabric")
108+
displayName = "[Fabric] Splash Milk ${mod_version} for ${minecraft_version}"
109+
modLoaders.add("fabric")
110+
}
111+
112+
modrinth("MRNeoForge") {
113+
from MROption
114+
file project(":neoforge")
115+
displayName = "[NeoForge] Splash Milk ${mod_version} for ${minecraft_version}"
116+
modLoaders.add("neoforge")
117+
}
118+
}
119+
}

common/build.gradle

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
architectury {
2-
common("fabric", "neoforge")
3-
}
4-
5-
loom {
6-
accessWidenerPath = file("src/main/resources/splash_milk.accesswidener")
2+
common rootProject.enabled_platforms.split(',')
73
}
84

95
dependencies {
10-
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
11-
// Do NOT use other classes from fabric loader
12-
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
13-
// Remove the next line if you don't want to depend on the API
14-
//modApi "dev.architectury:architectury:${rootProject.architectury_version}"
15-
}
16-
17-
publishing {
18-
publications {
19-
mavenCommon(MavenPublication) {
20-
artifactId = rootProject.archives_base_name
21-
from components.java
22-
}
23-
}
6+
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
7+
// which get remapped to the correct annotations on each platform.
8+
// Do NOT use other classes from Fabric Loader.
9+
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"
2410

25-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
26-
repositories {
27-
// Add repositories to publish to here.
28-
}
11+
// Architectury API. This is optional, and you can comment it out if you don't need it.
12+
// modImplementation "dev.architectury:architectury:$rootProject.architectury_api_version"
2913
}

common/src/main/java/plus/dragons/splashmilk/entity/MIlkAreaEffectCloudEntity.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
1010
import net.minecraft.nbt.NbtCompound;
1111
import net.minecraft.server.world.ServerWorld;
12+
import net.minecraft.util.Uuids;
1213
import net.minecraft.util.math.MathHelper;
1314
import net.minecraft.world.World;
1415
import org.jetbrains.annotations.Nullable;
@@ -139,7 +140,7 @@ private void generateParticle(float radius) {
139140
float f2 = MathHelper.sqrt(random.nextFloat()) * 0.2F;
140141
float f3 = MathHelper.cos(f1) * f2;
141142
float f4 = MathHelper.sin(f1) * f2;
142-
getWorld().addImportantParticle(PlatformUtil.getMilkCloudParticle().get(), getX() + (double) f3, getY(), getZ() + (double) f4, 0.98, 0.99, 1);
143+
getWorld().addImportantParticleClient(PlatformUtil.getMilkCloudParticle().get(), getX() + (double) f3, getY(), getZ() + (double) f4, 0.98, 0.99, 1);
143144
}
144145
}
145146
} else {
@@ -149,7 +150,7 @@ private void generateParticle(float radius) {
149150
float f7 = MathHelper.sqrt(random.nextFloat()) * radius;
150151
float f8 = MathHelper.cos(f6) * f7;
151152
float f9 = MathHelper.sin(f6) * f7;
152-
getWorld().addImportantParticle(PlatformUtil.getMilkCloudParticle().get(), getX() + (double) f8, getY(), getZ() + (double) f9, 0.98, 0.99, 1);
153+
getWorld().addImportantParticleClient(PlatformUtil.getMilkCloudParticle().get(), getX() + (double) f8, getY(), getZ() + (double) f9, 0.98, 0.99, 1);
153154
}
154155
}
155156
}
@@ -189,17 +190,15 @@ private void findEntityAndApply(float radius) {
189190

190191
@Override
191192
protected void readCustomDataFromNbt(NbtCompound nbt) {
192-
age = nbt.getInt("Age");
193-
duration = nbt.getInt("Duration");
194-
waitTime = nbt.getInt("WaitTime");
195-
reapplicationDelay = nbt.getInt("ReapplicationDelay");
196-
durationOnUse = nbt.getInt("DurationOnUse");
197-
radiusOnUse = nbt.getFloat("RadiusOnUse");
198-
radiusPerTick = nbt.getFloat("RadiusPerTick");
199-
setRadius(nbt.getFloat("Radius"));
200-
if (nbt.containsUuid("Owner")) {
201-
ownerUUID = nbt.getUuid("Owner");
202-
}
193+
age = nbt.getInt("Age",0);
194+
duration = nbt.getInt("Duration",-1);
195+
waitTime = nbt.getInt("WaitTime",20);
196+
reapplicationDelay = nbt.getInt("ReapplicationDelay",20);
197+
durationOnUse = nbt.getInt("DurationOnUse",0);
198+
radiusOnUse = nbt.getFloat("RadiusOnUse",0);
199+
radiusPerTick = nbt.getFloat("RadiusPerTick",0);
200+
setRadius(nbt.getFloat("Radius",3.0F));
201+
ownerUUID = nbt.get("Owner", Uuids.INT_STREAM_CODEC).orElse(null);
203202
}
204203

205204
@Override
@@ -212,9 +211,7 @@ protected void writeCustomDataToNbt(NbtCompound nbt) {
212211
nbt.putFloat("RadiusOnUse", radiusOnUse);
213212
nbt.putFloat("RadiusPerTick", radiusPerTick);
214213
nbt.putFloat("Radius", getRadius());
215-
if (ownerUUID != null) {
216-
nbt.putUuid("Owner", ownerUUID);
217-
}
214+
nbt.putNullable("Owner", Uuids.INT_STREAM_CODEC, ownerUUID);
218215
}
219216

220217
public void setRadiusOnUse(float radiusOnUse) {

0 commit comments

Comments
 (0)