本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleBuilder.setColor方法的具体用法?Java ParticleBuilder.setColor怎么用?Java ParticleBuilder.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.teamwizardry.librarianlib.features.particle.ParticleBuilder
的用法示例。
在下文中一共展示了ParticleBuilder.setColor方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CRAFTING_ALTAR_IDLE
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void CRAFTING_ALTAR_IDLE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01),
RandUtil.nextDouble(0, 0.05),
RandUtil.nextDouble(-0.01, 0.01)));
glitter.setColor(new Color(0x0022FF));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
double radius = 0.1;
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
glitter.setScale((float) RandUtil.nextDouble(1, 2));
glitter.setLifetime(RandUtil.nextInt(5, 30));
glitter.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(1, 1.5), 0));
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.3), z));
});
}
示例2: EFFECT_NULL_GRAV
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void EFFECT_NULL_GRAV(World world, @Nonnull Vec3d pos, @Nullable EntityLivingBase caster, Color color) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(20, 30));
glitter.setColor(color == null ? Color.WHITE : color);
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(5, 10), RandUtil.nextInt(0, 30), (aFloat, particleBuilder) -> {
glitter.setScale((float) RandUtil.nextDouble(0.3, 0.8));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
if (RandUtil.nextBoolean())
glitter.setPositionFunction(new InterpHelix(
new Vec3d(0, caster == null ? 1 / 2 : caster.height / 2, 0),
new Vec3d(0, caster == null ? -1 : -caster.height, 0),
1f, 0f, 1f, RandUtil.nextFloat()));
else glitter.setPositionFunction(new InterpHelix(
new Vec3d(0, caster == null ? 1 / 2 : caster.height / 2, 0),
new Vec3d(0, caster == null ? 1.5 : caster.height + 0.5, 0),
1f, 0f, 1f, RandUtil.nextFloat()));
});
}
示例3: EFFECT_REGENERATE
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void EFFECT_REGENERATE(World world, @Nonnull Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setColor(ColorUtils.changeColorAlpha(color, RandUtil.nextInt(200, 255)));
glitter.setScale(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.disableRandom();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 20, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 40));
glitter.setScale(RandUtil.nextFloat());
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
double radius = 1;
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
Vec3d dest = new Vec3d(x, RandUtil.nextDouble(-1, 1), z);
glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, dest, dest.scale(2), new Vec3d(dest.x, RandUtil.nextDouble(-2, 2), dest.z)));
});
}
示例4: BLOCK_HIGHLIGHT
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void BLOCK_HIGHLIGHT(World world, BlockPos pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
glitter.setColor(color);
glitter.disableRandom();
glitter.disableMotionCalculation();
glitter.setScale(2f);
glitter.setLifetime(200);
double indent = 0.75;
Vec3d bottom = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5 - indent, pos.getZ() + 0.5);
Vec3d top = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5 + indent, pos.getZ() + 0.5);
Vec3d front = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 + indent);
Vec3d back = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 - indent);
Vec3d left = new Vec3d(pos.getX() + 0.5 + indent, pos.getY() + 0.5, pos.getZ() + 0.5);
Vec3d right = new Vec3d(pos.getX() + 0.5 - indent, pos.getY() + 0.5, pos.getZ() + 0.5);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(bottom), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(top), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(left), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(right), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(front), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(back), 1);
}
示例5: DEVIL_DUST_BIG_CRACKLES
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void DEVIL_DUST_BIG_CRACKLES(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setScale(RandUtil.nextFloat());
glitter.setColor(new Color(RandUtil.nextFloat(), 0, 0));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, builder) -> {
Vec3d offset = new Vec3d(RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5));
glitter.setPositionOffset(offset);
glitter.setLifetime(RandUtil.nextInt(30, 50));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(0.04, 0.06), RandUtil.nextDouble(-0.01, 0.01)));
});
}
示例6: DEVIL_DUST_SMALL_CRACKLES
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void DEVIL_DUST_SMALL_CRACKLES(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setColor(new Color(RandUtil.nextFloat(), 0, 0).darker());
glitter.setScale((float) RandUtil.nextDouble(0, 0.5));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 5, 0, (i, builder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 30));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.03, 0.03), RandUtil.nextDouble(0.07, 0.2), RandUtil.nextDouble(-0.03, 0.03)));
});
}
示例7: FAIRY_TRAIL
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void FAIRY_TRAIL(World world, Vec3d pos, Color color, boolean sad, int age) {
if (((age / 4) >= (age / 2)) || (age == 0)) return;
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(age / 8, age / 4));
glitter.setColor(color);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(1, 3), 0, (i, build) -> {
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(-0.02, 0.02)));
if (sad) {
glitter.setCollision(true);
glitter.enableMotionCalculation();
}
});
}
示例8: FAIRY_HEAD
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void FAIRY_HEAD(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(3);
glitter.setColor(color);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
glitter.setScale(3.5f);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 2);
ParticleBuilder glitter2 = new ParticleBuilder(5);
glitter2.setColor(color);
glitter2.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter2.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
glitter2.setScale(1);
ParticleSpawner.spawn(glitter2, world, new StaticInterp<>(pos), 3);
}
示例9: STRUCTURE_FLAIR
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void STRUCTURE_FLAIR(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0F, 0.9F));
glitter.setColor(color);
glitter.setLifetime(40);
glitter.setScale(2);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
build.setScale(5);
});
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 10, 0, (i, build) -> {
build.setScale(2);
int x = RandUtil.nextInt(4);
switch (x) {
case 0:
glitter.setMotion(new Vec3d(0, 0, 0.2));
break;
case 1:
glitter.setMotion(new Vec3d(0, 0, -0.2));
break;
case 2:
glitter.setMotion(new Vec3d(0.2, 0, 0));
break;
case 3:
glitter.setMotion(new Vec3d(-0.2, 0, 0));
break;
}
});
}
示例10: STRUCTURE_BEACON
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void STRUCTURE_BEACON(World world, Vec3d pos, Color color) {
ParticleBuilder beacon = new ParticleBuilder(10);
beacon.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
beacon.setScale(2);
beacon.setLifetime(40);
beacon.setAlphaFunction(new InterpFadeInOut(0F, 0.9F));
beacon.setColor(color);
ParticleSpawner.spawn(beacon, world, new StaticInterp<>(pos), 10, 0, (aFloat, particleBuilder) -> {
if (RandUtil.nextBoolean()) {
beacon.setMotion(new Vec3d(0, 0.2, 0));
} else {
beacon.setMotion(new Vec3d(0, -0.2, 0));
}
});
}
示例11: STRUCTURE_BOUNDS
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void STRUCTURE_BOUNDS(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(10));
glitter.setScale(RandUtil.nextFloat());
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.9F, 0.9F));
glitter.setScale(2);
glitter.setLifetime(40);
glitter.setColor(color);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1);
}
示例12: render
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void render(TileJar te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
//InterpBezier3D bezier = new InterpBezier3D(new Vec3d(te.getPos().add(-5, 5, 0)), new Vec3d(te.getPos().add(5, 5, 0)), new Vec3d(0, 3, 0), new Vec3d(0, -3, 0));
////InterpLine bezier = new InterpLine(new Vec3d(te.getPos().add(-5, 5, 0)), new Vec3d(te.getPos().add(5, 5, 0)));
//LightEffectUtil.renderBilinearGradient(bezier.list(50), Color.WHITE, 0.2, new Vec3d(0, 1, 0));
//LightEffectUtil.renderBilinearGradient(bezier.list(50), Color.BLUE, 0.3, new Vec3d(0, 1, 0));
//LightEffectUtil.renderBilinearGradient(bezier.list(50), Color.CYAN, 0.5, new Vec3d(0, 1, 0));
//LightEffectUtil.renderBilinearGradient(bezier.list(50), Color.CYAN, 1.5, new Vec3d(0, 1, 0));
if (!te.hasFairy) return;
double timeDifference = (ClientTickHandler.getTicks() + partialTicks) / 20.0;
Vec3d pos = new Vec3d(te.getPos()).addVector(0.5, 0.35 + 0.2 * MathHelper.sin((float) timeDifference), 0.5);
Color color = te.color;
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setColor(color);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
glitter.setScale(0.3f);
ParticleSpawner.spawn(glitter, te.getWorld(), new StaticInterp<>(pos), 1);
if (RandUtil.nextInt(10) == 0) {
ParticleBuilder trail = new ParticleBuilder(20);
trail.setColor(te.color);
trail.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
trail.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
trail.setScale(0.2f);
//trail.enableMotionCalculation();
ParticleSpawner.spawn(trail, te.getWorld(), new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
trail.setMotion(new Vec3d(
RandUtil.nextDouble(-0.005, 0.005),
RandUtil.nextDouble(-0.005, 0.005),
RandUtil.nextDouble(-0.005, 0.005)
));
});
}
}
示例13: SHAPE_BEAM
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void SHAPE_BEAM(World world, Vec3d target, Vec3d origin, Color color) {
ParticleBuilder beam = new ParticleBuilder(10);
beam.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
beam.setAlphaFunction(new InterpFadeInOut(0.3f, 1f));
//beam.disableRandom();
beam.setColor(ColorUtils.shiftColorHueRandomly(color, 10));
beam.setCollision(true);
Vec3d look = target.subtract(origin).normalize();
double dist = target.distanceTo(origin);
ParticleSpawner.spawn(beam, world, new StaticInterp<>(origin), 1, 0, (aFloat1, particleBuilder1) -> {
particleBuilder1.setPositionOffset(look.scale(RandUtil.nextDouble(0, dist)));
particleBuilder1.setScale(RandUtil.nextFloat(0.1f, 0.5f));
final int life = RandUtil.nextInt(50, 60);
particleBuilder1.setLifetime(life);
particleBuilder1.enableMotionCalculation();
particleBuilder1.setCollision(true);
particleBuilder1.setCanBounce(true);
particleBuilder1.setAcceleration(new Vec3d(0, -0.03, 0));
double radius = 2;
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
Vec3d dest = new Vec3d(x, RandUtil.nextDouble(-1, 2), z);
particleBuilder1.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, dest, dest.scale(2), new Vec3d(dest.x, RandUtil.nextDouble(-2, 2), dest.z)));
particleBuilder1.setTick(particle -> {
if (particle.getAge() >= particle.getLifetime() / RandUtil.nextDouble(2, 5)) {
if (particle.getAcceleration().y == 0)
particle.setAcceleration(new Vec3d(0, RandUtil.nextDouble(-0.05, -0.01), 0));
} else if (particle.getAcceleration().x != 0 || particle.getAcceleration().y != 0 || particle.getAcceleration().z != 0) {
particle.setAcceleration(Vec3d.ZERO);
}
});
});
ParticleSpawner.spawn(beam, world, new StaticInterp<>(origin), 10, 0, (aFloat, particleBuilder) -> {
particleBuilder.setTick(particle -> particle.setAcceleration(Vec3d.ZERO));
particleBuilder.setScaleFunction(new InterpFadeInOut(0, 1f));
particleBuilder.setAlphaFunction(new InterpFadeInOut(0.3f, 0.2f));
particleBuilder.setScale(RandUtil.nextFloat(0.5f, 1.5f));
particleBuilder.setLifetime(RandUtil.nextInt(10, 20));
particleBuilder.disableMotionCalculation();
particleBuilder.setMotion(Vec3d.ZERO);
particleBuilder.setCanBounce(false);
particleBuilder.setPositionOffset(Vec3d.ZERO);
particleBuilder.setPositionFunction(new InterpLine(Vec3d.ZERO, target.subtract(origin)));
});
}