use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class TileQuantumMirror method update.
@Override
public void update() {
if (world.isRemote && world.rand.nextInt(10) == 0) {
Vector3 from = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
FXUtil.spawnMute(world, from, Vector3.rotateRandom().multiply(0.1F), 20, 0.1F, 0XFFFFFF, GlowTexture.STAR);
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class TileVacuumConveyor method spawnLightParticles.
private void spawnLightParticles(EnumFacing facing, boolean inverse) {
Vector3 back = getOffSet(facing);
facing = facing.getOpposite();
Quat x = Quat.fromAxisAngle(Vector3.Forward(), (world.rand.nextFloat() * 2F - 1F) * 5);
Quat z = Quat.fromAxisAngle(Vector3.Right(), (world.rand.nextFloat() * 2F - 1F) * 5);
double speed = world.rand.nextDouble() * 0.03D;
Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().rotate(x.multiply(z)).multiply(speed);
FXUtil.spawnMute(world, back, speedVec, 100, 2.5F, inverse ? 0xFFFFFF : 0x000000, GlowTexture.GLINT);
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class AshenCubeStructure method genCubes.
private void genCubes(World world, BlockPos pos) {
// Gen Cube
BlockPos origin = pos.add(5, 0, 5);
Template template = Structure.ASHEN_CUBE.load(world);
boolean loot = GEN_CONFIG.ashen_cube.loot / 100D > random.nextDouble();
PlacementSettings integrity = new PlacementSettings();
integrity.setIntegrity(loot ? 1F : 0.35F + 0.45F * random.nextFloat());
template.addBlocksToWorld(world, origin, integrity);
integrity.setIntegrity(!loot && random.nextFloat() > 0.45F ? 1F : random.nextFloat());
Structure.ASHEN_CUBE_.generate(world, origin, integrity);
// Add loot
for (int i = 0; i < 6 + random.nextInt(6); i++) {
loot = GEN_CONFIG.monolith.structure.loot / 100D > random.nextDouble();
if (loot) {
BlockPos inside = origin.add(1 + random.nextInt(4), 1, 1 + random.nextInt(4));
IBlockState pot = ModBlocks.LARGE_POT.getDefaultState().withProperty(BlockLargePot.POT_VARIANT, random.nextInt(3));
world.setBlockState(inside, pot);
}
}
// Gen Cubes
AxisAlignedBB cubeBB = new AxisAlignedBB(origin, origin.add(template.getSize()));
for (int i = 0; i < GEN_CONFIG.ashen_cube.size; i++) {
Template cube = nuggets.next().load(world);
Rotation rotation = Rotation.values()[random.nextInt(4)];
Vector3 vec = rotate(new Vector3.WrappedVec3i(cube.getSize()).asImmutable(), rotation);
BlockPos offset = pos.add(randomVector().toBlockPos());
if (offset.getY() < 1 || (world.canSeeSky(offset) && GEN_CONFIG.ashen_cube.underground))
continue;
AxisAlignedBB nuggetBB = new AxisAlignedBB(offset, vec.add(new Vector3.WrappedVec3i(offset)).toBlockPos());
if (!nuggetBB.intersects(cubeBB)) {
PlacementSettings settings = new PlacementSettings();
settings.setIntegrity(random.nextFloat() > 0.85F ? 0.9F : 0.35F + 0.45F * random.nextFloat());
settings.setRotation(rotation);
settings.setRandom(random);
cube.addBlocksToWorld(world, offset, settings);
}
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockNeutronBattery method randomDisplayTick.
@Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
Vector3 vec = Vector3.apply(pos.getX(), pos.getY(), pos.getZ());
Capacity capacity = state.getValue(CAPACITY);
for (int i = 0; i < 3 + rand.nextInt(4); i++) {
Vector3 posVec = vec.add(0.35D + 0.3D * rand.nextFloat(), 0.15D + 0.35D * rand.nextFloat(), 0.35D + 0.3D * rand.nextFloat());
double speed = 0.005D + 0.005D * rand.nextDouble();
Vector3 speedVec = Vector3.rotateRandom().multiply(speed);
FXUtil.spawnLight(world, posVec, speedVec, 30, 2F, capacity.color, Light.GLOW);
FXUtil.spawnLight(world, vec.add(0.5D), Vector3.Up().multiply(0.02D), 100, 2F, capacity.color, Light.GLOW);
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockQimranut method randomDisplayTick.
@Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
EnumFacing facing = state.getValue(BlockDirectional.FACING);
Vector3 back = getOffSet(facing.getOpposite(), pos);
for (int i = 0; i < 3 + rand.nextInt(6); i++) {
Quat x = Quat.fromAxisAngle(Vector3.Forward(), (rand.nextFloat() * 2F - 1F) * 75);
Quat z = Quat.fromAxisAngle(Vector3.Right(), (rand.nextFloat() * 2F - 1F) * 75);
double speed = 0.005D + rand.nextDouble() * 0.005D;
Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(speed).rotate(x.multiply(z));
FXUtil.spawnLight(world, back, speedVec, 45, 2F, 0x1BE564, Light.GLOW);
}
}
Aggregations