From 92d4988dac617e7db1e588c49c6b3367e10fe6bb Mon Sep 17 00:00:00 2001 From: jcomcl Date: Fri, 1 Nov 2024 12:21:23 +0000 Subject: [PATCH 1/2] make the access token conditional so you can still build the mod without it --- build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1ea2c5d..94b64d9 100644 --- a/build.gradle +++ b/build.gradle @@ -101,7 +101,9 @@ publishMods { modLoaders.add("fabric") modrinth { - accessToken = providers.gradleProperty("modrinth_token").get() + if (providers.gradleProperty("modrinth_token").isPresent()) { + accessToken = providers.gradleProperty("modrinth_token").get() + } projectId = "B1CcCd9h" minecraftVersionRange { start = "1.20" @@ -112,4 +114,4 @@ publishMods { requires("sushi-bar") optional("modmenu") } -} \ No newline at end of file +} From 7cc4b2524b6b24741628ea773bada3f7cb631eb1 Mon Sep 17 00:00:00 2001 From: jcomcl Date: Fri, 1 Nov 2024 12:23:22 +0000 Subject: [PATCH 2/2] handle NoSuchElementException when getting velocity for the splash effect and use a fallback default value. This occurs with the Supplimentaries slingshot and probably some other places too. --- .../com/chailotl/particular/mixin/InjectEntity.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chailotl/particular/mixin/InjectEntity.java b/src/main/java/com/chailotl/particular/mixin/InjectEntity.java index 6f9c251..2335b9d 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectEntity.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectEntity.java @@ -24,6 +24,8 @@ import java.util.LinkedList; import java.util.Queue; +import java.util.NoSuchElementException; + @Mixin(Entity.class) public abstract class InjectEntity { @@ -86,7 +88,14 @@ private void waterParticles(CallbackInfo ci) if (!foundSurface) { return; } + double splashVelocity; + try { + splashVelocity = Collections.max(velocities); + } catch (NoSuchElementException e) { + splashVelocity = 0.1; + } + // 3D splash - getWorld().addParticle(Particles.WATER_SPLASH_EMITTER, getX(), baseY + prevState.getHeight(), getZ(), dimensions.width, Collections.max(velocities), 0.0); + getWorld().addParticle(Particles.WATER_SPLASH_EMITTER, getX(), baseY + prevState.getHeight(), getZ(), dimensions.width, splashVelocity, 0.0); } -} \ No newline at end of file +}