Search in sources :

Example 11 with Vector3

use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.

the class BlockSchrodingerGlyph method onBlockDestroyedByPlayer.

@Override
public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) {
    Vector3 vec = Vector3.Center().add(pos.getX(), pos.getY(), pos.getZ());
    Megumin.chant(world, vec, 5F, false).Oh_blackness_shrouded_in_light().Frenzied_blaze_clad_in_night().In_the_name_of_the_crimson_demons().let_the_collapse_of_thine_origin_manifest().Summon_before_me_the_root_of_thy_power_hidden_within_the_lands().of_the_kingdom_of_demise().EXPLOSION();
}
Also used : Vector3(net.katsstuff.mirror.data.Vector3)

Example 12 with Vector3

use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.

the class BlockBlinker method randomDisplayTick.

@Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    EnumFacing facing = state.getValue(BlockDirectional.FACING);
    boolean active = state.getValue(State.ACTIVE);
    Vector3 back = getOffSet(facing.getOpposite(), pos);
    facing = facing.getOpposite();
    for (int i = 0; i < 3 + rand.nextInt(6); i++) {
        Quat x = Quat.fromAxisAngle(Vector3.Forward(), (rand.nextFloat() * 2F - 1F) * 5);
        Quat z = Quat.fromAxisAngle(Vector3.Right(), (rand.nextFloat() * 2F - 1F) * 5);
        double speed = 0.01D + rand.nextDouble() * 0.015D;
        Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(speed).rotate(x.multiply(z));
        FXUtil.spawnLight(world, back, speedVec, 60, 2.5F, active ? 0x49FFFF : 0xFFFFFF, Light.GLOW);
    }
}
Also used : Quat(net.katsstuff.mirror.data.Quat) EnumFacing(net.minecraft.util.EnumFacing) Vector3(net.katsstuff.mirror.data.Vector3)

Example 13 with Vector3

use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.

the class BlockDilaton method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    if (state.getValue(State.ACTIVE)) {
        boolean powered = world.isBlockPowered(pos);
        EnumFacing facing = state.getValue(BlockDirectional.FACING);
        Vector3 posVec = Vector3.apply(pos.getX(), pos.getY(), pos.getZ()).add(0.5D);
        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.005D * rand.nextDouble();
            Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(speed).rotate(x.multiply(z));
            FXUtil.spawnLight(world, posVec, speedVec, 60, 2F, powered ? 0x49FFFF : 0xFF0303, Light.GLOW);
        }
    }
}
Also used : Quat(net.katsstuff.mirror.data.Quat) EnumFacing(net.minecraft.util.EnumFacing) Vector3(net.katsstuff.mirror.data.Vector3) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 14 with Vector3

use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.

the class TileGravityHopper method spawnParticles.

private void spawnParticles() {
    if (world.getTotalWorldTime() % 180 == 0) {
        EnumFacing facing = getFacing();
        Vector3 back = getOffSet(facing);
        Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(0.005D);
        FXUtil.spawnNeutron(world, back, speedVec, 40, 0.25F, 0xFF0303, false);
    } else if (world.getTotalWorldTime() % 4 == 0 && world.rand.nextBoolean()) {
        EnumFacing facing = getFacing().getOpposite();
        Vector3 back = getOffSet(facing);
        double speed = world.rand.nextDouble() * 0.015D;
        Vector3 speedVec = new Vector3.WrappedVec3i(facing.getDirectionVec()).asImmutable().multiply(speed);
        FXUtil.spawnLight(world, back, speedVec, 30, 2F, 0x49FFFF, Light.GLOW);
    }
}
Also used : EnumFacing(net.minecraft.util.EnumFacing) Vector3(net.katsstuff.mirror.data.Vector3)

Example 15 with Vector3

use of net.katsstuff.mirror.data.Vector3 in project Solar by ArekkuusuJerii.

the class TileVacuumConveyor method transposeItems.

private void transposeItems() {
    boolean impulse = false;
    if (world.isAirBlock(pos.offset(getFacingLazy().getOpposite()))) {
        applyGravity(attractInverse, 4D);
        impulse = true;
    }
    if (world.isAirBlock(pos.offset(getFacingLazy()))) {
        if (impulse) {
            BlockPos offset = getPos().offset(getFacingLazy());
            Vector3 spawn = Vector3.apply(offset.getX(), offset.getY(), offset.getZ()).add(0.5D);
            getItemsFiltered(new AxisAlignedBB(getPos()).grow(0.5D)).forEach(entity -> {
                impulseEntityItem(spawn, entity);
            });
        }
        applyGravity(repulseInverse, -4D);
    }
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) BlockPos(net.minecraft.util.math.BlockPos) Vector3(net.katsstuff.mirror.data.Vector3)

Aggregations

Vector3 (net.katsstuff.mirror.data.Vector3)23 Quat (net.katsstuff.mirror.data.Quat)8 EnumFacing (net.minecraft.util.EnumFacing)8 BlockPos (net.minecraft.util.math.BlockPos)7 IBlockState (net.minecraft.block.state.IBlockState)5 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 ItemStack (net.minecraft.item.ItemStack)3 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)3 Rotation (net.minecraft.util.Rotation)2 RayTraceResult (net.minecraft.util.math.RayTraceResult)2 PlacementSettings (net.minecraft.world.gen.structure.template.PlacementSettings)2 Template (net.minecraft.world.gen.structure.template.Template)2 ILumen (arekkuusu.solar.api.entanglement.energy.data.ILumen)1 Capacity (arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity)1 TileQelaion (arekkuusu.solar.common.block.tile.TileQelaion)1 EntityLumen (arekkuusu.solar.common.entity.EntityLumen)1 EntityTemporalItem (arekkuusu.solar.common.entity.EntityTemporalItem)1 MutableVector3 (net.katsstuff.mirror.data.MutableVector3)1 SoundType (net.minecraft.block.SoundType)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1