use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockQelaion method randomDisplayTick.
@Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
getTile(TileQelaion.class, world, pos).ifPresent(qelaion -> {
Vector3 posVec = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
boolean on = state.getValue(HAS_NODE);
for (EnumFacing facing : EnumFacing.values()) {
if (qelaion.isInput(facing))
continue;
for (int i = 0; i < 1 + rand.nextInt(3); i++) {
Quat x = Quat.fromAxisAngle(Vector3.Forward(), (rand.nextFloat() * 2F - 1F) * 6);
Quat z = Quat.fromAxisAngle(Vector3.Right(), (rand.nextFloat() * 2F - 1F) * 6);
double speed = 0.025D + 0.0025D * rand.nextDouble();
Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(speed).rotate(x.multiply(z));
FXUtil.spawnLight(world, posVec, speedVec, 60, 2F, on ? 0x49FFFF : 0xFF0303, Light.GLOW);
}
}
});
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockSchrodingerGlyph method randomDisplayTick.
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
if (world.isRemote && rand.nextInt(15) == 0 && getClosestPlayer(world, pos).isPresent()) {
for (EnumFacing facing : EnumFacing.values()) {
Vector3 from = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
Vector3 vec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(0.025D);
FXUtil.spawnNeutron(world, from, vec, 60, 0.25F, 0xFF0303, false);
}
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockElectron method randomDisplayTick.
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
if (state.getValue(State.POWER) > 0 && world.rand.nextBoolean()) {
for (int i = 0; i < 1 + world.rand.nextInt(3); i++) {
Vector3 from = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
Vector3 to = Vector3.rotateRandom().add(from);
FXUtil.spawnVolt(world, from, to, 4, 0.25F, 15, 0x5194FF, true, true);
}
FXUtil.playSound(world, pos, SolarSounds.SPARK, SoundCategory.BLOCKS, 0.05F);
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class BlockHyperConductor method randomDisplayTick.
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
Vector3 origin = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
for (EnumFacing facing : EnumFacing.values()) {
Vector3 vec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(0.025D);
FXUtil.spawnSquared(world, origin, vec, 40, 4F, 0xFFFFFF);
}
}
use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.
the class TilePholarizer method spit.
private void spit() {
EnumFacing facing = getFacingLazy();
BlockPos pos = getPos().offset(facing);
IBlockState state = world.getBlockState(pos);
facing = facing.getOpposite();
TileEntity tile;
if (state.getBlock().hasTileEntity(state) && (tile = world.getTileEntity(pos)).hasCapability(ModCapability.LUMEN_CAPABILITY, facing)) {
ILumen wrapper = tile.getCapability(ModCapability.LUMEN_CAPABILITY, facing);
if (wrapper.get() > 0) {
EntityLumen lumen = EntityLumen.spawn(world, new Vector3.WrappedVec3i(getPos()).asImmutable().add(0.5D), wrapper.drain(64));
Quat x = Quat.fromAxisAngle(Vector3.Forward(), (world.rand.nextFloat() * 2F - 1F) * 25F);
Quat z = Quat.fromAxisAngle(Vector3.Right(), (world.rand.nextFloat() * 2F - 1F) * 25F);
Vector3 vec = new Vector3.WrappedVec3i(getFacingLazy().getOpposite().getDirectionVec()).asImmutable().rotate(x.multiply(z)).multiply(0.1D);
lumen.motionX = vec.x();
lumen.motionY = vec.y();
lumen.motionZ = vec.z();
}
}
}
Aggregations