本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setLifetime方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleBuilder.setLifetime方法的具体用法?Java ParticleBuilder.setLifetime怎么用?Java ParticleBuilder.setLifetime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.teamwizardry.librarianlib.features.particle.ParticleBuilder
的用法示例。
在下文中一共展示了ParticleBuilder.setLifetime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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;
}
});
}
示例3: 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));
}
});
}
示例4: 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);
}
示例5: doRender
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void doRender(@Nonnull EntitySpellProjectile entity, double x, double y, double z, float entityYaw, float partialTicks) {
super.doRender(entity, x, y, z, entityYaw, partialTicks);
Color color = new Color(entity.getDataManager().get(DATA_COLOR), true);
Color color2 = new Color(entity.getDataManager().get(DATA_COLOR2), true);
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setAlphaFunction(new InterpFadeInOut(0f, 0.3f));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.enableMotionCalculation();
glitter.setCollision(true);
glitter.setCanBounce(true);
glitter.setColorFunction(new InterpColorHSV(color, color2));
glitter.setAcceleration(new Vec3d(0, -0.015, 0));
ParticleSpawner.spawn(glitter, entity.world, new StaticInterp<>(entity.getPositionVector().add(new Vec3d(entity.motionX, entity.motionY, entity.motionZ))), 5, 0, (aFloat, particleBuilder) -> {
particleBuilder.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(0.3, 0.8), 0));
particleBuilder.setLifetime(RandUtil.nextInt(40, 60));
particleBuilder.addMotion(new Vec3d(
RandUtil.nextDouble(-0.03, 0.03),
RandUtil.nextDouble(-0.01, 0.05),
RandUtil.nextDouble(-0.03, 0.03)
));
});
glitter.disableMotionCalculation();
glitter.setMotion(Vec3d.ZERO);
glitter.setLifetime(20);
glitter.setScaleFunction(new InterpFadeInOut(0f, 1f));
glitter.setAlphaFunction(new InterpFadeInOut(0f, 1f));
ParticleSpawner.spawn(glitter, entity.world, new StaticInterp<>(entity.getPositionVector()), 5, 0, (aFloat, particleBuilder) -> {
particleBuilder.setScale(RandUtil.nextFloat(0.5f, 2));
particleBuilder.setLifetime(RandUtil.nextInt(5, 10));
//particleBuilder.addMotion()
});
}
示例6: doRender
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void doRender(@Nonnull EntityBomb entity, double x, double y, double z, float entityYaw, float partialTicks) {
super.doRender(entity, x, y, z, entityYaw, partialTicks);
int type = entity.getDataManager().get(DATA_BOMB_TYPE);
Color color, color2;
if (type == 1) {
color = Color.CYAN;
color2 = Color.BLUE;
} else {
color = Color.RED;
color2 = Color.ORANGE;
}
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setAlphaFunction(new InterpFadeInOut(0f, 0.3f));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.enableMotionCalculation();
glitter.setCollision(true);
glitter.setCanBounce(true);
glitter.setAcceleration(new Vec3d(0, -0.015, 0));
ParticleSpawner.spawn(glitter, entity.world, new StaticInterp<>(entity.getPositionVector().add(new Vec3d(entity.motionX, entity.motionY, entity.motionZ))), 5, 0, (aFloat, particleBuilder) -> {
particleBuilder.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(0.3, 0.8), 0));
particleBuilder.setLifetime(RandUtil.nextInt(40, 60));
particleBuilder.addMotion(new Vec3d(
RandUtil.nextDouble(-0.03, 0.03),
RandUtil.nextDouble(-0.01, 0.05),
RandUtil.nextDouble(-0.03, 0.03)
));
if (RandUtil.nextBoolean()) {
particleBuilder.setColor(color);
} else {
particleBuilder.setColor(color2);
}
});
glitter.disableMotionCalculation();
glitter.setMotion(Vec3d.ZERO);
glitter.setLifetime(20);
glitter.setScaleFunction(new InterpFadeInOut(0f, 1f));
glitter.setAlphaFunction(new InterpFadeInOut(0f, 1f));
ParticleSpawner.spawn(glitter, entity.world, new StaticInterp<>(entity.getPositionVector()), 5, 0, (aFloat, particleBuilder) -> {
particleBuilder.setScale(RandUtil.nextFloat(0.5f, 2));
particleBuilder.setLifetime(RandUtil.nextInt(5, 10));
//particleBuilder.addMotion()
});
}