Skip to content

Commit

Permalink
Blue particle
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Sep 19, 2024
1 parent ac39f93 commit b62054b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
17 changes: 17 additions & 0 deletions fabric/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ziyue.tjmetro.mapping;

/**
* @author ZiYueCommentary
* @since 1.0.0-beta-2
*/

public class DustParticleEffect
{
#if MC_VERSION >= "11904"
public static final net.minecraft.particle.DustParticleEffect BLUE = new net.minecraft.particle.DustParticleEffect(net.minecraft.util.math.Vec3d.unpackRgb(3336430).toVector3f(), 1.0F); // 50, 232, 238
#elif MC_VERSION >= "11701"
public static final net.minecraft.particle.DustParticleEffect BLUE = new net.minecraft.particle.DustParticleEffect(new net.minecraft.util.math.Vec3f(net.minecraft.util.math.Vec3d.unpackRgb(3336430)), 1.0F);
#else
public static final net.minecraft.particle.DustParticleEffect BLUE = new net.minecraft.particle.DustParticleEffect(0.196F, 0.909F, 0.933F, 1.0F);
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.mtr.mapping.mapper.DirectionHelper;
import org.mtr.mapping.tool.HolderBase;
import org.mtr.mod.block.IBlock;
import ziyue.tjmetro.mapping.DustParticleEffect;

import javax.annotation.Nonnull;
import java.util.List;
Expand Down Expand Up @@ -115,9 +116,9 @@ public void randomDisplayTick2(BlockState state, World world, BlockPos pos, Rand
final double e = (double) pos.getY() + 0.4 + (random.data.nextDouble() - 0.5) * 0.2;
final double f = (double) pos.getZ() + 0.5 + (random.data.nextDouble() - 0.5) * 0.2;
float g = random.data.nextBoolean() ? -1 : -5.0f;
double h = (g /= 16.0f) * (float) direction.getOffsetX();
double i = g * (float) direction.getOffsetZ();
world.addParticle(new ParticleEffect(ParticleTypes.getAshMapped().data), d + h, e, f + i, 0.0, 0.0, 0.0);
final double h = (g /= 16.0f) * (float) direction.getOffsetX();
final double i = g * (float) direction.getOffsetZ();
world.addParticle(new ParticleEffect(DustParticleEffect.BLUE), d + h, e, f + i, 0.0, 0.0, 0.0);
}

@Override
Expand Down
17 changes: 17 additions & 0 deletions forge/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ziyue.tjmetro.mapping;

/**
* @author ZiYueCommentary
* @since 1.0.0-beta-2
*/

public class DustParticleEffect
{
#if MC_VERSION >= "11904"
public static final net.minecraft.core.particles.DustParticleOptions BLUE = new net.minecraft.core.particles.DustParticleOptions(net.minecraft.world.phys.Vec3.fromRGB24(3336430).toVector3f(), 1.0F); // 50, 232, 238
#elif MC_VERSION >= "11701"
public static final net.minecraft.core.particles.DustParticleOptions BLUE = new net.minecraft.core.particles.DustParticleOptions(new com.mojang.math.Vector3f(net.minecraft.world.phys.Vec3.fromRGB24(3336430)), 1.0F);
#else
public static final net.minecraft.particles.IParticleData BLUE = new net.minecraft.particles.RedstoneParticleData(0.196F, 0.909F, 0.933F, 1.0F);
#endif
}

0 comments on commit b62054b

Please sign in to comment.