本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setRender方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleBuilder.setRender方法的具体用法?Java ParticleBuilder.setRender怎么用?Java ParticleBuilder.setRender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.teamwizardry.librarianlib.features.particle.ParticleBuilder
的用法示例。
在下文中一共展示了ParticleBuilder.setRender方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FIZZING_ITEM
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的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.ParticleBuilder; //导入方法依赖的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: handle
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void handle(MessageContext messageContext) {
if (messageContext.side.isServer()) return;
World world = Minecraft.getMinecraft().player.world;
ParticleBuilder builder = new ParticleBuilder(1);
builder.setAlphaFunction(new InterpFadeInOut(0.1f, 0.3f));
builder.setColorFunction(new InterpColorFade(Color.GREEN, 1, 255, 1));
builder.setRender(new ResourceLocation(Constants.MOD_ID, "particles/glow"));
ParticleSpawner.spawn(builder, world, new StaticInterp<>(new Vec3d(pos.getX() + 0.5, pos.getY() + 1.25, pos.getZ() + 0.5)), ThreadLocalRandom.current().nextInt(200, 300), 0, (aFloat, particleBuilder) -> {
double radius = 0.1;
double t = 2 * Math.PI * ThreadLocalRandom.current().nextDouble(-radius, radius);
double u = ThreadLocalRandom.current().nextDouble(-radius, radius) + ThreadLocalRandom.current().nextDouble(-radius, radius);
double r = (u > 1) ? 2 - u : u;
double x1 = r * Math.cos(t), z1 = r * Math.sin(t);
builder.setPositionOffset(new Vec3d(x1, ThreadLocalRandom.current().nextDouble(-0.1, 0.1), z1));
builder.setScale(ThreadLocalRandom.current().nextFloat());
builder.setMotion(new Vec3d(ThreadLocalRandom.current().nextDouble(-0.01, 0.01),
ThreadLocalRandom.current().nextDouble(-0.01, 0.01),
ThreadLocalRandom.current().nextDouble(-0.01, 0.01)));
builder.setLifetime(ThreadLocalRandom.current().nextInt(20, 80));
});
}
示例4: 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));
});
}
示例5: SPIRIT_WIGHT_HURT
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的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));
});
}
示例6: runClient
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的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));
});
}
示例7: CRAFTING_ALTAR_HELIX
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的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));
});
}
示例8: runClient
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void runClient(@Nonnull SpellData spell) {
World world = spell.world;
Vec3d position = spell.getData(TARGET_HIT);
if (position == null) return;
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
glitter.setScale(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position), 5, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 20));
glitter.setScale(RandUtil.nextFloat());
glitter.setScaleFunction(new InterpScale(1, 0));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
glitter.setMotion(new Vec3d(
RandUtil.nextDouble(-0.1, 0.1),
RandUtil.nextDouble(-0.1, 0.1),
RandUtil.nextDouble(-0.1, 0.1)
));
});
}
示例9: FIZZING_EXPLOSION
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void FIZZING_EXPLOSION(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setScale(0.3f);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 300, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(20, 30));
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5)));
});
}
示例10: BOOK_BEAM_NORMAL
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void BOOK_BEAM_NORMAL(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 10, 0, (aFloat, particleBuilder) -> {
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(0, 1.0), RandUtil.nextDouble(-0.02, 0.02)));
glitter.setColor(new Color(255, 255, 255, RandUtil.nextInt(0, 255)));
glitter.setScale(RandUtil.nextFloat());
glitter.setLifetime(RandUtil.nextInt(0, 50));
});
}
示例11: 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)
));
});
}
}
示例12: runClient
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void runClient(@Nonnull SpellData spell) {
Entity caster = spell.getData(CASTER);
Entity target = spell.getData(DefaultKeys.ENTITY_HIT);
Entity finalEntity = isHead() ? caster == null ? target : caster : target;
if (finalEntity == null) return;
ParticleBuilder glitter = new ParticleBuilder(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(glitter, spell.world, new InterpCircle(finalEntity.getPositionVector().addVector(0, finalEntity.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));
});
}
示例13: 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);
}
示例14: CLUSTER_DRAPE
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void CLUSTER_DRAPE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(200);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
glitter.enableMotionCalculation();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setScale(RandUtil.nextFloat());
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01),
RandUtil.nextDouble(-0.01, 0.01),
RandUtil.nextDouble(-0.01, 0.01)));
glitter.setLifetime(RandUtil.nextInt(30, 60));
});
}
示例15: runClient
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void runClient(@Nonnull SpellData spell) {
World world = spell.world;
Vec3d position = spell.getData(TARGET_HIT);
if (position == null) return;
ParticleBuilder glitter = new ParticleBuilder(1);
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.1f));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.enableMotionCalculation();
glitter.setScaleFunction(new InterpScale(1, 0));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position), RandUtil.nextInt(5, 15), 0, (aFloat, particleBuilder) -> {
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);
glitter.setScale(RandUtil.nextFloat());
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(-2, 2), z));
glitter.setLifetime(RandUtil.nextInt(30, 40));
Vec3d direction = position.add(glitter.getPositionOffset()).subtract(position).normalize();
glitter.setMotion(direction.scale(RandUtil.nextDouble(0.5, 1.3)));
});
}