本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleSpawner类的典型用法代码示例。如果您正苦于以下问题:Java ParticleSpawner类的具体用法?Java ParticleSpawner怎么用?Java ParticleSpawner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParticleSpawner类属于com.teamwizardry.librarianlib.features.particle包,在下文中一共展示了ParticleSpawner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FIZZING_ITEM
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void FIZZING_ITEM(World world, Vec3d pos) {
ParticleBuilder fizz = new ParticleBuilder(10);
fizz.setScale(0.3f);
fizz.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
fizz.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(fizz, world, new StaticInterp<>(pos.addVector(0, 0.5, 0)), 10, 0, (aFloat, particleBuilder) -> {
fizz.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
fizz.setLifetime(RandUtil.nextInt(20, 30));
fizz.setPositionOffset(new Vec3d(
RandUtil.nextDouble(-0.1, 0.1),
RandUtil.nextDouble(-0.1, 0.1),
RandUtil.nextDouble(-0.1, 0.1)
));
fizz.setMotion(new Vec3d(RandUtil.nextDouble(-0.005, 0.005), RandUtil.nextDouble(0.04, 0.08), RandUtil.nextDouble(-0.005, 0.005)));
});
}
示例2: BOOK_LARGE_EXPLOSION
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void BOOK_LARGE_EXPLOSION(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(1000);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1000, 0, (i, build) -> {
double radius = 1.0;
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.setPositionOffset(new Vec3d(0, RandUtil.nextDouble(0, 255.0), 0));
glitter.setMotion(new Vec3d(x, 0, z));
glitter.setJitter(10, new Vec3d(RandUtil.nextDouble(-0.05, 0.05), RandUtil.nextDouble(-0.05, -0.01), RandUtil.nextDouble(-0.05, 0.05)));
glitter.enableMotionCalculation();
glitter.setColor(new Color(255, 255, 255, RandUtil.nextInt(70, 170)));
glitter.setScale((float) RandUtil.nextDouble(0.3, 0.5));
});
}
示例3: SPIRIT_WIGHT_FLAME_FAR
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void SPIRIT_WIGHT_FLAME_FAR(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 5, 0, (i, build) -> {
double radius = 0.15;
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.setColorFunction(new InterpColorHSV(Color.RED, 50, 20.0F));
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.5), z));
glitter.addMotion(new Vec3d(0, RandUtil.nextDouble(0, 0.02), 0));
});
}
示例4: SPIRIT_WIGHT_FLAME_CLOSE
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void SPIRIT_WIGHT_FLAME_CLOSE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 20, 0, (i, build) -> {
double radius = 0.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);
glitter.setColor(Color.RED);
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.5), z));
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(0, 0.03), RandUtil.nextDouble(-0.02, 0.02)));
});
}
示例5: SPIRIT_WIGHT_FLAME_NORMAL
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void SPIRIT_WIGHT_FLAME_NORMAL(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 10, 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.setLifetime(RandUtil.nextInt(10, 40));
glitter.setColor(new Color(0x4DFFFFFF, true));
glitter.setScaleFunction(new InterpScale(0, (float) RandUtil.nextDouble(3, 4)));
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.2), z));
if (RandUtil.nextInt(15) == 0)
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01),
RandUtil.nextDouble(0, 0.03),
RandUtil.nextDouble(-0.01, 0.01)));
});
}
示例6: CRAFTING_ALTAR_IDLE
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的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));
});
}
示例7: SPIRIT_WIGHT_HURT
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void SPIRIT_WIGHT_HURT(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
glitter.setColorFunction(new InterpColorHSV(Color.BLUE, 50, 20.0F));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(40, 100), 0, (i, build) -> {
double radius = 0.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);
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.4), z));
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0, 0.02), 0));
});
}
示例8: EXPLODE
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void EXPLODE(World world, Vec3d pos, Color color1, Color color2, double strengthUpwards, double strengthSideways, int amount, int lifeTime, int lifeTimeRange, boolean bounce) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setCollision(true);
glitter.enableMotionCalculation();
glitter.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(color1, RandUtil.nextInt(50, 150)), ColorUtils.changeColorAlpha(color2, RandUtil.nextInt(50, 150))));
glitter.setAcceleration(new Vec3d(0, RandUtil.nextDouble(-0.03, -0.04), 0));
glitter.setCanBounce(true);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), amount, 0, (i, build) -> {
double radius = RandUtil.nextDouble(1, 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 normalize = new Vec3d(x, 0, z).normalize();
glitter.setMotion(new Vec3d(
normalize.x * RandUtil.nextDouble(-strengthSideways, strengthSideways),
RandUtil.nextDouble(-strengthUpwards, strengthUpwards),
normalize.z * RandUtil.nextDouble(-strengthSideways, strengthSideways)
));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, RandUtil.nextFloat()));
glitter.setLifetime(RandUtil.nextInt(lifeTime - lifeTimeRange, lifeTime + lifeTimeRange));
glitter.setScale(RandUtil.nextFloat());
});
}
示例9: CRAFTING_ALTAR_HELIX
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void CRAFTING_ALTAR_HELIX(World world, Vec3d pos) {
ParticleBuilder beam = new ParticleBuilder(200);
beam.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
beam.setAlphaFunction(new InterpFadeInOut(1f, 1f));
pos = pos.addVector(0, 0.75, 0);
ParticleSpawner.spawn(beam, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
beam.setScale(RandUtil.nextFloat());
beam.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
beam.setMotion(new Vec3d(0, RandUtil.nextDouble(0.1, 0.8), 0));
beam.setLifetime(RandUtil.nextInt(0, 40));
});
ParticleBuilder helix = new ParticleBuilder(200);
helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
helix.setAlphaFunction(new InterpFadeInOut(1f, 1f));
ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
helix.setScale(RandUtil.nextFloat());
helix.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(200, 255)));
helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(0.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
helix.setLifetime(RandUtil.nextInt(0, 100));
});
}
示例10: MAGIC_DOT
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
public static void MAGIC_DOT(World world, Vec3d pos, float scale) {
ParticleBuilder glitter = new ParticleBuilder(3);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.enableMotionCalculation();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(new Color(RandUtil.nextInt(0, 100), RandUtil.nextInt(0, 100), RandUtil.nextInt(50, 255)));
if (scale == -1) glitter.setScale(RandUtil.nextFloat());
else {
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0.3), 0));
glitter.setLifetime(RandUtil.nextInt(30));
glitter.setScale(scale);
}
});
}
示例11: EFFECT_NULL_GRAV
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的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()));
});
}
示例12: EFFECT_REGENERATE
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的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)));
});
}
示例13: BLOCK_HIGHLIGHT
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的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);
}
示例14: update
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
@Override
public void update() {
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient()
{
if (RandUtil.nextInt(4) == 0) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
glitter.setColorFunction(new InterpColorHSV(Color.CYAN, Color.BLUE));
glitter.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(1, 3), 0));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pos).addVector(0.5, 0.5, 0.5)), 1, 0, (i, build) -> {
build.setMotion(new Vec3d(
RandUtil.nextDouble(-0.01, 0.01),
RandUtil.nextDouble(0, 0.03),
RandUtil.nextDouble(-0.01, 0.01)));
});
}
}
});
}
示例15: runClient
import com.teamwizardry.librarianlib.features.particle.ParticleSpawner; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void runClient(@Nonnull SpellData spell) {
Entity targetEntity = spell.getData(ENTITY_HIT);
if (targetEntity == null) return;
ParticleBuilder glitter = new ParticleBuilder(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(glitter, spell.world, new InterpCircle(targetEntity.getPositionVector().addVector(0, targetEntity.height / 2.0, 0), new Vec3d(0, 1, 0), 1, 10), 50, RandUtil.nextInt(10, 15), (aFloat, particleBuilder) -> {
if (RandUtil.nextBoolean()) {
glitter.setColor(getPrimaryColor());
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0.01, 0.1), 0));
} else {
glitter.setColor(getSecondaryColor());
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(-0.1, -0.01), 0));
}
glitter.setLifetime(RandUtil.nextInt(20, 30));
glitter.setScale((float) RandUtil.nextDouble(0.3, 1));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, (float) RandUtil.nextDouble(0.6, 1)));
glitter.setLifetime(RandUtil.nextInt(10, 20));
glitter.setScaleFunction(new InterpScale(1, 0));
});
}