当前位置: 首页>>代码示例>>Java>>正文


Java ParticleBuilder.setAlphaFunction方法代码示例

本文整理汇总了Java中com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setAlphaFunction方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleBuilder.setAlphaFunction方法的具体用法?Java ParticleBuilder.setAlphaFunction怎么用?Java ParticleBuilder.setAlphaFunction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.teamwizardry.librarianlib.features.particle.ParticleBuilder的用法示例。


在下文中一共展示了ParticleBuilder.setAlphaFunction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:22,代码来源:LibParticles.java

示例2: 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);
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:26,代码来源:LibParticles.java

示例3: SPIRIT_WIGHT_FLAME_NORMAL

import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的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)));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:23,代码来源:LibParticles.java

示例4: 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));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:18,代码来源:LibParticles.java

示例5: 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(5);
	builder.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
	builder.setColorFunction(new InterpColorFade(Color.RED, 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() + 0.5, pos.getZ() + 0.5)), ThreadLocalRandom.current().nextInt(20, 40), 0, (aFloat, particleBuilder) -> {
		double radius = 0.3;
		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.3, 0.3), z1));
		builder.setScale(ThreadLocalRandom.current().nextFloat());
		builder.setMotion(new Vec3d(ThreadLocalRandom.current().nextDouble(-0.01, 0.01) / 10,
				ThreadLocalRandom.current().nextDouble(0.001, 0.01) / 10,
				ThreadLocalRandom.current().nextDouble(-0.01, 0.01) / 10));
		builder.setLifetime(ThreadLocalRandom.current().nextInt(30, 50));
	});
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:25,代码来源:PacketAssemblyProgressParticles.java

示例6: 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));
	});
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:25,代码来源:PacketAssemblyDoneParticles.java

示例7: 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)));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:13,代码来源:LibParticles.java

示例8: CRAFTING_ALTAR_CLUSTER_SUCTION

import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void CRAFTING_ALTAR_CLUSTER_SUCTION(World world, Vec3d pos, InterpFunction<Vec3d> bezier3D) {
	ParticleBuilder helix = new ParticleBuilder(200);
	helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
	helix.setAlphaFunction(new InterpFadeInOut(0.5f, 0.3f));

	ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
		helix.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
		helix.setScale(RandUtil.nextFloat());
		helix.setPositionFunction(bezier3D);
		helix.setScaleFunction(new InterpScale(1, 0));
		helix.setLifetime(RandUtil.nextInt(10, 30));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:14,代码来源:LibParticles.java

示例9: 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));
	glitter.setAcceleration(new Vec3d(0, -0.02, 0));
	glitter.setCollision(true);
	glitter.setCanBounce(true);
	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(50, 100));
		Vec3d direction = position.add(glitter.getPositionOffset()).subtract(position).normalize().scale(1 / 5);
		glitter.addMotion(direction.scale(RandUtil.nextDouble(0.5, 1)));
	});

}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:31,代码来源:ModuleEffectFreeze.java

示例10: 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)));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:15,代码来源:LibParticles.java

示例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);
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:11,代码来源:LibParticles.java

示例12: 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));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:13,代码来源:LibParticles.java

示例13: BOOK_BEAM_HELIX

import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
public static void BOOK_BEAM_HELIX(World world, Vec3d pos) {
	ParticleBuilder helix = new ParticleBuilder(200);
	helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
	helix.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));

	ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 30, 0, (aFloat, particleBuilder) -> {
		helix.setColor(new Color(255, 255, 255, RandUtil.nextInt(0, 255)));
		helix.setScale(RandUtil.nextFloat());
		helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(1.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
		helix.setLifetime(RandUtil.nextInt(0, 200));
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:13,代码来源:LibParticles.java

示例14: 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)));
	});

}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:28,代码来源:ModuleEffectLowGravity.java

示例15: 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;
		}
	});
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:31,代码来源:LibParticles.java


注:本文中的com.teamwizardry.librarianlib.features.particle.ParticleBuilder.setAlphaFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。