Search in sources :

Example 1 with Capacity

use of arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity in project Solar by ArekkuusuJerii.

the class BlockNeutronBattery method getSubBlocks.

@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> items) {
    for (Capacity capacity : Capacity.values()) {
        ItemStack stack = new ItemStack(this);
        NBTHelper.setEnum(stack, capacity, "neutron_nbt");
        items.add(stack);
    }
}
Also used : Capacity(arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity) ItemStack(net.minecraft.item.ItemStack)

Example 2 with Capacity

use of arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity 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);
    }
}
Also used : Capacity(arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity) Vector3(net.katsstuff.mirror.data.Vector3)

Aggregations

Capacity (arekkuusu.solar.common.block.tile.TileNeutronBattery.Capacity)2 Vector3 (net.katsstuff.mirror.data.Vector3)1 ItemStack (net.minecraft.item.ItemStack)1