From b3e982628e1919dc2c07a62de3c7ebedbee80dd5 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Tue, 1 Oct 2024 14:16:17 +0200 Subject: [PATCH] spawn ash particles when a vampire player is under the sun without sunscreen --- .../vampirism/entity/player/vampire/VampirePlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java index 148e21659..642a45aa2 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java +++ b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java @@ -48,6 +48,7 @@ import de.teamlapen.vampirism.modcompat.PlayerReviveHelper; import de.teamlapen.vampirism.network.ServerboundSimpleInputEvent; import de.teamlapen.vampirism.particle.FlyingBloodEntityParticleOptions; +import de.teamlapen.vampirism.particle.GenericParticleOptions; import de.teamlapen.vampirism.util.*; import de.teamlapen.vampirism.world.MinionWorldData; import de.teamlapen.vampirism.world.ModDamageSources; @@ -876,6 +877,13 @@ public void onUpdatePlayer(PlayerTickEvent event) { this.bloodStats.onUpdate(); player.level().getProfiler().pop(); } + + if (event.getEntity().level().isClientSide && getTicksInSun() > 0 && !event.getEntity().hasEffect(ModEffects.SUNSCREEN)) { + int i = event.getEntity().isInvisible() ? 15 : 4; + if (event.getEntity().getRandom().nextInt(i) == 0) { + event.getEntity().level().addParticle(new GenericParticleOptions(VResourceLocation.mc("drip_hang"),20,9145227, 0.2f), event.getEntity().getRandomX(0.5), event.getEntity().getRandomY(), event.getEntity().getRandomZ(0.5), 0, -3, 0); + } + } } }