Files
src
build.gradle
gradle.properties
LICENSE
README.md
settings.gradle
Code
13 288
src/client/java/dev/aetheris/client/AetherisClient.java
package dev.aetheris.client;
import dev.aetheris.AetherisMod;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
public final class AetherisClient implements ClientModInitializer {
private static long tickCounter = 0L;
@Override
public void onInitializeClient() {
ClientTickEvents.END_CLIENT_TICK.register(AetherisClient::spawnRelicAura);
}
private static void spawnRelicAura(MinecraftClient client) {
if (client.world == null) return;
tickCounter++;
// Har doosre tick par particles: visual effect halka rahe aur low-end PCs par load kam ho.
if ((tickCounter & 1L) != 0L) return;
for (PlayerEntity player : client.world.getPlayers()) {
boolean holdingRelic =
player.getStackInHand(Hand.MAIN_HAND).isOf(AetherisMod.AETHERIS_RELIC)
|| player.getStackInHand(Hand.OFF_HAND).isOf(AetherisMod.AETHERIS_RELIC);
if (!holdingRelic) continue;
double phase = (tickCounter * 0.16) + player.getId() * 0.37;
double radius = 0.48;
double x = player.getX() + MathHelper.cos((float) phase) * radius;
double z = player.getZ() + MathHelper.sin((float) phase) * radius;
double y = player.getY() + 0.75 + 0.35 * MathHelper.sin((float) (phase * 1.7));
client.world.addParticleClient(ParticleTypes.SOUL_FIRE_FLAME,
x, y, z, 0.0, 0.025, 0.0);
double opposite = phase + Math.PI;
client.world.addParticleClient(ParticleTypes.ELECTRIC_SPARK,
player.getX() + Math.cos(opposite) * radius,
player.getY() + 1.15 + 0.18 * Math.sin(phase),
player.getZ() + Math.sin(opposite) * radius,
0.0, 0.015, 0.0);
// Chhote end-rod sparkles se relic ko celestial look milta hai.
if ((tickCounter % 8L) == 0L) {
client.world.addParticleClient(ParticleTypes.END_ROD,
player.getX() + (player.getRandom().nextDouble() - 0.5) * 0.7,
player.getY() + 1.0 + player.getRandom().nextDouble() * 0.8,
player.getZ() + (player.getRandom().nextDouble() - 0.5) * 0.7,
0.0, 0.025, 0.0);
}
}
}
}