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


Java ParticleBuilder.setRenderNormalLayer方法代码示例

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


在下文中一共展示了ParticleBuilder.setRenderNormalLayer方法的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);
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:26,代码来源:LibParticles.java

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

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

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

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

示例6: handle

import com.teamwizardry.librarianlib.features.particle.ParticleBuilder; //导入方法依赖的package包/类
@Override
public void handle(MessageContext ctx) {
	if (ctx.side.isServer()) return;

	World world = Refraction.proxy.getWorld();

	double add = 2;
	Vec3d offset;
	switch (facing) {
		case UP:
			offset = new Vec3d(0, add, 0);
			break;
		case DOWN:
			offset = new Vec3d(0, -add, 0);
			break;
		case EAST:
			offset = new Vec3d(add, 0, 0);
			break;
		case WEST:
			offset = new Vec3d(-add, 0, 0);
			break;
		case SOUTH:
			offset = new Vec3d(0, 0, add);
			break;
		case NORTH:
			offset = new Vec3d(0, 0, -add);
			break;
		default:
			offset = new Vec3d(0, add, 0);
			break;
	}

	Vec3d tmp = Minecraft.getMinecraft().player.getLook(0);
	Vec3d normal = new Vec3d(tmp.xCoord, 0, tmp.zCoord);

	ParticleBuilder wormholeVoid = new ParticleBuilder(10);
	wormholeVoid.setAlphaFunction(new InterpFadeInOut(0.9f, 0.9f));
	wormholeVoid.setRenderNormalLayer(new ResourceLocation(Constants.MOD_ID, "particles/glow"));
	ParticleSpawner.spawn(wormholeVoid, world, new InterpCircle(new Vec3d(pos).addVector(0.5, 0.5, 0.5).add(offset), normal, 1.20f, 1f, ThreadLocalRandom.current().nextFloat()), ThreadLocalRandom.current().nextInt(10, 20), 0, (aFloat, particleBuilder) -> {
		int rnd = ThreadLocalRandom.current().nextInt(0, 40);
		wormholeVoid.setColor(new Color(rnd, 0, rnd));
		wormholeVoid.setMotion(new Vec3d(
				ThreadLocalRandom.current().nextDouble(-0.01, 0.01),
				ThreadLocalRandom.current().nextDouble(-0.01, 0.01),
				ThreadLocalRandom.current().nextDouble(-0.01, 0.01)
		));
		wormholeVoid.setScale((float) ThreadLocalRandom.current().nextDouble(1, 2));
		wormholeVoid.setLifetime(ThreadLocalRandom.current().nextInt(30, 40));
	});

	ParticleBuilder wormholeHalo = new ParticleBuilder(5);
	ParticleSpawner.spawn(wormholeHalo, world, new InterpCircle(new Vec3d(pos).addVector(0.5, 0.5, 0.5).add(offset), normal, 1.25f, 1, ThreadLocalRandom.current().nextFloat()), ThreadLocalRandom.current().nextInt(10, 20), 0, (aFloat, particleBuilder) -> {
		wormholeHalo.setAlphaFunction(new InterpFadeInOut(0.9f, 0.9f));
		wormholeHalo.setRender(new ResourceLocation(Constants.MOD_ID, "particles/glow"));
		wormholeHalo.setScale((float) ThreadLocalRandom.current().nextDouble(1.5, 1.75));
		wormholeHalo.setLifetime(ThreadLocalRandom.current().nextInt(10, 20));
	});
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:59,代码来源:PacketWormholeParticles.java


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