本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setScale方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleBuilder.setScale方法的具体用法?Java ParticleBuilder.setScale怎么用?Java ParticleBuilder.setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.teamwizardry.librarianlib.features.particle.ParticleBuilder
的用法示例。
在下文中一共展示了ParticleBuilder.setScale方法的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: 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)));
});
}
示例3: 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);
}
示例4: 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)
));
});
}
示例5: FIZZING_AMBIENT
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void FIZZING_AMBIENT(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setScale(0.3f);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pos.x + RandUtil.nextDouble(-0.5, 0.5), pos.y + RandUtil.nextDouble(-0.5, 0.5), pos.z + RandUtil.nextDouble(-0.5, 0.5))), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setLifetime(RandUtil.nextInt(20, 30));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.05, 0.05), RandUtil.nextDouble(0.05, 0.1), RandUtil.nextDouble(-0.05, 0.05)));
});
}
示例6: 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)));
});
}
示例7: 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)));
});
}
示例8: 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)));
});
}
示例9: 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);
}
示例10: 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;
}
});
}
示例11: 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));
}
});
}
示例12: 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);
}
示例13: 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)
));
});
}
}
示例14: update
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void update() {
World world = getWorld();
if (world.isBlockPowered(pos) || world.isBlockIndirectlyGettingPowered(pos) > 0) return;
if (!inventory.getStackInSlot(0).isEmpty()) {
Vec3d center = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
EnumFacing face = world.getBlockState(pos).getValue(BlockDirectional.FACING);
Vec3d vec = PosUtils.getVecFromFacing(face);
Vec3d facingVec = PosUtils.getVecFromFacing(face).scale(1.0 / 3.0);
ParticleBuilder glitter = new ParticleBuilder(ThreadLocalRandom.current().nextInt(20, 30));
glitter.setScale((float) ThreadLocalRandom.current().nextDouble(0.5, 1));
glitter.setAlpha((float) ThreadLocalRandom.current().nextDouble(0.3, 0.7));
glitter.setRender(new ResourceLocation(Constants.MOD_ID, "particles/glow"));
glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 1.0f));
glitter.setMotion(facingVec.scale(1.0 / 50.0));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(center), 2);
Color color = new Color(255, 255, 255, ConfigValues.GLOWSTONE_ALPHA);
new Beam(world, center, vec, color).spawn();
if (tick < ConfigValues.GLOWSTONE_FUEL_EXPIRE_DELAY) tick++;
else {
tick = 0;
inventory.extractItem(0, 1, false);
markDirty();
}
}
}
示例15: EFFECT_BURN
import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void EFFECT_BURN(World world, @Nonnull Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(3);
glitter.setScale(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 4, 0, (aFloat, particleBuilder) -> {
glitter.setColor(ColorUtils.changeColorAlpha(color, RandUtil.nextInt(200, 255)));
glitter.setLifetime(RandUtil.nextInt(10, 30));
glitter.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(3, 10), 0f));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
glitter.addMotion(new Vec3d(
RandUtil.nextDouble(-0.05, 0.05),
RandUtil.nextDouble(0.05),
RandUtil.nextDouble(-0.05, 0.05)
));
glitter.setPositionOffset(new Vec3d(
RandUtil.nextDouble(-0.3, 0.3),
RandUtil.nextDouble(-0.3, 0.3),
RandUtil.nextDouble(-0.3, 0.3)
));
});
ParticleBuilder dust = new ParticleBuilder(3);
dust.setScale(1);
dust.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(dust, world, new StaticInterp<>(pos), 3, 0, (aFloat, particleBuilder) -> {
dust.setLifetime(RandUtil.nextInt(10, 30));
dust.setScaleFunction(new InterpScale(3f, 0.5f));
dust.setAlphaFunction(new InterpFadeInOut(1, 1));
dust.setColor(Color.DARK_GRAY);
dust.addMotion(new Vec3d(
RandUtil.nextDouble(-0.05, 0.05),
RandUtil.nextDouble(0.05),
RandUtil.nextDouble(-0.05, 0.05)
));
});
//ParticleBuilder dust = new ParticleBuilder(3);
//dust.setScale(1);
//dust.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
//
//ParticleSpawner.spawn(dust, world, new StaticInterp<>(pos), 10, 0, (aFloat, particleBuilder) -> {
// dust.setColor(Color.DARK_GRAY);
// dust.setLifetime(RandUtil.nextInt(20, 30));
// dust.setScale(1);
// dust.setScaleFunction(new InterpFadeInOut(0, 0.9f));
// //dust.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
// double x = RandUtil.nextDouble(-4, 4),
// z = RandUtil.nextDouble(-4, 4);
// dust.setPositionFunction(new InterpBezier3D(Vec3d.ZERO,
// new Vec3d(x, RandUtil.nextDouble(4), z),
// new Vec3d(x, -5, z), new Vec3d(0, 1, 0)));
//
// //double radius = 3;
// //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,
// // new Vec3d(0, RandUtil.nextDouble(0, 1), 0),
// // new Vec3d(0, RandUtil.nextDouble(-2, 0), 0)));
//});
}