Skip to content

Commit d406cbd

Browse files
Version 1.3.6.1
1 parent e27f30d commit d406cbd

File tree

9 files changed

+49
-10
lines changed

9 files changed

+49
-10
lines changed

changelog/release-1.3.6.1.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Title: Bug Patch
2+
Summary: Minor bug fixes
3+
4+
## Essential Settings
5+
- Added setting to hide cosmetic particles in first person view
6+
7+
## Compatibility
8+
- Fixed crash with KotlinForForge 5.8
9+
- Fixed crash with "Sinytra Connector"
10+
- Fixed compatibility with Iris on 1.21.5 NeoForge

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ minecraftVersion=11202
1010
# TODO remove once upgrading to Loom 1.10
1111
# fabric-api 1.21.5 was built with Loom 1.10, seems to work well enough in dev with our current 1.7 though
1212
loom.ignoreDependencyLoomVersionValidation=true
13-
version=1.3.6
13+
version=1.3.6.1

gui/essential/src/main/kotlin/gg/essential/config/EssentialConfig.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
260260

261261
val playEmoteSoundsInWardrobe = property("Hidden.play_emote_sounds_in_wardrobe", true)
262262

263+
val hideCosmeticParticlesInFirstPerson = property("Cosmetics.General.Hide cosmetic particles in first person", false)
264+
263265
override val migrations = listOf(
264266
Migration { config ->
265267
val overrideGuiScale = config.remove("general.general.gui_scale") as Boolean? ?: return@Migration
@@ -422,6 +424,11 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
422424
description = "Hide your equipped cosmetics for everyone."
423425
}
424426

427+
switch(hideCosmeticParticlesInFirstPerson) {
428+
name = "Hide cosmetic particles in first person"
429+
description = "Hide particle effects coming from your equipped cosmetics in first person."
430+
}
431+
425432
val swapFirstTwo: (Int) -> Int = { if (it in 0..1) (it + 1) % 2 else it }
426433

427434
selector(cosmeticArmorSettingSelfState.bimap(swapFirstTwo, swapFirstTwo)) {

src/main/java/gg/essential/mixins/transformers/feature/particles/Mixin_RenderParticleSystemOfClientWorld.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
package gg.essential.mixins.transformers.feature.particles;
1313

14+
import gg.essential.config.EssentialConfig;
1415
import gg.essential.mixins.ext.client.ParticleSystemHolder;
1516
import gg.essential.model.ParticleSystem;
1617
import gg.essential.model.backend.minecraft.MinecraftRenderBackend;
@@ -217,7 +218,15 @@ public abstract class Mixin_RenderParticleSystemOfClientWorld {
217218
);
218219

219220
boolean isFirstPerson = getPerspective() == 0;
220-
particleSystem.render(stack, cameraPos, cameraRot, particleVertexConsumer, cameraUuid, isFirstPerson);
221+
particleSystem.render(
222+
stack,
223+
cameraPos,
224+
cameraRot,
225+
particleVertexConsumer,
226+
cameraUuid,
227+
isFirstPerson,
228+
EssentialConfig.INSTANCE.getHideCosmeticParticlesInFirstPerson().getUntracked()
229+
);
221230

222231
profiler.endSection();
223232
}

src/main/kotlin/gg/essential/gui/common/UI3DPlayer.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,15 @@ open class UI3DPlayer(
683683

684684
val camera = perspectiveCamera ?: rotationAngleCamera
685685
val cameraPos = camera.camera.rotateBy(realRotation).plus(realPosition)
686-
particleSystem.render(stack, cameraPos, realRotation * camera.rotation, vertexConsumerProvider, UUID(0, 0), false)
686+
particleSystem.render(
687+
stack,
688+
cameraPos,
689+
realRotation * camera.rotation,
690+
vertexConsumerProvider,
691+
UUID(0, 0),
692+
false,
693+
false
694+
)
687695

688696
//#if MC>=12104
689697
//$$ immediate.draw()

src/main/kotlin/gg/essential/model/backend/minecraft/MinecraftRenderBackend.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ object MinecraftRenderBackend : RenderBackend {
102102
}
103103

104104
//#if MC>=12105
105+
//#if FABRIC || FORGE
105106
//$$ private fun RenderPipeline.toBuilder(): RenderPipeline.Builder = RenderPipeline.builder().copyFrom(this)
106107
//$$ private fun RenderPipeline.Builder.copyFrom(pipeline: RenderPipeline): RenderPipeline.Builder = apply {
107108
//$$ withLocation(pipeline.location)
@@ -132,7 +133,8 @@ object MinecraftRenderBackend : RenderBackend {
132133
//$$ withVertexFormat(pipeline.vertexFormat, pipeline.vertexFormatMode)
133134
//$$ withDepthBias(pipeline.depthBiasScaleFactor, pipeline.depthBiasConstant)
134135
//$$ }
135-
//#if FORGE==0
136+
//#endif
137+
//#if FABRIC
136138
//$$ // Note: Cannot pass `program` directly because Iris might not be installed
137139
//$$ private fun RenderPipeline.assignIrisProgram(program: () -> IrisProgram): RenderPipeline = apply {
138140
//$$ if (ModLoaderUtil.isModLoaded("iris")) {
@@ -186,7 +188,7 @@ object MinecraftRenderBackend : RenderBackend {
186188
//$$ private val particleAdditivePipeline = RenderPipelines.TRANSLUCENT_PARTICLE.toBuilder()
187189
//$$ .withBlend(BlendFunction.LIGHTNING)
188190
//$$ .build()
189-
//#if FORGE==0
191+
//#if FABRIC
190192
//$$ .assignIrisProgram { IrisProgram.PARTICLES_TRANSLUCENT }
191193
//#endif
192194
//#endif
@@ -246,7 +248,7 @@ object MinecraftRenderBackend : RenderBackend {
246248
//$$ // have to build it ourselves.
247249
//#if MC>=12105
248250
//$$ private val entityTranslucentCullPipeline = RenderPipelines.ENTITY_TRANSLUCENT.toBuilder().withCull(true).build()
249-
//#if FORGE==0
251+
//#if FABRIC
250252
//$$ .assignIrisProgram { IrisProgram.ENTITIES_TRANSLUCENT }
251253
//#endif
252254
//#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22164f0866
1+
51d1cdc4b3

subprojects/cosmetics/src/commonMain/kotlin/gg/essential/model/ParticleSystem.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class ParticleSystem(
248248
particleVertexConsumerProvider: VertexConsumerProvider,
249249
cameraUuid: UUID,
250250
cameraFirstPerson: Boolean,
251+
hideParticlesInFirstPerson: Boolean,
251252
) {
252253
val cameraFacing = vec3(0f, 0f, -1f).rotateBy(cameraRot)
253254
for ((renderPass, particles) in billboardRenderPasses.entries.sortedBy { it.key.material.needsSorting }) {
@@ -260,12 +261,12 @@ class ParticleSystem(
260261
particle.distance = cameraPos.minus(particle.billboardPosition).dot(billboardNormal)
261262
}
262263
for (particle in particles.sortedByDescending { it.distance }) {
263-
particle.renderBillboard(matrixStack, vertexConsumer, cameraFacing, cameraUuid, cameraFirstPerson)
264+
particle.renderBillboard(matrixStack, vertexConsumer, cameraFacing, cameraUuid, cameraFirstPerson, hideParticlesInFirstPerson)
264265
}
265266
} else {
266267
for (particle in particles) {
267268
particle.prepareBillboard(cameraPos, cameraRot)
268-
particle.renderBillboard(matrixStack, vertexConsumer, cameraFacing, cameraUuid, cameraFirstPerson)
269+
particle.renderBillboard(matrixStack, vertexConsumer, cameraFacing, cameraUuid, cameraFirstPerson, hideParticlesInFirstPerson)
269270
}
270271
}
271272
}
@@ -981,9 +982,11 @@ class ParticleSystem(
981982
cameraFacing: Vec3,
982983
cameraUuid: UUID,
983984
cameraFirstPerson: Boolean,
985+
hideParticlesInFirstPerson: Boolean,
984986
) {
985987
// Abide by the particle effect visibility component for the current player.
986988
if (cameraUuid == emitter.sourceEntity.uuid) {
989+
if (cameraFirstPerson && hideParticlesInFirstPerson) return
987990
if (!components.particleVisibility.let { if (cameraFirstPerson) it.firstPerson else it.thirdPerson }) return
988991
}
989992

0 commit comments

Comments
 (0)