diff --git a/fabric/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java b/fabric/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java new file mode 100644 index 0000000..9b3f80c --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java @@ -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 +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java index 377a6a0..748fb21 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java @@ -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; @@ -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 diff --git a/forge/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java b/forge/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java new file mode 100644 index 0000000..f93b910 --- /dev/null +++ b/forge/src/main/java/ziyue/tjmetro/mapping/DustParticleEffect.java @@ -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 +}